在windows平台cmake编译tensorflow ( cmake + win10 + visualstudio2017 )
step1-step4参照一下网址:
https://blog.csdn.net/dageda1991/article/details/79721333
后面主要记录一下编译过程中遇到的问题如何解决的
step1:打开翻墙
step2:下载依赖的软件
visual studio 2017, swig, python3.5以上,cmake,git
step3:下载源码
https://github.com/tensorflow/tensorflow.git
configure之前需修改如下两个地方
1>下载好tensorflow源码后,找到tensorflow/contrib/cmake/CMakeLists.txt,搜索“tensorflow_OPTIMIZE_FOR_NATIVE_ARCH”,找到后做出如下修改
-
if (tensorflow_OPTIMIZE_FOR_NATIVE_ARCH)
-
include(CheckCXXCompilerFlag)
-
CHECK_CXX_COMPILER_FLAG("-march=native" COMPILER_OPT_ARCH_NATIVE_SUPPORTED)
-
if (COMPILER_OPT_ARCH_NATIVE_SUPPORTED)