Skip to content

Commit 882c371

Browse files
authored
Merge pull request #307 from LaHaine/issue305
Fixes #305 (gfortran compiler detection) and fixes #306 Also closes #308 (supersedes this pull request)
2 parents 8053475 + d44c97b commit 882c371

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

prerequisites/install-functions/build_opencoarrays.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ build_opencoarrays()
1313
if [[ -z ${MPIFC:-} || -z ${MPICC:-} ]]; then
1414
emergency "build_opencoarrays.sh: empty \${MPIFC}=${MPIFC:-} or \${MPICC}=${MPICC:-}"
1515
fi
16-
MPIFC_show=`$MPIFC -show`
17-
MPICC_show=`$MPICC -show`
18-
if [[ ${MPIFC_show} != *gfortran* || ${MPICC_show} != *gcc* ]]; then
19-
emergency "build_opencoarrays.sh: MPI doesn't wrap gfortran/gcc: \${MPIFC_show}=${MPIFC_show}, \${MPICC_show}=${MPICC_show}"
20-
fi
16+
MPIFC_show=($($MPIFC -show))
17+
MPICC_show=($($MPICC -show))
18+
if [[ "${MPIFC_show[0]}" != *gfortran* || "${MPICC_show[0]}" != *gcc* ]]; then
19+
emergency "build_opencoarrays.sh: MPI doesn't wrap gfortran/gcc: \${MPIFC_show}=${MPIFC_show[*]}, \${MPICC_show}=${MPICC_show[*]}"
20+
fi
2121
# Set FC to the MPI implementation's gfortran command with any preceding path but without any subsequent arguments:
22-
FC="${MPIFC_show%%gfortran*}"gfortran
22+
FC="${MPIFC_show[0]}"
2323
# Set CC to the MPI implementation's gcc command...
24-
CC="${MPICC_show%%gcc*}"gcc
24+
CC="${MPICC_show[0]}"
2525
info "Configuring OpenCoarrays in ${PWD} with the command:"
2626
info "CC=\"${CC}\" FC=\"${FC}\" $CMAKE \"${opencoarrays_src_dir}\" -DCMAKE_INSTALL_PREFIX=\"${install_path}\" -DMPI_C_COMPILER=\"${MPICC}\" -DMPI_Fortran_COMPILER=\"${MPIFC}\""
2727
CC="${CC}" FC="${FC}" $CMAKE "${opencoarrays_src_dir}" -DCMAKE_INSTALL_PREFIX="${install_path}" -DMPI_C_COMPILER="${MPICC}" -DMPI_Fortran_COMPILER="${MPIFC}"

prerequisites/install-functions/find_or_install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ find_or_install()
266266
info "$this_script: Checking whether $executable in PATH is version $(./build.sh -V gcc) or later..."
267267
$executable -o acceptable_compiler acceptable_compiler.f90 || true;
268268
$executable -o print_true print_true.f90 || true;
269-
if [[ -f ./accepatable_compiler && -f ./print_true ]]; then
269+
if [[ -f ./acceptable_compiler && -f ./print_true ]]; then
270270
is_true=$(./print_true)
271271
acceptable=$(./acceptable_compiler)
272272
rm acceptable_compiler print_true

0 commit comments

Comments
 (0)