Line 0
Link Here
|
|
|
1 |
--- CMakeLists.txt.orig 2017-02-07 05:19:01 UTC |
2 |
+++ CMakeLists.txt |
3 |
@@ -164,48 +164,6 @@ if ( (NOT MPI_C_FOUND) OR (NOT MPI_Fortr |
4 |
find_package( MPI REQUIRED ) |
5 |
endif() |
6 |
|
7 |
-#-------------------------------------------------------- |
8 |
-# Make sure a simple "hello world" C mpi program compiles |
9 |
-#-------------------------------------------------------- |
10 |
-set(OLD_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS}) |
11 |
-set(CMAKE_REQUIRED_FLAGS ${MPI_C_COMPILE_FLAGS} ${MPI_C_LINK_FLAGS}) |
12 |
-set(OLD_INCLUDES ${CMAKE_REQUIRED_INCLUDES}) |
13 |
-set(CMAKE_REQUIRED_INCLUDES ${MPI_C_INCLUDE_PATH}) |
14 |
-set(OLD_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}) |
15 |
-set(CMAKE_REQUIRED_LIBRARIES ${MPI_C_LIBRARIES}) |
16 |
-include (CheckCSourceCompiles) |
17 |
-CHECK_C_SOURCE_COMPILES(" |
18 |
-#include <mpi.h> |
19 |
-#include <stdio.h> |
20 |
-int main(int argc, char** argv) { |
21 |
- MPI_Init(NULL, NULL); |
22 |
- int world_size; |
23 |
- MPI_Comm_size(MPI_COMM_WORLD, &world_size); |
24 |
- int world_rank; |
25 |
- MPI_Comm_rank(MPI_COMM_WORLD, &world_rank); |
26 |
- char processor_name[MPI_MAX_PROCESSOR_NAME]; |
27 |
- int name_len; |
28 |
- MPI_Get_processor_name(processor_name, &name_len); |
29 |
- printf('Hello world from processor %s, rank %d out of %d processors', |
30 |
- processor_name, world_rank, world_size); |
31 |
- MPI_Finalize(); |
32 |
-}" |
33 |
-MPI_C_COMPILES) |
34 |
-set(CMAKE_REQUIRED_FLAGS ${OLD_REQUIRED_FLAGS}) |
35 |
-set(CMAKE_REQUIRED_INCLUDES ${OLD_INCLUDES}) |
36 |
-set(CMAKE_REQUIRED_LIBRARIES ${OLD_LIBRARIES}) |
37 |
-unset(OLD_REQUIRED_FLAGS) |
38 |
-unset(OLD_INCLUDES) |
39 |
-unset(OLD_LIBRARIES) |
40 |
- |
41 |
-if (NOT MPI_C_COMPILES) |
42 |
- message(FATAL_ERROR "MPI_C is missing! " |
43 |
- "Try setting MPI_C_COMPILER to the appropriate C compiler wrapper script and reconfigure. " |
44 |
- "i.e., `cmake -DMPI_C_COMPILER=/path/to/mpicc ..` or set it by editing the cache using " |
45 |
- "cmake-gui or ccmake." |
46 |
- ) |
47 |
-endif() |
48 |
- |
49 |
#-------------------------------------------------------------- |
50 |
# Make sure a simple "hello world" Fortran mpi program compiles |
51 |
# Try using mpi.mod first then fall back on includ 'mpif.h' |