From f6bf66c8cf7fc57d849642d99d13058ba62c7f02 Mon Sep 17 00:00:00 2001 From: suffiank Date: Thu, 2 Jul 2020 12:03:42 -0700 Subject: [PATCH] Adjustments to MPI and NCCL library discovery on build (#4407) * cmake edits for mpi_home and nccl_home * cmake syntax error on else --- cmake/CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 7402a9e8e6..2cc3e98272 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -972,7 +972,11 @@ if (onnxruntime_ENABLE_TRAINING) find_package_handle_standard_args(MPI DEFAULT_MSG MPI_INCLUDE_DIR MPI_LIBRARY) if (MPI_FOUND) - execute_process(COMMAND mpirun --version OUTPUT_VARIABLE MPIRUN_OUTPUT) + if(NOT DEFINED onnxruntime_MPI_HOME) + execute_process(COMMAND mpirun --version OUTPUT_VARIABLE MPIRUN_OUTPUT) + else() + execute_process(COMMAND ${onnxruntime_MPI_HOME}/bin/mpirun --version OUTPUT_VARIABLE MPIRUN_OUTPUT) + endif(NOT DEFINED onnxruntime_MPI_HOME) string( REGEX MATCH "[0-9]+.[0-9]+.[0-9]" MPI_VERSION ${MPIRUN_OUTPUT}) message( STATUS "MPI Version: ${MPI_VERSION}") @@ -1002,6 +1006,7 @@ if (onnxruntime_ENABLE_TRAINING) NAMES ${NCCL_LIBNAME} HINTS ${onnxruntime_NCCL_HOME}/lib/x86_64-linux-gnu + ${onnxruntime_NCCL_HOME}/lib $ENV{CUDA_ROOT}/lib64) include(FindPackageHandleStandardArgs)