-
Notifications
You must be signed in to change notification settings - Fork 91
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
CMake: FindTensorflow.cmake not working on MacOS #39
Comments
Is there really TensorFlow version "1.13"? I thought there is only "1.13.1". You might want to change the line
and add your version. As soon as I have the CI for building the ops under 1.13.1 I will add it here to the repository. However, there are so many things which have been changed. I do not have any way to test this under any Apple-Device. Would be nice to make it work under MacOS. |
Hi @PatWie thanks for your quick reply. Adding 1.13 to the list of supported Tensorflow versions as you suggested and manually specifying the paths to the Tensorflow source and libraries I managed to get CMake to generate the makefile for the inference/cc example However when I trying to build the example it says it cannot find <tensorflow/core/protobuf/meta_graph.pb.h>. Any ideas?
Thanks in advance! |
Copying all the content of tensorflow/bazel-genfiles/tensorflow to tensorflow-build/includes manages to find tensorflow/core/protobuf/meta_graph.pb.h although it fails to build too
|
This is strange as bazel downloads all dependencies including Google protobuf. Installing the protobuf by hand is a bad idea as version missmatchs can add additional issues. Can you confirm there is no such file "port_def.inc". Which tensor flow version do you issue. It can be that they broke TF again: |
Hi @PatWie yes I was using a more recent Tensorflow version from commit f90532431c3785166cff35ff427b652fe460f60b, so seems like the "port_def.inc" issue is related to the tensorflow/tensorflow#27697 issue you posted indeed. I decided to use stable release v1.13.1 and compiling that version from source almost works as you can see here. Now the remaining error seems to be a linking issue |
Locally removing the unknown options |
These flags are important indeed (for g++). MacOS uses llvm. Not sure if an equivalent exists:(https://stackoverflow.com/a/17445806/7443104) |
I was trying to compile some of the examples requiring the Tensorflow C-API, however so far I'm unable to get FindTensorflow.cmake to find the version of Tensorflow I installed from source
I'm using macOS High Sierra v10.13.6
I installed Tensorflow using the following commands:
TENSORFLOW_SOURCE_DIR=tensorflow
cd ${TENSORFLOW_SOURCE_DIR}
(latest master)./configure
(defaults settings on OSX)bazel build --config=opt //tensorflow/tools/pip_package:build_pip_package
(cpu-only build)./bazel-bin/tensorflow/tools/pip_package/build_pip_package --nightly_flag /tmp/tensorflow_pkg
pip install --ignore-installed wrapt /tmp/tensorflow_pkg/tf_nightly-1.13.1-cp36-cp36m-macosx_10_13_x86_64.whl
cd ..
export TENSORFLOW_BUILD_DIR=tensorflow-build
mkdir ${TENSORFLOW_BUILD_DIR}
cp ${TENSORFLOW_SOURCE_DIR}/bazel-bin/tensorflow/*.so ${TENSORFLOW_BUILD_DIR}/
user@host $ cp ${TENSORFLOW_SOURCE_DIR}/bazel-genfiles/tensorflow/cc/ops/*.h ${TENSORFLOW_BUILD_DIR}/includes/tensorflow/cc/ops/
Then I tried example inside
tensorflow-cmake/inference/cc
cmake .
And I get the following output
Am I missing something?
Thanks a lot in advance!
The text was updated successfully, but these errors were encountered: