Skip to content

Commit 3002769

Browse files
committed
Merge branches 'add-issue-493-tests', 'issue-489-bump-so-version' and 'caf-mpi-arg-fix'
Just discovering the joys of the "octopus" merge strategy to close multiple PRs at the same time without needing to rebase or merge master first. All hail :octocat:!
3 parents a54df7f + aea5807 + 6f3b5de commit 3002769

File tree

3 files changed

+24
-10
lines changed

3 files changed

+24
-10
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: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,9 @@ target_link_libraries(caf_mpi_static PRIVATE ${MPI_C_LIBRARIES} ${MPI_Fortran_LI
158158

159159
set(CAF_SO_VERSION 0)
160160
if(gfortran_compiler)
161-
if(NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 7.0.0)
161+
if(NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 8.0.0)
162+
set(CAF_SO_VERSION 3)
163+
elseif(NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 7.0.0)
162164
set(CAF_SO_VERSION 2)
163165
elseif(NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 6.0.0)
164166
set(CAF_SO_VERSION 1)
@@ -208,19 +210,29 @@ install(TARGETS caf_mpi_static EXPORT OpenCoarraysTargets
208210
# List of caf.in variables needing configuration:
209211
#
210212
# @CAF_VERSION@ @opencoarrays_aware_compiler@ @Fortran_COMPILER@ @CAF_MODDIR@
211-
# @MPI_Fortran_LINK_FLAGS@ @MPI_Fortran_COMPILE_FLAGS@
212-
# @CAF_LIBS@ @MPI_LIBS@
213+
# @CAF_MPI_Fortran_LINK_FLAGS@ @CAF_MPI_Fortran_COMPILE_FLAGS@
214+
# @CAF_LIBS@ @CAF_MPI_LIBS@
213215
#
214216

215217
set(CAF_VERSION "${full_git_describe}")
216218
set(Fortran_COMPILER "${CMAKE_Fortran_COMPILER}")
217219
set(CAF_MODDIR "${CMAKE_INSTALL_INCLUDEDIR}/${mod_dir_tail}")
218220
set(MOD_DIR_FLAG "${CMAKE_Fortran_MODDIR_FLAG}")
219-
set(MPI_LIBS "")
221+
set(CAF_MPI_LIBS "")
220222
foreach( lib IN LISTS MPI_Fortran_LIBRARIES)
221-
set(MPI_LIBS "${MPI_LIBS} \"${lib}\"")
223+
set(CAF_MPI_LIBS "${CAF_MPI_LIBS} \"${lib}\"")
222224
endforeach()
223225
string(STRIP "${MPI_LIBS}" MPI_LIBS)
226+
set(CAF_MPI_Fortran_LINK_FLAGS "")
227+
foreach( lflag IN LISTS MPI_Fortran_LINK_FLAGS)
228+
set(CAF_MPI_Fortran_LINK_FLAGS "${CAF_MPI_Fortran_LINK_FLAGS} ${lflag}" )
229+
endforeach()
230+
string(STRIP "${CAF_MPI_Fortran_LINK_FLAGS}" CAF_MPI_Fortran_LINK_FLAGS)
231+
set(CAF_MPI_Fortran_COMPILE_FLAGS "")
232+
foreach( fcflag IN LISTS MPI_Fortran_COMPILE_FLAGS)
233+
set(CAF_MPI_Fortran_COMPILE_FLAGS "${CAF_MPI_Fortran_COMPILE_FLAGS} ${fcflag}" )
234+
endforeach()
235+
string(STRIP "${CAF_MPI_Fortran_COMPILE_FLAGS}" CAF_MPI_Fortran_COMPILE_FLAGS)
224236
set_target_properties(caf_mpi_static
225237
PROPERTIES OUTPUT_NAME caf_mpi)
226238
get_target_property(libcaf_static caf_mpi_static OUTPUT_NAME)

0 commit comments

Comments
 (0)