Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Target //tensorflow/tools/pip_package:build_pip_package failed to build on OSX #72

Closed
delip opened this issue Nov 10, 2015 · 5 comments
Closed
Assignees

Comments

@delip
Copy link

delip commented Nov 10, 2015

ERROR: /Users/delip/Softwares/tensorflow/tensorflow/tensorflow.bzl:224:3: C++ compilation of rule '//tensorflow/python:tf_session_helper' failed: osx_gcc_wrapper.sh failed: error executing command tools/cpp/osx_gcc_wrapper.sh '-D_FORTIFY_SOURCE=1' -fstack-protector -fPIE -fcolor-diagnostics -Wall -Wthread-safety -Wself-assign -fno-omit-frame-pointer -g0 -O2 -DNDEBUG -ffunction-sections ... (remaining 52 argument(s) skipped): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.
Target //tensorflow/tools/pip_package:build_pip_package failed to build
Use --verbose_failures to see the command lines of failed build steps.

I recently checked out the repo

$ git log | head -5
commit 41930f0b81b52a34fb56d921c9bad65c36168323
Author: Vijay Vasudevan <vrv@google.com>
Date:   Mon Nov 9 18:42:53 2015 -0800

    TensorFlow: Upstream a batch of changes to git.
@mrry
Copy link
Contributor

mrry commented Nov 10, 2015

Can you try again with --verbose_failures and paste in any more information that displays about the failure? Thanks!

@jfsantos
Copy link
Contributor

I am having the same issue today, however I was able to build it yesterday without any problem. I think the problem is that the copts are pointing to /usr/include/python2.7, which does not exist on OS X (correct path for Homebrew Python is to be found by using the command python-config --includes).

Here is the log when using --verbose_failures:

± % bazel build --verbose_failures -c opt //tensorflow/tools/pip_package:build_pip_package
INFO: Found 1 target...
INFO: From Compiling tensorflow/python/client/tf_session_helper.cc:
In file included from tensorflow/python/client/tf_session_helper.cc:1:
./tensorflow/python/client/tf_session_helper.h:4:10: fatal error: 'Python.h' file not found
#include <Python.h>
         ^
