From 3d124321d57ecd632fc3ebe803a1e183d9a2f144 Mon Sep 17 00:00:00 2001 From: NDJINGA Michael Date: Thu, 20 Jan 2022 15:30:09 +0100 Subject: [PATCH] Improved detection of mpi compilers --- CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 237fb47..16fb08e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -76,6 +76,14 @@ if( DEFINED ENV{MPI_HOME} OR MPI_HOME ) set ( MPI_LIBRARY ${MPI_HOME}/lib/libmpi.so ) endif(${MPI_LIBRARY} STREQUAL "MPI_LIBRARY-NOTFOUND") message ( STATUS "MPI executable is ${MPIEXEC}" ) + if (NOT DEFINED CMAKE_CXX_COMPILER) + set(CMAKE_CXX_COMPILER ${MPI_HOME}/bin/mpic++) + endif(NOT DEFINED CMAKE_CXX_COMPILER) + message ( STATUS "MPI C++ compiler is ${CMAKE_CXX_COMPILER}" ) + if (NOT DEFINED CMAKE_C_COMPILER) + set(CMAKE_C_COMPILER ${MPI_HOME}/bin/mpicc) + endif(NOT DEFINED CMAKE_C_COMPILER) + message ( STATUS "MPI C compiler is ${CMAKE_C_COMPILER}" ) else( DEFINED ENV{MPI_HOME} OR MPI_HOME ) set(SOLVERLAB_WITH_MPI OFF) endif( DEFINED ENV{MPI_HOME} OR MPI_HOME ) -- 2.39.2