cjweeks / tensorflow-cmake

Integrate TensorFlow with CMake projects effortlessly
MIT License
331 stars 83 forks source link

Is it possible to do the similar things in Windows? #14

Open jimmyoic opened 7 years ago

jimmyoic commented 7 years ago

Seems like it is feasible to integrate tensorflow in C++ project by this solution. Is there any way to do the similar things in Windows?

Since Bazel does not throughly support Windows, is it possible to build Tensorflow by cmake instead of bazel and get the same benefit?

Thanks.

cjweeks commented 7 years ago

Hello, and I'm sorry for the very late response. I have recently been updating this repository to work with newer versions. As for building TensorFlow with CMake, the team at tensorflow/tensorflow/contrib/cmake do just this. However, I do not believe they have a rule to build the C++ library yet. If this becomes available in the future, one could easily use this repository to link a project on Windows.

alex-petrenko commented 6 years ago

Sorry for necro-posting, just wanted to add that it's definitely possible to create a shared library with CMake on Windows now. The example command line would be the following:

cmake .. -G"Visual Studio 15 2017 Win64" -Dtensorflow_BUILD_PYTHON_BINDINGS=OFF -Dtensorflow_ENABLE_GRPC_SUPPORT=OFF -Dtensorflow_BUILD_SHARED_LIB=ON
MSBuild /p:PreferredToolArchitecture=x64 /p:Configuration=Release tensorflow.vcxproj
cjweeks commented 6 years ago

@alex-petrenko Thank you for pointing this out. I'll look into establishing a set of instructions for using this repository on Windows.

Enigma-li commented 3 years ago

Hi,

Is there any update to build the C++ library to produce tensorflow.dll and tensorflow.lib for TensorFlow2.0?