{"action":"created","issue":{"url":"https://api.github.com/repos/tensorflow/tensorflow/issues/4882","repository_url":"https://api.github.com/repos/tensorflow/tensorflow","labels_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/4882/labels{/name}","comments_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/4882/comments","events_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/4882/events","html_url":"https://github.com/tensorflow/tensorflow/issues/4882","id":182112398,"number":4882,"title":"S_IREAD and S_IWRITE errors from gif_archive in CentOS 6.8 Build","user":{"login":"frenchwr","id":12451283,"avatar_url":"https://avatars.githubusercontent.com/u/12451283?v=3","gravatar_id":"","url":"https://api.github.com/users/frenchwr","html_url":"https://github.com/frenchwr","followers_url":"https://api.github.com/users/frenchwr/followers","following_url":"https://api.github.com/users/frenchwr/following{/other_user}","gists_url":"https://api.github.com/users/frenchwr/gists{/gist_id}","starred_url":"https://api.github.com/users/frenchwr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frenchwr/subscriptions","organizations_url":"https://api.github.com/users/frenchwr/orgs","repos_url":"https://api.github.com/users/frenchwr/repos","events_url":"https://api.github.com/users/frenchwr/events{/privacy}","received_events_url":"https://api.github.com/users/frenchwr/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/tensorflow/tensorflow/labels/awaiting%20response","name":"awaiting response","color":"5319e7"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2016-10-10T20:51:50Z","updated_at":"2016-10-10T23:36:32Z","closed_at":null,"body":"Hi there,\r\n\r\nI've been attempting off and on for the last 1-2 weeks to get Tensorflow to build on CentOS 6.8. I've spent a lot of time reading through old issues and piecing/hacking together suggestions from developers and other users on how to configure the build. I'm using a hand-built version of GCC (v. 4.9.3) in a non-default location with the system version of binutils (more info below). \r\n\r\nI've managed to get the tutorial_trainers_example to build and run successfully, but I'm now running into trouble when attempting to build the pip wheel (see below). It looks like there may be some missing header files.\r\n\r\n### Relevant Threads\r\n\r\nThe most helpful threads I've found during this process have been the following:\r\n\r\nhttps://github.com/tensorflow/tensorflow/issues/110 (especially comments from @rdipietro)\r\nhttps://github.com/bazelbuild/bazel/issues/760 (thanks @damienmg)\r\n\r\nThe only mention I can find of the specific error (granted, for a completely different platform) is in this recent Stackoverflow thread:\r\n\r\nhttp://stackoverflow.com/questions/39855672/tensorflow-how-to-compile-libtensorflow-cc-so-for-android\r\n\r\nThe fact that this is a recent thread makes me think that perhaps there was some sort of error that was introduced into the build config in the last few weeks/months.\r\n\r\n### Environment info\r\nOperating System:\r\n\r\n```\r\n$ lsb_release -a\r\nLSB Version:\t:base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch\r\nDistributor ID:\tCentOS\r\nDescription:\tCentOS release 6.8 (Final)\r\nRelease:\t6.8\r\nCodename:\tFinal\r\n$ uname -a\r\nLinux vmp1250 2.6.32-642.1.1.el6.x86_64 #1 SMP Tue May 31 21:57:07 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux\r\n```\r\n\r\nInstalled version of CUDA and cuDNN: \r\n(please attach the output of `ls -l /path/to/cuda/lib/libcud*`):\r\n\r\n```\r\n$ ls -lh /gpfs22/local/centos6/cuda-7.5/lib/libcud*\r\n-rw-r--r--. 1 root root 185K Sep 17  2015 /gpfs22/local/centos6/cuda-7.5/lib/libcudadevrt.a\r\nlrwxrwxrwx. 1 root root   16 Sep 17  2015 /gpfs22/local/centos6/cuda-7.5/lib/libcudart.so -> libcudart.so.7.5\r\nlrwxrwxrwx. 1 root root   19 Sep 17  2015 /gpfs22/local/centos6/cuda-7.5/lib/libcudart.so.7.5 -> libcudart.so.7.5.18\r\n-rwxr-xr-x. 1 root root 305K Sep 17  2015 /gpfs22/local/centos6/cuda-7.5/lib/libcudart.so.7.5.18\r\n-rw-r--r--. 1 root root 545K Sep 17  2015 /gpfs22/local/centos6/cuda-7.5/lib/libcudart_static.a\r\n```\r\n```\r\n$ ls -lh /gpfs22/local/centos6/cudnn-7.5-v5/lib64/\r\ntotal 227M\r\nlrwxrwxrwx. 1 1000 1000  13 May 25 10:38 libcudnn.so -> libcudnn.so.5\r\nlrwxrwxrwx. 1 1000 1000  17 May 25 10:38 libcudnn.so.5 -> libcudnn.so.5.0.5\r\n-rwxrwxr-x. 1 1000 1000 58M Apr 22 19:15 libcudnn.so.5.0.5\r\n-rw-rw-r--. 1 1000 1000 57M Apr 22 19:15 libcudnn_static.a\r\n```\r\n\r\nIf installed from source, provide \r\n\r\nThe commit hash (`git rev-parse HEAD`):\r\n\r\n* Most recent (df871edcff2faf643975b9863100ed41b6da9c3f)\r\n\r\nThe output of `bazel version`:\r\n```\r\n$ bazel version\r\nBuild label: 0.3.2- (@non-git)\r\nBuild target: bazel-out/local-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar\r\nBuild time: Fri Oct 7 20:15:17 2016 (1475871317)\r\nBuild timestamp: 1475871317\r\nBuild timestamp as int: 1475871317\r\n```\r\n\r\n### Custom Build Config for Bazel & Tensorflow\r\n\r\nFor the bazel build:\r\n* Modified ```tools/cpp/CROSSTOOL``` to point to C and C++ compilers in non-default locations \r\n* Added an extra ```linker_flag``` line in ```tools/cpp/CROSSTOOL```\r\n* Added a bunch of ```cxx_builtin_include_directory``` lines to point to all the appropriate header files within GCC 4.9.3 in ```tools/cpp/CROSSTOOL``` \r\n\r\nFor the Tensorflow build:\r\n* Modified ```third_party/gpus/crosstool/CROSSTOOL.tpl``` to point to C++ compiler in custom location \r\n* Added an extra ```linker_flag``` line to ```third_party/gpus/crosstool/CROSSTOOL.tpl``` \r\n* Updated ```third_party/gpus/crosstool/clang/bin/crosstool_wrapper_driver_is_not_gcc.tpl``` to point to the versions of NVCC and GCC that are in non-default locations \r\n* Commented out the line ```cmd = 'PATH=' + PREFIX_DIR + ' ' + cmd``` in ```third_party/gpus/crosstool/clang/bin/crosstool_wrapper_driver_is_not_gcc.tpl``` (otherwise ```as``` cannot be found). \r\n\r\nI can provide the exact lines I used if you'd like. Just let me know. \r\n\r\n### Description of Problem\r\n\r\nEnvironment setup (I realize some of this may be overkill):\r\n\r\n```\r\n$ export PATH=/gpfs22/local/centos6/swig/3.0.5/x86_64/gcc49/nonet/bin:/gpfs22/local/centos6/cuda-7.5/bin:/gpfs22/local/centos6/python2/anaconda2/bin:/gpfs21/scratch/frenchwr/tensorflow/bazel-0.3.2/output:/gpfs22/local/centos6/gcc/4.9.3/x86_64/bin:/gpfs22/local/centos6/java/1.8.0/bin:/usr/local/git/latest/x86_64/gcc46/nonet/bin:/usr/local/git/latest/x86_64/gcc46/nonet/libexec/git-core:/usr/scheduler/slurm/sbin:/usr/scheduler/slurm/bin:/usr/lpp/mmfs/bin:/usr/local/bin:/usr/local/common/bin:/usr/bin:/bin:/usr/scheduler/slurm/sbin:/usr/scheduler/slurm/bin:/usr/lpp/mmfs/bin:/usr/local/bin:/usr/local/common/bin:/usr/bin:/bin:/usr/local/git/latest/x86_64/gcc46/nonet/bin:/usr/local/git/latest/x86_64/gcc46/nonet/libexec/git-core:/usr/scheduler/slurm/sbin:/usr/scheduler/slurm/bin:/usr/lpp/mmfs/bin:/usr/local/bin:/usr/local/common/bin:/usr/bin:/bin:/usr/scheduler/slurm/sbin:/usr/scheduler/slurm/bin:/usr/lpp/mmfs/bin:/usr/local/bin:/usr/local/common/bin:/usr/bin:/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/var/cfengine/bin:/var/cfengine/bin\r\n$ export LD_LIBRARY_PATH=/gpfs22/local/centos6/cudnn-7.5-v5/lib64:/gpfs22/local/centos6/swig/3.0.5/x86_64/gcc49/nonet/share/swig/3.0.5:/gpfs22/local/centos6/cuda-7.5/lib:/gpfs22/local/centos6/cuda-7.5/lib64:/gpfs22/local/centos6/java/1.8.0/lib:/gpfs22/local/centos6/gcc/4.9.3/x86_64/lib:/gpfs22/local/centos6/gcc/4.9.3/x86_64/lib64:/gpfs22/local/centos6/java/1.8.0/lib/:/gpfs22/local/centos6/python2/anaconda2/lib\r\n$ export JAVA_HOME=/gpfs22/local/centos6/java/1.8.0\r\n$ export JAVA_ROOT=/gpfs22/local/centos6/java/1.8.0\r\n$ export CXX=/gpfs22/local/centos6/gcc/4.9.3/x86_64/bin/g++\r\n$ export CC=/gpfs22/local/centos6/gcc/4.9.3/x86_64/bin/gcc\r\n$ export GCC_ROOT=/gpfs22/local/centos6/gcc/4.9.3/x86_64\r\n$ export LDFLAGS=\"-L/gpfs22/local/centos6/gcc/4.9.3/x86_64/lib -L/gpfs22/local/centos6/gcc/4.9.3/x86_64/lib64 -L/gpfs22/local/centos6/cuda-7.5/lib64 -L/gpfs22/local/centos6/cuda-7.5/lib -L/gpfs22/local/centos6/cudnn-7.5-v5/lib64 -L/gpfs22/local/centos6/python2/anaconda2/lib\"\r\n$ export CXXFLAGS=\"-L/gpfs22/local/centos6/gcc/4.9.3/x86_64/lib -L/gpfs22/local/centos6/gcc/4.9.3/x86_64/lib64 -L/gpfs22/local/centos6/cuda-7.5/lib64 -L/gpfs22/local/centos6/cuda-7.5/lib -L/gpfs22/local/centos6/cudnn-7.5-v5/lib64 -L/gpfs22/local/centos6/python2/anaconda2/lib\"\r\n$ export CPLUS_INCLUDE_PATH=\"/gpfs22/local/centos6/gcc/4.9.3/x86_64/lib/gcc/:/gpfs22/local/centos6/gcc/4.9.3/x86_64/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/:/gpfs22/local/centos6/gcc/4.9.3/x86_64/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/:/gpfs22/local/centos6/gcc/4.9.3/x86_64/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include-fixed/:/gpfs22/local/centos6/gcc/4.9.3/x86_64/include/c++/4.9.3/:/gpfs22/local/centos6/gcc/4.9.3/x86_64/include/c++/4.9.3/x86_64-unknown-linux-gnu/:/gpfs22/local/centos6/gcc/4.9.3/x86_64/lib64/:/gpfs22/local/centos6/gcc/4.9.3/x86_64/lib/:/gpfs22/local/centos6/cuda-7.5/include/:/gpfs22/local/centos6/cudnn-7.5-v5/include/\"\r\n$ export PYTHONPATH=/gpfs22/local/centos6/python2/anaconda2/lib/python2.7:$PYTHONPATH\r\n$ export PYTHON_ROOT=/gpfs22/local/centos6/python2/anaconda2\r\n$ export PYTHON27_INC=$PYTHON_ROOT/include/python2.7\r\n$ export CUDA_HOME=/gpfs22/local/centos6/cuda-7.5\r\n$ export SWIG_ROOT=/gpfs22/local/centos6/swig/3.0.5/x86_64/gcc49/nonet\r\n$ export NVVM_ROOT=/gpfs22/local/centos6/cuda-7.5/nvvm\r\n$ export LIBRARY_PATH=/gpfs22/local/centos6/cudnn-7.5-v5/lib64:$LIBRARY_PATH\r\n$ export CPATH=/gpfs22/local/centos6/cudnn-7.5-v5/include:$CPATH\r\n$ export CUDNN_ROOT=/gpfs22/local/centos6/cudnn-7.5-v5\r\n$ export SWIG_PATH=$(which swig)\r\n```\r\n\r\nTensorflow Configuration:\r\n\r\n```\r\n$ $ ./configure\r\n/scratch/frenchwr/tensorflow/tensorflow-head /scratch/frenchwr/tensorflow/tensorflow-head\r\nPlease specify the location of python. [Default is /gpfs22/local/centos6/python2/anaconda2/bin/python]: \r\nDo you wish to build TensorFlow with Google Cloud Platform support? [y/N] N\r\nNo Google Cloud Platform support will be enabled for TensorFlow\r\nDo you wish to build TensorFlow with Hadoop File System support? [y/N] N\r\nNo Hadoop File System support will be enabled for TensorFlow\r\nFound possible Python library paths:\r\n  /gpfs22/local/centos6/python2/anaconda2/lib/python2.7/site-packages\r\n  /gpfs22/local/centos6/python2/anaconda2/lib/python2.7\r\nPlease input the desired Python library path to use.  Default is [/gpfs22/local/centos6/python2/anaconda2/lib/python2.7/site-packages]\r\n\r\n/gpfs22/local/centos6/python2/anaconda2/lib/python2.7/site-packages\r\nDo you wish to build TensorFlow with GPU support? [y/N] y\r\nGPU support will be enabled for TensorFlow\r\nPlease specify which gcc should be used by nvcc as the host compiler. [Default is /gpfs22/local/centos6/gcc/4.9.3/x86_64/bin/gcc]: \r\nPlease specify the Cuda SDK version you want to use, e.g. 7.0. [Leave empty to use system default]: 7.5\r\nPlease specify the location where CUDA 7.5 toolkit is installed. Refer to README.md for more details. [Default is /usr/local/cuda]: /gpfs22/local/centos6/cuda-7.5\r\nPlease specify the Cudnn version you want to use. [Leave empty to use system default]: 5.0.5\r\nPlease specify the location where cuDNN 5.0.5 library is installed. Refer to README.md for more details. [Default is /gpfs22/local/centos6/cuda-7.5]: /gpfs22/local/centos6/cudnn-7.5-v5\r\nPlease specify a list of comma-separated Cuda compute capabilities you want to build with.\r\nYou can find the compute capability of your device at: https://developer.nvidia.com/cuda-gpus.\r\nPlease note that each additional compute capability significantly increases your build time and binary size.\r\n[Default is: \"3.5,5.2\"]: 5.2\r\nINFO: Starting clean (this may take a while). Consider using --expunge_async if the clean takes more than several minutes.\r\n.................\r\nINFO: All external dependencies fetched successfully.\r\nConfiguration finished\r\n```\r\n\r\nTutorials Example Trainer Build:\r\n\r\n```\r\nbazel build -c opt --config=cuda --verbose_failures --subcommands //tensorflow/cc:tutorials_example_trainer\r\n```\r\n\r\nTutorials Example Trainer Run:\r\n\r\n```\r\nI tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcurand.so.7.5 locally\r\nI tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcuda.so.1 locally\r\nI tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcufft.so.7.5 locally\r\nI tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcudnn.so.5.0.5 locally\r\nI tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcublas.so.7.5 locally\r\nI tensorflow/core/common_runtime/gpu/gpu_device.cc:951] Found device 0 with properties: \r\nname: GeForce GTX TITAN X\r\nmajor: 5 minor: 2 memoryClockRate (GHz) 1.076\r\npciBusID 0000:02:00.0\r\nTotal memory: 12.00GiB\r\nFree memory: 11.87GiB\r\nI tensorflow/core/common_runtime/gpu/gpu_device.cc:972] DMA: 0 \r\nI tensorflow/core/common_runtime/gpu/gpu_device.cc:982] 0:   Y \r\nI tensorflow/core/common_runtime/gpu/gpu_device.cc:1041] Creating TensorFlow device (/gpu:0) -> (device: 0, name: GeForce GTX TITAN X, pci bus id: 0000:02:00.0)\r\n000000/000001 lambda = 1.841570 x = [0.669396 0.742906] y = [3.493999 -0.669396]\r\n000000/000009 lambda = 1.841570 x = [0.669396 0.742906] y = [3.493999 -0.669396]\r\n...\r\n...\r\n```\r\n\r\nPip Wheel Build (extra command line options suggested by @rdipietro in https://github.com/tensorflow/tensorflow/issues/110):\r\n\r\n```\r\n$ bazel build -c opt --config=cuda --linkopt '-lrt' --copt=\"-DGPR_BACKWARDS_COMPATIBILITY_MODE\" --conlyopt=\"-std=c99\" //tensorflow/tools/pip_package:build_pip_package\r\n...\r\n...\r\nINFO: From Compiling external/protobuf/src/google/protobuf/compiler/cpp/cpp_message.cc:\r\nexternal/protobuf/src/google/protobuf/compiler/cpp/cpp_message.cc:376:8: warning: 'std::string google::protobuf::compiler::cpp::{anonymous}::MessageTypeProtoName(const google::protobuf::FieldDescriptor*)' defined but not used [-Wunused-function]\r\n string MessageTypeProtoName(const FieldDescriptor* field) {\r\n        ^\r\nERROR: /gpfs22/home/frenchwr/.cache/bazel/_bazel_frenchwr/4ceedd0aac0f37a9bc9063198121367a/external/gif_archive/BUILD:6:1: C++ compilation of rule '@gif_archive//:gif' failed: crosstool_wrapper_driver_is_not_gcc failed: error executing command external/local_config_cuda/crosstool/clang/bin/crosstool_wrapper_driver_is_not_gcc -U_FORTIFY_SOURCE '-D_FORTIFY_SOURCE=1' -fstack-protector -fPIE -Wall -Wunused-but-set-parameter ... (remaining 37 argument(s) skipped): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.\r\nexternal/gif_archive/egif_lib.c: In function 'EGifOpenFileName':\r\nexternal/gif_archive/egif_lib.c:62:6: error: 'S_IREAD' undeclared (first use in this function)\r\n      S_IREAD | S_IWRITE);\r\n      ^\r\nexternal/gif_archive/egif_lib.c:62:6: note: each undeclared identifier is reported only once for each function it appears in\r\nexternal/gif_archive/egif_lib.c:62:16: error: 'S_IWRITE' undeclared (first use in this function)\r\n      S_IREAD | S_IWRITE);\r\n                ^\r\nexternal/gif_archive/egif_lib.c: In function 'EGifOpenFileHandle':\r\nexternal/gif_archive/egif_lib.c:119:5: warning: implicit declaration of function 'fdopen' [-Wimplicit-function-declaration]\r\n     f = fdopen(FileHandle, \"wb\");    /* Make it into a stream: */\r\n     ^\r\nexternal/gif_archive/egif_lib.c:119:7: warning: assignment makes pointer from integer without a cast\r\n     f = fdopen(FileHandle, \"wb\");    /* Make it into a stream: */\r\n       ^\r\nTarget //tensorflow/tools/pip_package:build_pip_package failed to build\r\nUse --verbose_failures to see the command lines of failed build steps.\r\nINFO: Elapsed time: 403.336s, Critical Path: 394.04s\r\n```"},"comment":{"url":"https://api.github.com/repos/tensorflow/tensorflow/issues/comments/252773864","html_url":"https://github.com/tensorflow/tensorflow/issues/4882#issuecomment-252773864","issue_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/4882","id":252773864,"user":{"login":"aselle","id":326106,"avatar_url":"https://avatars.githubusercontent.com/u/326106?v=3","gravatar_id":"","url":"https://api.github.com/users/aselle","html_url":"https://github.com/aselle","followers_url":"https://api.github.com/users/aselle/followers","following_url":"https://api.github.com/users/aselle/following{/other_user}","gists_url":"https://api.github.com/users/aselle/gists{/gist_id}","starred_url":"https://api.github.com/users/aselle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aselle/subscriptions","organizations_url":"https://api.github.com/users/aselle/orgs","repos_url":"https://api.github.com/users/aselle/repos","events_url":"https://api.github.com/users/aselle/events{/privacy}","received_events_url":"https://api.github.com/users/aselle/received_events","type":"User","site_admin":false},"created_at":"2016-10-10T23:36:32Z","updated_at":"2016-10-10T23:36:32Z","body":"Make sure you  are matching build options that bazel uses (use the debug option that prints the exact gcc command). For example, you aren't setting the c compiler to use c99."}}
{"actor":{"display_login":"aselle"}}