{"action":"created","issue":{"url":"https://api.github.com/repos/tensorflow/tensorflow/issues/2053","repository_url":"https://api.github.com/repos/tensorflow/tensorflow","labels_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/2053/labels{/name}","comments_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/2053/comments","events_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/2053/events","html_url":"https://github.com/tensorflow/tensorflow/issues/2053","id":150176807,"number":2053,"title":"Failed to build from source due to missing libcudart.so.7.5:","user":{"login":"akors","id":3023492,"avatar_url":"https://avatars.githubusercontent.com/u/3023492?v=3","gravatar_id":"","url":"https://api.github.com/users/akors","html_url":"https://github.com/akors","followers_url":"https://api.github.com/users/akors/followers","following_url":"https://api.github.com/users/akors/following{/other_user}","gists_url":"https://api.github.com/users/akors/gists{/gist_id}","starred_url":"https://api.github.com/users/akors/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akors/subscriptions","organizations_url":"https://api.github.com/users/akors/orgs","repos_url":"https://api.github.com/users/akors/repos","events_url":"https://api.github.com/users/akors/events{/privacy}","received_events_url":"https://api.github.com/users/akors/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-04-21T20:02:20Z","updated_at":"2016-04-22T13:09:53Z","closed_at":null,"body":"Hi! I tried to compile the tutorials_example_trainer file, and I have quite a journey behind me. I recompiled GCC several times, I recompiled bazel dozens of times and did a fair share of CROSSTOOLS editing.\r\nAt this point, I am stuck. The compliation fails with the message:\r\n\r\n`bazel-out/host/bin/tensorflow/cc/ops/random_ops_gen_cc: error while loading shared libraries: libcudart.so.7.5: cannot open shared object file: No such file or directory\r\nTarget //tensorflow/cc:tutorials_example_trainer failed to build`\r\n\r\nI am using Tensorflow HEAD (currently 7b536cd5cfdbfd0fbc80496a38624557fb977783), I have CUDA 7.5 installed in /usr/local/cuda-7.5 .\r\n\r\nMy LD_LIBRARY_PATH is set to :/usr/local/cuda/lib64:/usr/local/cuda/lib64 , and the files exist there.\r\nI tried to point bazel to the library directory by adding \r\n\r\n`+  linker_flag: \"-L/usr/local/cuda/lib64\"`\r\n.\r\n\r\n\r\n### Environment info\r\nOperating System: Fedora 23\r\n\r\nInstalled version of CUDA and cuDNN: 7.5 and 4.0.7\r\n```\r\n$ ls /usr/local/cuda-7.5/lib64/libcud*\r\n/usr/local/cuda-7.5/lib64/libcudadevrt.a    /usr/local/cuda-7.5/lib64/libcudart.so.7.5.18  /usr/local/cuda-7.5/lib64/libcudnn.so.4\r\n/usr/local/cuda-7.5/lib64/libcudart.so      /usr/local/cuda-7.5/lib64/libcudart_static.a   /usr/local/cuda-7.5/lib64/libcudnn.so.4.0.7\r\n/usr/local/cuda-7.5/lib64/libcudart.so.7.5  /usr/local/cuda-7.5/lib64/libcudnn.so          /usr/local/cuda-7.5/lib64/libcudnn_static.a\r\n```\r\n\r\nIf installed from sources, provide the commit hash: 7b536cd5cfdbfd0fbc80496a38624557fb977783\r\n\r\n### Steps to reproduce\r\n1. Recompiled Bazel, version 0.2.1 with the following patch: https://gist.github.com/akors/5db13e874c144b3b111f0e0326d7b771#file-bazel-custom-gcc-patch\r\n2. Applied the following patch to TensorFlow: https://gist.github.com/akors/5db13e874c144b3b111f0e0326d7b771#file-tensorflow-custom-gcc-patch\r\n3. Ran ./configure with /opt/gcc-4.9/bin/gcc as compiler, but default otherwise.\r\n4. Ran bazel build -c opt --config=cuda --local_resources 4096,3.0,1.0 -j 4 //tensorflow/cc:tutorials_example_trainer --verbose_failures\r\n\r\n### What have you tried?\r\n1. I cried a lot.\r\n2. Add `linker_flag: \"-L/usr/local/cuda/lib64\"` to `third_party/gpus/crosstool/CROSSTOOL`\r\n3. Add `linker_flag: \"-Wl,-R/usr/local/cuda/lib64\"`  to `third_party/gpus/crosstool/CROSSTOOL`\r\n4. Recompile bazel, with added `linker_flag: \"-Wl,-R/usr/local/cuda/lib64\"` in `tools/cpp/CROSSTOOL`\r\n5. Create a file `/etc/ld.so.conf.d/LOCAL_cuda-lib64.conf` with the contents `/usr/local/cuda/lib64` and ran `ldconfig`\r\n\r\n### Logs or other output that would be helpful\r\n\r\n\r\nHere's the full output of the last operation:\r\n```\r\nERROR: /home/alexander/.local/src/tensorflow/tensorflow/cc/BUILD:28:1: Executing genrule //tensorflow/cc:random_ops_genrule failed: namespace-sandbox failed: error executing command \r\n  (cd /home/alexander/.cache/bazel/_bazel_alexander/3fc3a90944d6c7fe99106d6e515412c7/tensorflow && \\\r\n  exec env - \\\r\n    PATH=/usr/lib/ccache:/usr/lib/ccache:/usr/lib64/qt-3.3/bin:/usr/lib64/ccache:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/home/alexander/.local/bin:/home/alexander/bin:/home/alexander/.local/bin:/home/alexander/bin \\\r\n  /home/alexander/.cache/bazel/_bazel_alexander/3fc3a90944d6c7fe99106d6e515412c7/tensorflow/_bin/namespace-sandbox @/home/alexander/.cache/bazel/_bazel_alexander/3fc3a90944d6c7fe99106d6e515412c7/tensorflow/bazel-sandbox/7d27406c-6595-46a2-a8dc-b7faf7c28c88-0.params -- /bin/bash -c 'source external/bazel_tools/tools/genrule/genrule-setup.sh; bazel-out/host/bin/tensorflow/cc/ops/random_ops_gen_cc bazel-out/local_linux-opt/genfiles/tensorflow/cc/ops/random_ops.h bazel-out/local_linux-opt/genfiles/tensorflow/cc/ops/random_ops.cc 0').\r\nbazel-out/host/bin/tensorflow/cc/ops/random_ops_gen_cc: error while loading shared libraries: libcudart.so.7.5: cannot open shared object file: No such file or directory\r\nTarget //tensorflow/cc:tutorials_example_trainer failed to build\r\nINFO: Elapsed time: 630.365s, Critical Path: 137.07s\r\n```\r\n\r\nps.: Out of curiosity, what are you TensorFlow devs using for a development machine? Has any of you actually tried using a modern Linux distribution that comes with GCC newer than 4.9 for compilation? You really should. It's quite the experience."},"comment":{"url":"https://api.github.com/repos/tensorflow/tensorflow/issues/comments/213422904","html_url":"https://github.com/tensorflow/tensorflow/issues/2053#issuecomment-213422904","issue_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/2053","id":213422904,"user":{"login":"black-puppydog","id":189241,"avatar_url":"https://avatars.githubusercontent.com/u/189241?v=3","gravatar_id":"","url":"https://api.github.com/users/black-puppydog","html_url":"https://github.com/black-puppydog","followers_url":"https://api.github.com/users/black-puppydog/followers","following_url":"https://api.github.com/users/black-puppydog/following{/other_user}","gists_url":"https://api.github.com/users/black-puppydog/gists{/gist_id}","starred_url":"https://api.github.com/users/black-puppydog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/black-puppydog/subscriptions","organizations_url":"https://api.github.com/users/black-puppydog/orgs","repos_url":"https://api.github.com/users/black-puppydog/repos","events_url":"https://api.github.com/users/black-puppydog/events{/privacy}","received_events_url":"https://api.github.com/users/black-puppydog/received_events","type":"User","site_admin":false},"created_at":"2016-04-22T13:09:53Z","updated_at":"2016-04-22T13:09:53Z","body":"I have been having this issue, too. For now I resorted to using the nightly builds, which work just fine, and hope that I won't have to touch the C++ portions of tensorflow or contribute a patch that requires rebuilding...\r\nThere was another issue that seemed related (#1701), also on Fedora23.\r\nI am on Fedora21 here, with gcc 4.9.2"}}