diff --git a/unittest/fortran/CMakeLists.txt b/unittest/fortran/CMakeLists.txt index 2e7703747b..94672a58d8 100644 --- a/unittest/fortran/CMakeLists.txt +++ b/unittest/fortran/CMakeLists.txt @@ -10,6 +10,11 @@ if(NOT CMAKE_Fortran_COMPILER_ID) message(STATUS "Skipping Tests for the LAMMPS Fortran Module: cannot identify Fortran compiler") return() endif() +find_package(MPI QUIET) +if(BUILD_MPI AND NOT MPI_Fortran) + message(STATUS "Skipping Tests for the LAMMPS Fortran Module: no MPI support for Fortran") + return() +endif() if(CMAKE_Fortran_COMPILER) enable_language(C)