-
Notifications
You must be signed in to change notification settings - Fork 526
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
There's no need for building libtensorflow_cc.so anymore (#1744)
* There's no need for building libtensorflow_cc.so anymore * update symbolic link * Update source/cmake/Findtensorflow.cmake Co-authored-by: Jinzhe Zeng <[email protected]> * add support for unit-test * Update install-from-source.md * bump the cmake version at setup.py * set _GLIBCXX_USE_CXX11_ABI flag globally Co-authored-by: Jinzhe Zeng <[email protected]>
- Loading branch information
Showing
10 changed files
with
130 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
set -e | ||
|
||
SCRIPT_PATH=$(dirname $(realpath -s $0)) | ||
if [ ! $# -eq 2 ];then | ||
echo "${SCRIPT_PATH}: Params error, installation of tensorflow libraries failed!" | ||
exit 1 | ||
fi | ||
|
||
PYTHON_SITE_PACKAGE_PATH=$(realpath -s $1) | ||
TENSORFLOW_ROOT=$(realpath -s $2) | ||
TF_INSTALL_PATH=${PYTHON_SITE_PACKAGE_PATH}/tensorflow | ||
|
||
if [ ! -d ${TF_INSTALL_PATH} ];then | ||
echo "${SCRIPT_PATH}: ${TF_INSTALL_PATH}, TensorFlow not found!" | ||
exit 1 | ||
fi | ||
|
||
#---------------------------------------- | ||
# check if the installation folders exist | ||
#---------------------------------------- | ||
if [ ! -d ${TENSORFLOW_ROOT} ];then | ||
mkdir ${TENSORFLOW_ROOT} | ||
fi | ||
if [ ! -d ${TENSORFLOW_ROOT}/include ];then | ||
mkdir ${TENSORFLOW_ROOT}/include | ||
fi | ||
if [ ! -d ${TENSORFLOW_ROOT}/lib ];then | ||
mkdir ${TENSORFLOW_ROOT}/lib | ||
fi | ||
|
||
#---------------------------------------- | ||
# install the TF libraries | ||
#---------------------------------------- | ||
cp -r ${TF_INSTALL_PATH}/include ${TENSORFLOW_ROOT} | ||
cp ${TF_INSTALL_PATH}/libtensorflow_framework.so* ${TENSORFLOW_ROOT}/lib | ||
cp ${TF_INSTALL_PATH}/python/_pywrap_tensorflow_internal.so ${TENSORFLOW_ROOT}/lib | ||
ln -s ${TENSORFLOW_ROOT}/lib/libtensorflow_framework.so* ${TENSORFLOW_ROOT}/lib/libtensorflow_framework.so | ||
ln -s ${TENSORFLOW_ROOT}/lib/_pywrap_tensorflow_internal.so ${TENSORFLOW_ROOT}/lib/libtensorflow_cc.so | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
DEEPMD_ROOT=@CMAKE_INSTALL_PREFIX@ | ||
TENSORFLOW_INCLUDE_DIRS="@TensorFlow_INCLUDE_DIRS@" | ||
TENSORFLOW_LIBRARY_PATH="@TensorFlow_LIBRARY_PATH@" | ||
PYTHON_LIBRARY_PATH="@Python_LIBRARY_DIRS@" | ||
|
||
TF_INCLUDE_DIRS=`echo $TENSORFLOW_INCLUDE_DIRS | sed "s/;/ -I/g"` | ||
TF_LIBRARY_PATH=`echo $TENSORFLOW_LIBRARY_PATH | sed "s/;/ -L/g"` | ||
TF_RPATH=`echo $TENSORFLOW_LIBRARY_PATH | sed "s/;/ -Wl,-rpath=/g"` | ||
PYTHON_RPATH=`echo $PYTHON_LIBRARY_PATH | sed "s/;/ -Wl,-rpath=/g"` | ||
|
||
NNP_INC=" -D_GLIBCXX_USE_CXX11_ABI=@OP_CXX_ABI@ -std=c++@CMAKE_CXX_STANDARD@ -D@prec_def@ @TTM_DEF@ -DLAMMPS_VERSION_NUMBER=@LAMMPS_VERSION_NUMBER@ -I$TF_INCLUDE_DIRS -I$DEEPMD_ROOT/include/ " | ||
NNP_PATH=" -L$TF_LIBRARY_PATH -L$DEEPMD_ROOT/lib" | ||
NNP_LIB=" -Wl,--no-as-needed -l@LIB_DEEPMD_CC@@variant_name@ -ltensorflow_cc -ltensorflow_framework -lpython@Python_VERSION_MAJOR@.@Python_VERSION_MINOR@ -Wl,-rpath=$TF_RPATH -Wl,-rpath=$DEEPMD_ROOT/lib -Wl,-rpath=$PYTHON_RPATH " |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters