Link to gcc_s and gcc if compiler is GCC version 5. Fixes issue #9593 (#9642)

This commit is contained in:
Erik Smistad 2017-05-06 05:46:12 +02:00 committed by Vijay Vasudevan
parent 6fca7d1037
commit 50d816cbc5

View File

@ -82,6 +82,13 @@ target_link_libraries(tensorflow PRIVATE
tf_protos_cc tf_protos_cc
) )
# There is a bug in GCC 5 resulting in undefined reference to a __cpu_model function when
# linking to the tensorflow library. Adding the following libraries fixes it.
# See issue on github: https://github.com/tensorflow/tensorflow/issues/9593
if(CMAKE_COMPILER_IS_GNUCC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 5.0)
target_link_libraries(tensorflow PRIVATE gcc_s gcc)
endif()
if(WIN32) if(WIN32)
add_dependencies(tensorflow tensorflow_static) add_dependencies(tensorflow tensorflow_static)
endif(WIN32) endif(WIN32)