diff options
author | bddppq <bai@in.tum.de> | 2018-12-11 23:20:31 -0800 |
---|---|---|
committer | Facebook Github Bot <facebook-github-bot@users.noreply.github.com> | 2018-12-11 23:23:47 -0800 |
commit | 479481b6cbcdccbc99c8c45da30033b77502b96b (patch) | |
tree | 41d9917b9f520fbb22e3539d4161179c88165148 /cmake | |
parent | 0dade9862c62a427e5d48d74b1316a079c107726 (diff) | |
download | pytorch-479481b6cbcdccbc99c8c45da30033b77502b96b.tar.gz pytorch-479481b6cbcdccbc99c8c45da30033b77502b96b.tar.bz2 pytorch-479481b6cbcdccbc99c8c45da30033b77502b96b.zip |
Remove linker and dlopen flags that allowed undefined symbols in rocm build (#15091)
Summary:
Previously the undefined symbols were caused by disabled_modules in tools/amd_build/disabled_features.json (now it's cleared).
Pull Request resolved: https://github.com/pytorch/pytorch/pull/15091
Differential Revision: D13429595
Pulled By: bddppq
fbshipit-source-id: b341e83f9e5a8d16440a364e837b045a8a4fd6e1
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/Dependencies.cmake | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake index a0853a44c4..28ffacda0e 100644 --- a/cmake/Dependencies.cmake +++ b/cmake/Dependencies.cmake @@ -760,25 +760,14 @@ if(USE_ROCM) hip_include_directories(${Caffe2_HIP_INCLUDE}) set(Caffe2_HIP_DEPENDENCY_LIBS - ${rocrand_LIBRARIES} ${hiprand_LIBRARIES} ${PYTORCH_HIP_HCC_LIBRARIES} ${PYTORCH_MIOPEN_LIBRARIES}) - # Additional libraries required by PyTorch AMD that aren't used by Caffe2 (not in Caffe2's docker image) - if(NOT BUILD_ATEN_MOBILE) - set(Caffe2_HIP_DEPENDENCY_LIBS ${Caffe2_HIP_DEPENDENCY_LIBS} ${hipsparse_LIBRARIES}) - endif() - # Note [rocblas cmake bug] - # ~~~~~~~~~~~~~~~~~~~~~~~~ - # TODO: There is a bug in rocblas's cmake files that exports the wrong targets name in ${rocblas_LIBRARIES} + ${rocrand_LIBRARIES} ${hiprand_LIBRARIES} ${hipsparse_LIBRARIES} ${PYTORCH_HIP_HCC_LIBRARIES} ${PYTORCH_MIOPEN_LIBRARIES}) + + # Note [rocblas & rocfft cmake bug] + # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + # TODO: There is a bug in rocblas's & rocfft's cmake files that exports the wrong targets name in ${rocblas_LIBRARIES} # If you get this wrong, you'll get a complaint like 'ld: cannot find -lrocblas-targets' list(APPEND Caffe2_HIP_DEPENDENCY_LIBS - roc::rocblas) - - # TODO: Currently pytorch hipify script uses a feature called - # "disabled_modules" that effectively ifdef out a file, but - # without doing extra processing in the callers, which results in - # some unresolved symbols in the shared lib - # (libcaffe2_hip.so). Remove this when all disabled_modules are - # eliminated. - set(CMAKE_EXE_LINKER_FLAGS "-Wl,--unresolved-symbols=ignore-in-shared-libs ${CMAKE_EXE_LINKER_FLAGS}") + roc::rocblas roc::rocfft) else() caffe2_update_option(USE_ROCM OFF) endif() |