Merge branch 'release-4-5-patches'
[gromacs/adressmacs.git] / cmake / gmxTestMPI_IN_PLACE.cmake
blob40d395775322ca34203ffd0cde1c44d05c5cfa30
1 # - Define macro to check if MPI_IN_PLACE exists
3 #  GMX_TEST_MPI_IN_PLACE(VARIABLE)
5 #  VARIABLE will be set to true if MPI_IN_PLACE exists
8 MACRO(GMX_TEST_MPI_IN_PLACE VARIABLE)
9     MESSAGE(STATUS "Checking for MPI_IN_PLACE")
10     # First check without any special flags
11     TRY_COMPILE(MPI_IN_PLACE_COMPILE_OK ${CMAKE_BINARY_DIR}
12                     "${CMAKE_SOURCE_DIR}/cmake/TestMPI_IN_PLACE.c"
13                     COMPILE_DEFINITIONS )
15     if(MPI_IN_PLACE_COMPILE_OK)
16     MESSAGE(STATUS "Checking for MPI_IN_PLACE - yes")
17         set(${VARIABLE} ${MPI_IN_PLACE_COMPILE_OK} 
18                 "Result of test for MPI_IN_PLACE")
19     else(MPI_IN_PLACE_COMPILE_OK)
20         MESSAGE(STATUS "Checking for MPI_IN_PLACE - no")
21     endif(MPI_IN_PLACE_COMPILE_OK)
22 ENDMACRO(GMX_TEST_MPI_IN_PLACE VARIABLE)