1 error generated.
ERROR: /Users/jfsantos/Projects/tensorflow/tensorflow/python/BUILD:666:1: C++ compilation of rule '//tensorflow/python:tf_session_helper' failed: osx_gcc_wrapper.sh failed: error executing command
  (cd /private/var/tmp/_bazel_jfsantos/843612a30412b67e357ec0b01f219282/tensorflow && \
  exec env - \
    INTERCEPT_LOCALLY_EXECUTABLE=1 \
    PATH=/Users/jfsantos/torch/install/bin:/Library/TeX/texbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/texbin:/Users/jfsantos/.gem/ruby/2.0.0/bin:/usr/local/sbin:/Applications/Julia-0.4.0.app/Contents/Resources/julia/bin \
    TMPDIR=/var/folders/z3/s0__77pd3n1bpym4f75hrzbc0000gn/T/ \
  tools/cpp/osx_gcc_wrapper.sh '-D_FORTIFY_SOURCE=1' -fstack-protector -fPIE -fcolor-diagnostics -Wall -Wthread-safety -Wself-assign -fno-omit-frame-pointer -g0 -O2 -DNDEBUG -ffunction-sections -fdata-sections '-std=c++0x' -iquote . -iquote bazel-out/local_darwin-opt/genfiles -isystem google/protobuf/src -isystem bazel-out/local_darwin-opt/genfiles/google/protobuf/src -isystem tools/cpp/gcc3 -isystem external/jpeg_archive/jpeg-9a -isystem bazel-out/local_darwin-opt/genfiles/external/jpeg_archive/jpeg-9a -isystem external/png_archive/libpng-1.2.53 -isystem bazel-out/local_darwin-opt/genfiles/external/png_archive/libpng-1.2.53 -isystem external/re2 -isystem bazel-out/local_darwin-opt/genfiles/external/re2 -isystem third_party/gpus/cuda -isystem bazel-out/local_darwin-opt/genfiles/third_party/gpus/cuda -isystem third_party/gpus/cuda/include -isystem bazel-out/local_darwin-opt/genfiles/third_party/gpus/cuda/include -isystem third_party/eigen3 -isystem bazel-out/local_darwin-opt/genfiles/third_party/eigen3 -I/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include -I/usr/include/python2.7 -no-canonical-prefixes -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' '-frandom-seed=bazel-out/local_darwin-opt/bin/tensorflow/python/_objs/tf_session_helper/tensorflow/python/client/tf_session_helper.pic.o' -MD -MF bazel-out/local_darwin-opt/bin/tensorflow/python/_objs/tf_session_helper/tensorflow/python/client/tf_session_helper.pic.d -fPIC -c tensorflow/python/client/tf_session_helper.cc -o bazel-out/local_darwin-opt/bin/tensorflow/python/_objs/tf_session_helper/tensorflow/python/client/tf_session_helper.pic.o): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1: osx_gcc_wrapper.sh failed: error executing command
  (cd /private/var/tmp/_bazel_jfsantos/843612a30412b67e357ec0b01f219282/tensorflow && \
  exec env - \
    INTERCEPT_LOCALLY_EXECUTABLE=1 \
    PATH=/Users/jfsantos/torch/install/bin:/Library/TeX/texbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/texbin:/Users/jfsantos/.gem/ruby/2.0.0/bin:/usr/local/sbin:/Applications/Julia-0.4.0.app/Contents/Resources/julia/bin \
    TMPDIR=/var/folders/z3/s0__77pd3n1bpym4f75hrzbc0000gn/T/ \
  tools/cpp/osx_gcc_wrapper.sh '-D_FORTIFY_SOURCE=1' -fstack-protector -fPIE -fcolor-diagnostics -Wall -Wthread-safety -Wself-assign -fno-omit-frame-pointer -g0 -O2 -DNDEBUG -ffunction-sections -fdata-sections '-std=c++0x' -iquote . -iquote bazel-out/local_darwin-opt/genfiles -isystem google/protobuf/src -isystem bazel-out/local_darwin-opt/genfiles/google/protobuf/src -isystem tools/cpp/gcc3 -isystem external/jpeg_archive/jpeg-9a -isystem bazel-out/local_darwin-opt/genfiles/external/jpeg_archive/jpeg-9a -isystem external/png_archive/libpng-1.2.53 -isystem bazel-out/local_darwin-opt/genfiles/external/png_archive/libpng-1.2.53 -isystem external/re2 -isystem bazel-out/local_darwin-opt/genfiles/external/re2 -isystem third_party/gpus/cuda -isystem bazel-out/local_darwin-opt/genfiles/third_party/gpus/cuda -isystem third_party/gpus/cuda/include -isystem bazel-out/local_darwin-opt/genfiles/third_party/gpus/cuda/include -isystem third_party/eigen3 -isystem bazel-out/local_darwin-opt/genfiles/third_party/eigen3 -I/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include -I/usr/include/python2.7 -no-canonical-prefixes -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' '-frandom-seed=bazel-out/local_darwin-opt/bin/tensorflow/python/_objs/tf_session_helper/tensorflow/python/client/tf_session_helper.pic.o' -MD -MF bazel-out/local_darwin-opt/bin/tensorflow/python/_objs/tf_session_helper/tensorflow/python/client/tf_session_helper.pic.d -fPIC -c tensorflow/python/client/tf_session_helper.cc -o bazel-out/local_darwin-opt/bin/tensorflow/python/_objs/tf_session_helper/tensorflow/python/client/tf_session_helper.pic.o): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.
Target //tensorflow/tools/pip_package:build_pip_package failed to build
INFO: Elapsed time: 3.653s, Critical Path: 2.71s

I tried updating the Bazel target for tf_session_helper in tensorflow/python/build to use the Homebrew include path instead of /usr/include/python2.7, but then I get the following:

± % bazel build --verbose_failures -c opt //tensorflow/tools/pip_package:build_pip_package
ERROR: /Users/jfsantos/Projects/tensorflow/tensorflow/python/BUILD:666:1: in cc_library rule //tensorflow/python:tf_session_helper: The include path '/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Headers' references a path outside of the execution root..
ERROR: /Users/jfsantos/Projects/tensorflow/tensorflow/python/BUILD:666:1: in cc_library rule //tensorflow/python:tf_session_helper: The include path '/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Headers' references a path outside of the execution root..
ERROR: Analysis of target '//tensorflow/tools/pip_package:build_pip_package' failed; build aborted.
INFO: Elapsed time: 0.409s

@jfsantos
Copy link
Contributor

I managed to run by changing the numpy_macosx_include_dir to the following:

numpy_macosx_include_dir = ["-I/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include", "-I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7"]

Using the Homebrew path did not work as stated in the comment above.

@delip
Copy link
Author

delip commented Nov 17, 2015

@jfsantos that did the trick. For some reason, even using anaconda's Python headers gave me the same error, but using the OSX python path (like the one you provided) worked. Thanks!

@vrv
Copy link

vrv commented Nov 24, 2015

De-duping with #187

@vrv vrv closed this as completed Nov 24, 2015
ilblackdragon added a commit to ilblackdragon/tensorflow that referenced this issue Mar 9, 2016
lissyx added a commit to lissyx/tensorflow that referenced this issue Oct 16, 2018
tensorflow-copybara pushed a commit that referenced this issue Aug 23, 2019
xinan-jiang pushed a commit to xinan-jiang/tensorflow that referenced this issue Oct 4, 2019
cjolivier01 pushed a commit to Cerebras/tensorflow that referenced this issue Dec 6, 2019
…lgorithmconfig-profileresult

Change CUDA StreamExecutor to use new member function in AlgorithmDesc
copybara-service bot pushed a commit that referenced this issue May 17, 2022
PiperOrigin-RevId: 449113076
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants