Skip to content

Commit 6f3b5de

Browse files
committed
Use , not ;, field sep when configuring caf
CMake uses semi-colons to separate list items, and some of these semicolons were being injected into the `caf` script on some systems (FreeBSD) where as spaces should have been used. (See #475, specifically #475 (comment))
1 parent 7b6da6a commit 6f3b5de

File tree

3 files changed

+21
-9
lines changed

3 files changed

+21
-9
lines changed

src/extensions/caf.in

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ set -o pipefail
5050
# List of variables needing configuration:
5151
#
5252
# CAF_VERSION, opencoarrays_aware_compiler, Fortran_COMPILER, CAF_MODDIR,
53-
# MPI_Fortran_LINK_FLAGS, MPI_Fortran_COMPILE_FLAGS,
54-
# CAF_LIBS, MPI_LIBS
53+
# CAF_MPI_Fortran_LINK_FLAGS, CAF_MPI_Fortran_COMPILE_FLAGS,
54+
# CAF_LIBS, CAF_MPI_LIBS
5555
#
5656

5757
caf_version='@CAF_VERSION@' # fetched from `git describe` and/or
@@ -80,15 +80,15 @@ mod_dir_flag="-I"
8080
# variables expanded from CMake should be appropriately quoted.
8181

8282
# shellcheck disable=SC2054
83-
mpi_link_flags=(@MPI_Fortran_LINK_FLAGS@) # e.g. `pkg-config
83+
mpi_link_flags=(@CAF_MPI_Fortran_LINK_FLAGS@) # e.g. `pkg-config
8484
# --libs-only-other mpich`
8585
# __*AND*__ `pkg-config
8686
# --libs-only-L`
87-
mpi_compile_flags=(@MPI_Fortran_COMPILE_FLAGS@)
87+
mpi_compile_flags=(@CAF_MPI_Fortran_COMPILE_FLAGS@)
8888
caf_libs=(@CAF_LIBS@) # e.g. "libcaf_mpi" "libcaf_extensions",
8989
# preferably full paths, but could be
9090
# combination of -L... and -lcaf_mpi...
91-
mpi_libs=(@MPI_LIBS@) # e.g. `pkg-config --libs-only-l` or full paths
91+
mpi_libs=(@CAF_MPI_LIBS@) # e.g. `pkg-config --libs-only-l` or full paths
9292
# to MPI libs
9393

9494
#-------------------------

src/extensions/cafrun.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,12 @@ if [[ ${numproc_flag} == @*@ ]]; then
6868
numproc_flag='-np'
6969
fi
7070
preflags="@MPIEXEC_PREFLAGS@"
71+
preflags="${preflags//;/ }"
7172
if [[ "${preflags}" == @*@ ]]; then
7273
unset preflags
7374
fi
7475
postflags="@MPIEXEC_POSTFLAGS@"
76+
postflags="${postflags//;/ }"
7577
if [[ "${postflags}" == @*@ ]]; then
7678
unset postflags
7779
fi

src/mpi/CMakeLists.txt

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,19 +208,29 @@ install(TARGETS caf_mpi_static EXPORT OpenCoarraysTargets
208208
# List of caf.in variables needing configuration:
209209
#
210210
# @CAF_VERSION@ @opencoarrays_aware_compiler@ @Fortran_COMPILER@ @CAF_MODDIR@
211-
# @MPI_Fortran_LINK_FLAGS@ @MPI_Fortran_COMPILE_FLAGS@
212-
# @CAF_LIBS@ @MPI_LIBS@
211+
# @CAF_MPI_Fortran_LINK_FLAGS@ @CAF_MPI_Fortran_COMPILE_FLAGS@
212+
# @CAF_LIBS@ @CAF_MPI_LIBS@
213213
#
214214

215215
set(CAF_VERSION "${full_git_describe}")
216216
set(Fortran_COMPILER "${CMAKE_Fortran_COMPILER}")
217217
set(CAF_MODDIR "${CMAKE_INSTALL_INCLUDEDIR}/${mod_dir_tail}")
218218
set(MOD_DIR_FLAG "${CMAKE_Fortran_MODDIR_FLAG}")
219-
set(MPI_LIBS "")
219+
set(CAF_MPI_LIBS "")
220220
foreach( lib IN LISTS MPI_Fortran_LIBRARIES)
221-
set(MPI_LIBS "${MPI_LIBS} \"${lib}\"")
221+
set(CAF_MPI_LIBS "${CAF_MPI_LIBS} \"${lib}\"")
222222
endforeach()
223223
string(STRIP "${MPI_LIBS}" MPI_LIBS)
224+
set(CAF_MPI_Fortran_LINK_FLAGS "")
225+
foreach( lflag IN LISTS MPI_Fortran_LINK_FLAGS)
226+
set(CAF_MPI_Fortran_LINK_FLAGS "${CAF_MPI_Fortran_LINK_FLAGS} ${lflag}" )
227+
endforeach()
228+
string(STRIP "${CAF_MPI_Fortran_LINK_FLAGS}" CAF_MPI_Fortran_LINK_FLAGS)
229+
set(CAF_MPI_Fortran_COMPILE_FLAGS "")
230+
foreach( fcflag IN LISTS MPI_Fortran_COMPILE_FLAGS)
231+
set(CAF_MPI_Fortran_COMPILE_FLAGS "${CAF_MPI_Fortran_COMPILE_FLAGS} ${fcflag}" )
232+
endforeach()
233+
string(STRIP "${CAF_MPI_Fortran_COMPILE_FLAGS}" CAF_MPI_Fortran_COMPILE_FLAGS)
224234
set_target_properties(caf_mpi_static
225235
PROPERTIES OUTPUT_NAME caf_mpi)
226236
get_target_property(libcaf_static caf_mpi_static OUTPUT_NAME)

0 commit comments

Comments
 (0)