@@ -38,8 +38,32 @@ endif()
38
38
#----------------------------------------------------------------------
39
39
# Test if MPI implementation provides features needed for failed images
40
40
#----------------------------------------------------------------------
41
- 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)
42
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
+
43
67
set (old_cmake_required_includes "${CMAKE_REQUIRED_INCLUDES} " )
44
68
if (CMAKE_REQUIRED_INCLUDES)
45
69
set (CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ;${MPI_C_INCLUDE_PATH} )
@@ -65,7 +89,7 @@ if(HAVE_MPI_EXT)
65
89
add_definitions (-DHAVE_MPI_EXT_H)
66
90
set (MPI_HEADERS ${MPI_HEADERS} ;mpi-ext .h)
67
91
endif ()
68
- include (CheckSymbolExists)
92
+
69
93
foreach (symbol ${NEEDED_SYMBOLS} )
70
94
CHECK_SYMBOL_EXISTS(${symbol} ${MPI_HEADERS} HAVE_${symbol} )
71
95
if (NOT HAVE_${symbol} )
@@ -89,6 +113,16 @@ if(CAF_ENABLE_FAILED_IMAGES)
89
113
add_definitions (-DUSE_FAILED_IMAGES)
90
114
endif ()
91
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
+
92
126
# Determine whether and how to include OpenCoarrays module based on if the Fortran MPI compiler:
93
127
# - workds
94
128
# - is compatible with the fortran compiler used to build the MPI implementation
0 commit comments