document modules; fixes #7
This commit is contained in:
@ -1,10 +1,32 @@
|
||||
#.rst:
|
||||
#
|
||||
# Enables MPI support.
|
||||
#
|
||||
# Variables used::
|
||||
#
|
||||
# ENABLE_MPI
|
||||
# MPI_FOUND
|
||||
#
|
||||
# Variables modified (provided the corresponding language is enabled)::
|
||||
#
|
||||
# CMAKE_Fortran_FLAGS
|
||||
#
|
||||
# Example autocmake.cfg entry::
|
||||
#
|
||||
# [mpi]
|
||||
# source: https://github.com/scisoft/autocmake/raw/master/modules/mpi.cmake
|
||||
# docopt: --mpi Enable MPI parallelization [default: False].
|
||||
# define: '-DENABLE_MPI=%s' % arguments['--mpi']
|
||||
|
||||
option(ENABLE_MPI "Enable MPI parallelization" OFF)
|
||||
|
||||
# on Cray configure with -D MPI_FOUND=1
|
||||
if(ENABLE_MPI AND NOT MPI_FOUND)
|
||||
find_package(MPI)
|
||||
if(MPI_FOUND)
|
||||
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${MPI_COMPILE_FLAGS}")
|
||||
if(DEFINED CMAKE_Fortran_COMPILER_ID)
|
||||
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${MPI_COMPILE_FLAGS}")
|
||||
endif()
|
||||
include_directories(${MPI_INCLUDE_PATH})
|
||||
else()
|
||||
message(FATAL_ERROR "-- You asked for MPI, but CMake could not find any MPI installation, check $PATH")
|
||||
|
Reference in New Issue
Block a user