Skip to content

CMake: FindTensorflow.cmake not working on MacOS #39

@MiguelAlgaba

Description

@MiguelAlgaba

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

CMake Warning at /Users/miguel/Development/tensorflow-cmake/cmake/modules/FindTensorFlow.cmake:44 (message):
  This FindTensorflow.cmake is not tested on APPLE

  Please report if this works

  https://github.com/PatWie/tensorflow-cmake
Call Stack (most recent call first):
  CMakeLists.txt:6 (find_package)


-- Detecting TensorFlow using python3 (use -DPYTHON_EXECUTABLE=... otherwise)
-- Detecting TensorFlow info - done
CMake Error at /Users/miguel/Development/tensorflow-cmake/cmake/modules/FindTensorFlow.cmake:166 (message):
  Your installed TensorFlow version 1.13 is not supported

  We tested against 1.9;1.9.0;1.10;1.10.0;1.11;1.11.0;1.12;1.12.0
Call Stack (most recent call first):
  CMakeLists.txt:6 (find_package)


-- Configuring incomplete, errors occurred!
See also "/Users/miguel/Development/tensorflow-cmake/inference/cc/CMakeFiles/CMakeOutput.log".

Am I missing something?

Thanks a lot in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    MacOSThis issue is related to MacOScontribution welcomesomething I haven't figured out yet what the best solution is.currently not supportedThis is outside the scope of this project.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions