From 79709f02e9100306f9aa9bf5887dc5afbe751b5e Mon Sep 17 00:00:00 2001 From: Anders Papitto Date: Thu, 18 Oct 2018 15:30:15 -0700 Subject: [PATCH] fix overwriting of CMAKE_EXE_LINKER_FLAGS (#12834) Summary: bug lurking since 2016 Pull Request resolved: https://github.com/pytorch/pytorch/pull/12834 Reviewed By: bddppq Differential Revision: D10452484 Pulled By: anderspapitto fbshipit-source-id: 352584af06e2fb35338fb66b3d8eb1050b716349 --- cmake/Dependencies.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake index 39ed7808934..cf262894b4f 100644 --- a/cmake/Dependencies.cmake +++ b/cmake/Dependencies.cmake @@ -442,7 +442,7 @@ if(USE_MPI) message(STATUS "MPI libraries: " ${MPI_CXX_LIBRARIES}) include_directories(SYSTEM ${MPI_CXX_INCLUDE_PATH}) list(APPEND Caffe2_DEPENDENCY_LIBS ${MPI_CXX_LIBRARIES}) - set(CMAKE_EXE_LINKER_FLAGS ${MPI_CXX_LINK_FLAGS}) + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${MPI_CXX_LINK_FLAGS}") find_program(OMPI_INFO NAMES ompi_info HINTS ${MPI_CXX_LIBRARIES}/../bin)