Example of building and linking tensorflow as a static library to a Windows c++ program using cmake
- Windows 10
- Visual Studio 2017
- Python 3.6
- git
From a windows command line execute the following commands:
git clone https://github.com/craig-martinson/tensorflow-cmake.git
cd tensorflow-cmake
build_solution.cmd
This build_solution.cmd
batch file will perform the following tasks:
- Download cmake if required
- Clone the tensorflow repository
- Open an x64 Native Tools Command Prompt for VS2017
- Build tensorflow static libraries optimized for Intel AVX2
- Build and link the example c++ solution
The following resources were used in developing this project:
Resource | Link |
---|---|
TensorFlow source code | TensorFlow Github Repository |
Instructions to compile tensorflow as a static library | Building a static Tensorflow C++ library on Windows |
Instructions on linking tensorflow static library to a Windows program | Building a standalone C++ Tensorflow program on Windows |
Instructions on building tensorflow optimized for Intel® Advanced Vector Extensions 2 (AVX2) | Explore Unity Technologies ML-Agents* Exclusively on Intel® Architecture |