-
Notifications
You must be signed in to change notification settings - Fork 74.7k
C++ compilation of rule '//tensorflow/python:tf_session_helper' failed #109
New issue
Have a ques 8000 tion 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
Comments
I can compile that particular source file after adding this to the gcc command:
But when I rerun the bazel command it tries to compile it again without the needed include path and fails. |
@markusdr: what version of numpy do you have installed, by any chance? I have a suspicion that it's probably earlier than numpy 1.8.2 :) |
I believe it's numpy 1.9.2. |
Gotcha -- that version does have PyArray_SHAPE. Do you have any other numpy directories installed on your machine that might be interfering somehow? If not, can you try changing tf_session_helper.cc to switch from PyArray_SHAPE to PyArray_DIMS ? (That one is available in earlier versions of numpy and apparently PyArray_SHAPE is an alias) |
Right, the installation is using /usr/include/python2.7/, which doesn't have PyArray_SHAPE. But PyArray_SHAPE is defined in /usr/local/lib/python2.7/dist-packages/numpy/core/include. How can I tell bazel to use the latter python installation path? |
When I add the correct numpy include path to the tensorflow/python/BUILD file it seems to compile, but at the end it complains:
|
OK, this workaround gets it to compile:
Then add |
There may be a way to infer the numpy header location at compile time. I'll take a look. |
@markusdr |
@auroua Here is the diff:
Alternatively, I could have symlinked |
Do @markusdr 's changes still apply? I don't think that the diff corresponds to the current version of tensorflow/python/BUILD anymore. Suggestions? |
Symlinking the numpy headers in util/python worked for me. python_config took care of the rest. |
If you sync to HEAD you should be able to use ./configure to select which python to use. |
@vrv Is configure auto detecting the location of numpy headers now (from distconfig possibly?) ?. If not, this issue will still exist. |
I believe so: ./configure will call python_config.sh (https://github.com/tensorflow/tensorflow/blob/master/configure#L25) which gets the numpy headers from https://github.com/tensorflow/tensorflow/blob/master/util/python/python_config.sh#L64 |
Confirmed. python_config auto detects the location of numpy. None of the changes suggested in this thread are needed anymore as long as python has access to the correct numpy location. Thanks, @vrv. |
…me_in_trainer Fixed learning_rate in trainer
… build errors on 32-bit targets. (tensorflow#109) (tensorflow#11244)
… build errors on 32-bit targets. (tensorflow#109)
Closes #109 COPYBARA_INTEGRATE_REVIEW=tensorflow/mlir#109 from nmostafa:nmostafa/AffineIfOp 7dbf2115f0092ffab26381ea8704aa05a0253971 PiperOrigin-RevId: 267633077
Closes tensorflow#109 COPYBARA_INTEGRATE_REVIEW=tensorflow/mlir#109 from nmostafa:nmostafa/AffineIfOp 7dbf2115f0092ffab26381ea8704aa05a0253971 PiperOrigin-RevId: 267633077
…pstream-update-cuda-ci-whitelist adding timeline_test to the CUDA CI whitelist< 5565 /div>
I am trying to compile build_pip_package on Ubuntu 12.04 with gcc 4.8, but it gives an error during compilation:
The text was updated successfully, but these errors were encountered: