@@ -845,6 +845,29 @@ if (tensorflow_c_api)
845
845
include_directories (${TENSORFLOW_C_LIB_PATH} /include )
846
846
endif ()
847
847
848
+ # They are not referenced. See set_output_directory().
849
+ set ( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR} /bin )
850
+ set ( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR} /lib${LLVM_LIBDIR_SUFFIX} )
851
+ set ( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR} /lib${LLVM_LIBDIR_SUFFIX} )
852
+
853
+ # For up-to-date instructions for installing the Tensorflow dependency, refer to
854
+ # the bot setup script: https://github.com/google/ml-compiler-opt/blob/master/buildbot/buildbot_init.sh
855
+ # Specifically, assuming python3 is installed:
856
+ # python3 -m pip install --upgrade pip && python3 -m pip install --user tf_nightly==2.3.0.dev20200528
857
+ # Then set TENSORFLOW_AOT_PATH to the package install - usually it's ~/.local/lib/python3.7/site-packages/tensorflow
858
+ #
859
+ set (TENSORFLOW_AOT_PATH "" CACHE PATH "Path to TensorFlow pip install dir" )
860
+
861
+ if (NOT TENSORFLOW_AOT_PATH STREQUAL "" )
862
+ set (LLVM_HAVE_TF_AOT "ON" CACHE BOOL "Tensorflow AOT available" )
863
+ set (TENSORFLOW_AOT_COMPILER
864
+ "${TENSORFLOW_AOT_PATH} /../../../../bin/saved_model_cli"
865
+ CACHE PATH "Path to the Tensorflow AOT compiler" )
866
+ include_directories (${TENSORFLOW_AOT_PATH} /include )
867
+ add_subdirectory (${TENSORFLOW_AOT_PATH} /xla_aot_runtime_src
868
+ ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} /tf_runtime)
869
+ endif ()
870
+
848
871
# Configure the three LLVM configuration header files.
849
872
configure_file (
850
873
${LLVM_MAIN_INCLUDE_DIR} /llvm/Config/config.h.cmake
@@ -875,12 +898,6 @@ add_custom_target(srpm
875
898
COMMAND rpmbuild -bs --define '_topdir ${LLVM_SRPM_DIR} ' ${LLVM_SRPM_BINARY_SPECFILE} )
876
899
set_target_properties (srpm PROPERTIES FOLDER "Misc" )
877
900
878
-
879
- # They are not referenced. See set_output_directory().
880
- set ( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR} /bin )
881
- set ( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR} /lib${LLVM_LIBDIR_SUFFIX} )
882
- set ( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR} /lib${LLVM_LIBDIR_SUFFIX} )
883
-
884
901
if (APPLE AND DARWIN_LTO_LIBRARY)
885
902
set (CMAKE_EXE_LINKER_FLAGS
886
903
"${CMAKE_EXE_LINKER_FLAGS} -Wl,-lto_library -Wl,${DARWIN_LTO_LIBRARY} " )
@@ -975,28 +992,6 @@ if( MINGW AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
975
992
llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "-O2" )
976
993
endif ()
977
994
978
- # For up-to-date instructions for installing the Tensorflow dependency, refer to
979
- # the bot setup script: https://github.com/google/ml-compiler-opt/blob/master/buildbot/buildbot_init.sh
980
- # Specifically, assuming python3 is installed:
981
- # python3 -m pip install --upgrade pip && python3 -m pip install --user tf_nightly==2.3.0.dev20200528
982
- # Then set TENSORFLOW_AOT_PATH to the package install - usually it's ~/.local/lib/python3.7/site-packages/tensorflow
983
- #
984
- set (TENSORFLOW_AOT_PATH "" CACHE PATH "Path to TensorFlow pip install dir" )
985
-
986
- if (NOT TENSORFLOW_AOT_PATH STREQUAL "" )
987
- set (LLVM_HAVE_TF_AOT "ON" CACHE BOOL "Tensorflow AOT available" )
988
- set (TENSORFLOW_AOT_COMPILER
989
- "${TENSORFLOW_AOT_PATH} /../../../../bin/saved_model_cli"
990
- CACHE PATH "Path to the Tensorflow AOT compiler" )
991
- # Unlike the LLVM_HAVE_TF_API case, we don't need to expose this through
992
- # llvm-config.h, because it's an internal implementation detail. A user of the llvm library that wants to also
993
- # use the TF AOT compiler may do so through their custom build step.
994
- add_definitions ("-DLLVM_HAVE_TF_AOT" )
995
- include_directories (${TENSORFLOW_AOT_PATH} /include )
996
- add_subdirectory (${TENSORFLOW_AOT_PATH} /xla_aot_runtime_src
997
- ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} /tf_runtime)
998
- endif ()
999
-
1000
995
# Put this before tblgen. Else we have a circular dependence.
1001
996
add_subdirectory (lib/Demangle)
1002
997
add_subdirectory (lib/Support)
0 commit comments