Fix MKL builds on Ubuntu (#50212)

Summary:
This fixes https://github.com/pytorch/pytorch/issues/50211

Pull Request resolved: https://github.com/pytorch/pytorch/pull/50212

Reviewed By: janeyx99

Differential Revision: D25850876

Pulled By: walterddr

fbshipit-source-id: be138db3ae370c45f5fbf3af486cf8b32518df87
This commit is contained in:
Antonio Cuni 2021-01-08 13:14:33 -08:00 committed by Facebook GitHub Bot
parent 1bb7d8ff93
commit 8f31621f78

View File

@ -318,7 +318,7 @@ set(OP_DEPENDENCY "" CACHE STRING
# symbol lookup error: miniconda3/envs/pytorch-py3.7/lib/libmkl_intel_lp64.so: undefined symbol: mkl_blas_dsyrk
# https://software.intel.com/en-us/articles/symbol-lookup-error-when-linking-intel-mkl-with-gcc-on-ubuntu
if(LINUX)
set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-as-needed ${CMAKE_SHARED_LINKER_FLAGS}")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-as-needed")
endif()
if(MSVC)