Skip to content

Commit 80f0f4a

Browse files
committed
Adding MPI decls for external GPTL
When external GPTL library is used (GPTL_PATH is set to point to an external GPTL library build), not all declarations required by GPTL is exported. Adding declaration to indicate if MPI is available (required by the GPTL header files) to correctly use the GPTL header files. Without this change the build fails with Intel/GNU compilers since the default (incorrect) function declarations in GPTL headers are used during the build.
1 parent 8b02d4f commit 80f0f4a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/clib/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@ if (PIO_ENABLE_TIMING)
6868
PUBLIC ${GPTL_C_INCLUDE_DIRS})
6969
target_link_libraries (pioc
7070
PUBLIC ${GPTL_C_LIBRARIES})
71+
72+
# GPTL expects HAVE_MPI, if MPI is available, when using GPTL header files
73+
if (NOT PIO_USE_MPISERIAL)
74+
target_compile_definitions (pioc PUBLIC HAVE_MPI)
75+
endif ()
7176
else ()
7277
message (STATUS "Using internal GPTL C library for timing")
7378
target_include_directories (pioc

0 commit comments

Comments
 (0)