diff --git a/CMakeLists.txt b/CMakeLists.txt index 870e67f0a..9e81b0a9f 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -418,7 +418,7 @@ add_library(transformer-shared SHARED if (BUILD_MULTI_GPU) target_link_libraries(transformer-shared PUBLIC - -lmpi + ${MPI_mpi_LIBRARY} ${NCCL_LIBRARIES} ) endif() diff --git a/src/fastertransformer/utils/CMakeLists.txt b/src/fastertransformer/utils/CMakeLists.txt index 9796ad076..b88045a53 100644 --- a/src/fastertransformer/utils/CMakeLists.txt +++ b/src/fastertransformer/utils/CMakeLists.txt @@ -57,7 +57,7 @@ add_library(mpi_utils STATIC mpi_utils.cc) set_property(TARGET mpi_utils PROPERTY POSITION_INDEPENDENT_CODE ON) set_property(TARGET mpi_utils PROPERTY CUDA_RESOLVE_DEVICE_SYMBOLS ON) if (BUILD_MULTI_GPU) - target_link_libraries(mpi_utils PUBLIC -lmpi logger) + target_link_libraries(mpi_utils PUBLIC ${MPI_mpi_LIBRARY} logger) endif() add_library(nccl_utils STATIC nccl_utils.cc)