1
1
set (CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_BINARY_DIR} /mod )
2
2
3
- if (MINGW )
4
- add_definitions (-D_POSIX )
5
- endif ()
6
-
7
3
if (NOT MPI_C_FOUND )
8
4
find_package (MPI REQUIRED )
9
5
@@ -42,8 +38,32 @@ endif()
42
38
#----------------------------------------------------------------------
43
39
# Test if MPI implementation provides features needed for failed images
44
40
#----------------------------------------------------------------------
45
- set (NEEDED_SYMBOLS MPIX_ERR_PROC_FAILED;MPIX_ERR_REVOKED;MPIX_Comm_failure_ack;MPIX_Comm_failure_get_acked;MPIX_Comm_shrink;MPIX_Comm_agree )
46
41
set (MPI_HAS_FAULT_TOL_EXT YES )
42
+
43
+ CHECK_INCLUDE_FILE ("signal.h" HAVE_SIGNAL_H )
44
+ if (NOT HAVE_SIGNAL_H )
45
+ set (MPI_HAS_FAULT_TOL_EXT NO )
46
+ message ( FATAL_ERROR "Currently, OpenCoarrays cannot build without signal.h" )
47
+ endif ()
48
+
49
+ include (CheckSymbolExists )
50
+ CHECK_SYMBOL_EXISTS (SIGKILL "signal.h" HAVE_SIGKILL )
51
+ if (NOT HAVE_SIGKILL ) # try -D_POSIX, needed for mingw-w64, maybe others, see #435
52
+ # https://github.com/sourceryinstitute/OpenCoarrays/issues/435#issuecomment-323592433
53
+ list ( APPEND CMAKE_REQUIRED_DEFINITIONS -D_POSIX )
54
+ CHECK_SYMBOL_EXISTS (SIGKILL "signal.h" HAVE_SIGKILL )
55
+ if (HAVE_SIGKILL )
56
+ add_definitions (-D_POSIX )
57
+ endif ()
58
+ endif ()
59
+
60
+ if (NOT HAVE_SIGKILL )
61
+ set (MPI_HAS_FAULT_TOL_EXT NO )
62
+ message (FATAL_ERROR "Currently, OpenCoarrays cannot build without SIGKILL from signal.h" )
63
+ endif ()
64
+
65
+ set (NEEDED_SYMBOLS MPIX_ERR_PROC_FAILED;MPIX_ERR_REVOKED;MPIX_Comm_failure_ack;MPIX_Comm_failure_get_acked;MPIX_Comm_shrink;MPIX_Comm_agree )
66
+
47
67
set (old_cmake_required_includes "${CMAKE_REQUIRED_INCLUDES} " )
48
68
if (CMAKE_REQUIRED_INCLUDES )
49
69
set (CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ;${MPI_C_INCLUDE_PATH} )
@@ -69,7 +89,7 @@ if(HAVE_MPI_EXT)
69
89
add_definitions (-DHAVE_MPI_EXT_H )
70
90
set (MPI_HEADERS ${MPI_HEADERS} ;mpi-ext.h )
71
91
endif ()
72
- include ( CheckSymbolExists )
92
+
73
93
foreach (symbol ${NEEDED_SYMBOLS} )
74
94
CHECK_SYMBOL_EXISTS (${symbol} ${MPI_HEADERS} HAVE_${symbol} )
75
95
if (NOT HAVE_${symbol} )
@@ -93,6 +113,16 @@ if(CAF_ENABLE_FAILED_IMAGES)
93
113
add_definitions (-DUSE_FAILED_IMAGES )
94
114
endif ()
95
115
116
+ #---------------------------------------------------
117
+ # Windows Intel MPI compatibility, see GH issue #435
118
+ #---------------------------------------------------
119
+ CHECK_SYMBOL_EXISTS (I_MPI_VERSION mpi.h HAVE_Intel_MPI )
120
+ if (HAVE_Intel_MPI AND WIN32 )
121
+ add_definitions (-DUSE_GCC )
122
+ endif ()
123
+
124
+
125
+
96
126
# Determine whether and how to include OpenCoarrays module based on if the Fortran MPI compiler:
97
127
# - workds
98
128
# - is compatible with the fortran compiler used to build the MPI implementation
0 commit comments