title: Cannot run TensorFlow compiled with MKL
body: <p>I've compiled the latest TensorFlow on Ubuntu 16.04 with CUDA and MKL like so</p>
  
  <pre><code>bazel build --config=opt --cxxopt="-D_GLIBCXX_USE_CXX11_ABI=0" --config=mkl --config=cuda //tensorflow/tools/pip_package:build_pip_package
  </code></pre>
  
  <p>And now when I'm trying to run it I'm getting an error saying that one of intel's libraries can't be found. I've also found other people who're installing a different DNN framework struggling with this <a href="https://github.com/PaddlePaddle/Paddle/issues/3213" rel="nofollow noreferrer">https://github.com/PaddlePaddle/Paddle/issues/3213</a> and found an Intel doc <a href="https://software.intel.com/en-us/articles/intel-mkl-dnn-part-1-library-overview-and-installation" rel="nofollow noreferrer">https://software.intel.com/en-us/articles/intel-mkl-dnn-part-1-library-overview-and-installation</a> that basically says that these files should become avilable when you follow the directions in that doc as far as I understood this. I've followed those directions and everything seems to have worked, but in reality those <code>libmklml_intel.so</code> and <code>libiomp5.so</code> files weren't added to <code>/usr/local/lib</code>.</p>
  
  <pre><code>&gt;&gt;&gt; import tensorflow
  
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
    File "/usr/local/lib/python2.7/dist-packages/tensorflow/__init__.py", line 24, in &lt;module&gt;
      from tensorflow.python import *
    File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/__init__.py", line 49, in &lt;module&gt;
      from tensorflow.python import pywrap_tensorflow
    File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 52, in &lt;module&gt;
      raise ImportError(msg)
  ImportError: Traceback (most recent call last):
    File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 41, in &lt;module&gt;
      from tensorflow.python.pywrap_tensorflow_internal import *
    File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in &lt;module&gt;
      _pywrap_tensorflow_internal = swig_import_helper()
    File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper
      _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
  ImportError: libmklml_intel.so: cannot open shared object file: No such file or directory
  </code></pre>
  
  <p>Edit:
  actually, they were located in <code>/mkl-dnn/external/mklml_lnx_2018.0.20170720/lib</code> after I've cloned <code>mkl-dnn</code> git and followed directions in <a href="https://software.intel.com/en-us/articles/intel-mkl-dnn-part-1-library-overview-and-installation" rel="nofollow noreferrer">https://software.intel.com/en-us/articles/intel-mkl-dnn-part-1-library-overview-and-installation</a></p>