Skip to content

Commit ac376ee

Browse files
committed
Fix windows build (maybe)
Based on tales of success by @jbmaggard in issue #435 Fixes #435 Error in the type def of an argument to `MPI_Type_extent` `long int string_len;` → `MPI_Aint string_len;` on `mpi_caf.c:4140` [L4140]: https://github.com/sourceryinstitute/OpenCoarrays/blob/f7a5f2ebeaf935a67184a978bc40177e4399b82b/src/mpi/mpi_caf.c#L4140
1 parent 1489c4f commit ac376ee

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/mpi/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/mod)
22

3+
if (CMAKE_SYSTEM_NAME MATCHES "Windows")
4+
add_definitions(-D_POSIX -DUSE_GCC)
5+
endif()
6+
37
if (NOT MPI_C_FOUND)
48
find_package(MPI REQUIRED)
59

src/mpi/mpi_caf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4136,7 +4136,7 @@ static void \
41364136
redux_char_by_reference_adapter (void *invec, void *inoutvec, int *len,
41374137
MPI_Datatype *datatype)
41384138
{
4139-
long int string_len;
4139+
MPI_Aint string_len;
41404140
MPI_Type_extent(*datatype, &string_len);
41414141
for(int i = 0; i < *len; i++)
41424142
{

0 commit comments

Comments
 (0)