Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

[BUGFIX] Fix for MKL symbol name clashing issue (#18855). #19241

Merged
merged 1 commit into from
Oct 5, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 4 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -664,17 +664,10 @@ if(UNIX)
target_compile_options(mxnet PUBLIC "--coverage")
target_link_libraries(mxnet PUBLIC gcov)
endif()
if(CMAKE_BUILD_TYPE STREQUAL "Distribution")
# TODO For handling mxnet's symbols the following can be replace by
# annotating symbol visibility in source code, specifying
# set(CMAKE_CXX_VISIBILITY_PRESET hidden) and
# set(CMAKE_VISIBILITY_INLINES_HIDDEN ON)
# Symbols from statically linked libraries can be discarded via -Wl,--exclude-libs,ALL
if(APPLE)
set_target_properties(mxnet PROPERTIES LINK_FLAGS "-Wl,-exported_symbols_list,${PROJECT_SOURCE_DIR}/cmake/libmxnet.sym")
else()
set_target_properties(mxnet PROPERTIES LINK_FLAGS "-Wl,--version-script=${PROJECT_SOURCE_DIR}/cmake/libmxnet.ver")
endif()
if(APPLE)
set_target_properties(mxnet PROPERTIES LINK_FLAGS "-Wl,-exported_symbols_list,${PROJECT_SOURCE_DIR}/cmake/libmxnet.sym")
else()
set_target_properties(mxnet PROPERTIES LINK_FLAGS "-Wl,--exclude-libs,ALL")
endif()
elseif(MSVC)
if(USE_CUDA)
Expand Down