From 7ce8274c1f5638df490c64cdef2e351437a03c25 Mon Sep 17 00:00:00 2001 From: Adrien Cotte Date: Sat, 30 Apr 2022 09:19:00 +0200 Subject: [PATCH] Remove Open MPI dependency Testing still requires OPENMPI_ROOT, add a note. Slightly modify user guide to document this new behaviour, and other _ROOT variables. --- CMakeLists.txt | 26 -------------------------- README.md | 1 - Testing/etc/mpivars.sh.in | 6 ++++++ docs/Users_guide | 16 +++++++++++----- etc/wi4mpi.cfg.in | 8 ++++---- 5 files changed, 21 insertions(+), 36 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1a91854..ce60e01 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -124,31 +124,6 @@ endif() set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fcommon") -find_package(MPI REQUIRED) -if(MPI_C_FOUND AND MPI_Fortran_FOUND) #Need to be OpenMPI - if(NOT DEFINED OPENMPI_ROOT) - execute_process(COMMAND "${MPI_C_COMPILER}" --showme:version - OUTPUT_VARIABLE ERR_VAR1 - OUTPUT_FILE "compiler_version" - ERROR_QUIET) - execute_process(COMMAND "grep" -i "Open MPI" - INPUT_FILE "compiler_version" - OUTPUT_VARIABLE ERR_VAR2 - RESULT_VARIABLE COMMAND_RESULT1 - ERROR_QUIET) - message(STATUS "res command : ${ERR_VAR2}") - if(NOT ERR_VAR2) - message(FATAL_ERROR "Be sure to have an OpenMPI librarie in your PATH or set -DOPENMPI_ROOT=...") - endif() - foreach(p ${MPI_C_INCLUDE_PATH}) - get_filename_component(OPENMPI_ROOT_TEST ${p} DIRECTORY) - if(EXISTS "${OPENMPI_ROOT_TEST}/lib") - set(OPENMPI_ROOT ${OPENMPI_ROOT_TEST}) - endif () - endforeach(p) - endif() -endif() - find_package(Threads) if(NOT CMAKE_THREAD_LIBS_INIT) message(FATAL_ERROR "Be sure to have Pthread available on you system") @@ -157,7 +132,6 @@ endif() #Setting wi4mpi.cfg CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/etc/wi4mpi.cfg.in ${CMAKE_CURRENT_BINARY_DIR}/wi4mpi.cfg) - #Source subdirectory add_subdirectory(src) enable_testing () diff --git a/README.md b/README.md index afcc287..2c705dc 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,6 @@ Interface : ### Prerequisites * C and Fortran compiler -* [OpenMPI](https://www.open-mpi.org/) WI4MPI has been tested on GNU/Linux only diff --git a/Testing/etc/mpivars.sh.in b/Testing/etc/mpivars.sh.in index 2c2d2be..fbf2810 100644 --- a/Testing/etc/mpivars.sh.in +++ b/Testing/etc/mpivars.sh.in @@ -1,3 +1,9 @@ +# For now, testing requires cmake -DOPENMPI_ROOT=/path/to/ompi/ +if [[ ! -n "@OPENMPI_ROOT@" ]]; then + echo "Error: tests require 'cmake -DOPENMPI_ROOT=/path/to/ompi/' option!" + exit 1 +fi + # Batch scheduler configuration to running tests export WI4MPI_MPRUN=@WI4MPI_MPRUN@ export WI4MPI_PARTITION=@WI4MPI_PARTITION@ diff --git a/docs/Users_guide b/docs/Users_guide index 791272e..83f827e 100644 --- a/docs/Users_guide +++ b/docs/Users_guide @@ -83,11 +83,17 @@ WI4MPI specific variables Possible options: INTEL(default), GNU, PGI, LLVM, ARMCLANG, FUJITSU - OPENMPI_ROOT - If CMAKE is not able to find OPENMPI_ROOT, one must add -DOPENMPI_ROOT=/path/to/openmpi option. - ``` - CMake Error at CMakeLists.txt:xxx (message): - Be sure to have an OpenMPI librarie in your PATH or set -DOPENMPI_ROOT=... - ``` + Open MPI root dir, put in wi4mpi.cfg, could be added manually, optionnal value. + This variable is required for Testing, one must add -DOPENMPI_ROOT=/path/to/openmpi option. + +- INTELMPI_ROOT + Intel MPI root dir, put in wi4mpi.cfg, could be added manually, optionnal value. + +- MPC_ROOT + MPC root dir, put in wi4mpi.cfg, could be added manually, optionnal value. + +- MPICH_ROOT + MPICH root dir, put in wi4mpi.cfg, could be added manually, optionnal value. - WI4MPI_REALEASE diff --git a/etc/wi4mpi.cfg.in b/etc/wi4mpi.cfg.in index fb00913..1892b8c 100644 --- a/etc/wi4mpi.cfg.in +++ b/etc/wi4mpi.cfg.in @@ -1,7 +1,7 @@ #This part is handled by cmake WI4MPI_VERSION="@WI4MPI_VERSION@" -OPENMPI_DEFAULT_ROOT="@OPENMPI_ROOT@" #Please provide the following variables to use the launcher -INTELMPI_DEFAULT_ROOT="" -MPC_DEFAULT_ROOT="" -MPICH_DEFAULT_ROOT="" +OPENMPI_DEFAULT_ROOT="@OPENMPI_ROOT@" +INTELMPI_DEFAULT_ROOT="@INTELMPI_ROOT@" +MPC_DEFAULT_ROOT="@MPC_ROOT@" +MPICH_DEFAULT_ROOT="@MPICH_ROOT@"