File tree Expand file tree Collapse file tree 2 files changed +15
-11
lines changed Expand file tree Collapse file tree 2 files changed +15
-11
lines changed Original file line number Diff line number Diff line change @@ -25,10 +25,6 @@ if((NOT BUILD_PY_IF) AND (NOT BUILD_CPP_IF))
2525endif ()
2626
2727if (BUILD_CPP_IF AND BUILD_TESTING)
28- if (NOT INSTALL_TENSORFLOW)
29- # some errors in conda packages...
30- find_package (GTest)
31- endif ()
3228 if (NOT GTEST_LIBRARIES)
3329 configure_file (${CMAKE_CURRENT_SOURCE_DIR} /cmake/googletest.cmake.in
3430 googletest-download/CMakeLists.txt @ONLY)
@@ -127,6 +123,9 @@ endif(USE_ROCM_TOOLKIT)
127123set (DEEPMD_SOURCE_DIR ${PROJECT_SOURCE_DIR} /..)
128124
129125# setup tensorflow libraries by python
126+ if (INSTALL_TENSORFLOW)
127+ set (USE_TF_PYTHON_LIBS TRUE )
128+ endif (INSTALL_TENSORFLOW)
130129if (USE_TF_PYTHON_LIBS)
131130 if (NOT "$ENV{CIBUILDWHEEL} " STREQUAL "1" )
132131 find_package (
Original file line number Diff line number Diff line change @@ -19,25 +19,30 @@ if(SKBUILD)
1919endif (SKBUILD)
2020
2121if (BUILD_CPP_IF AND INSTALL_TENSORFLOW)
22- # Here we try to install libtensorflow_cc using conda install.
22+ # Here we try to install libtensorflow_cc using pip install.
2323
2424 if (USE_CUDA_TOOLKIT)
25- set (VARIANT cuda )
25+ set (VARIANT "" )
2626 else ()
27- set (VARIANT cpu)
27+ set (VARIANT "- cpu" )
2828 endif ()
2929
3030 if (NOT DEFINED TENSORFLOW_ROOT)
3131 set (TENSORFLOW_ROOT ${CMAKE_INSTALL_PREFIX} )
3232 endif ()
33- # execute conda install
34- execute_process (COMMAND conda create libtensorflow_cc=*=${VARIANT} * -c
35- deepmodeling -y -p ${TENSORFLOW_ROOT} )
33+ # execute pip install
34+ execute_process (
35+ COMMAND ${Python_EXECUTABLE} -m pip install tensorflow${VARIANT} --no -deps
36+ --target =${TENSORFLOW_ROOT} )
37+ set (TENSORFLOW_ROOT
38+ ${TENSORFLOW_ROOT} /lib/python${Python_VERSION_MAJOR} .${Python_VERSION_MINOR} /site-packages/tensorflow
39+ )
3640endif ()
3741
3842if (BUILD_CPP_IF
3943 AND USE_TF_PYTHON_LIBS
40- AND NOT SKBUILD)
44+ AND NOT SKBUILD
45+ AND NOT INSTALL_TENSORFLOW)
4146 # Here we try to install libtensorflow_cc.so as well as
4247 # libtensorflow_framework.so using libs within the python site-package
4348 # tensorflow folder.
You can’t perform that action at this time.
0 commit comments