Skip to content

Commit 2d67d79

Browse files
committed
correct cmake path in report_results.sh
- Fixes #385 - Handle other paths more robustly
1 parent 0d2ef3b commit 2d67d79

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

prerequisites/install-functions/report_results.sh

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,18 @@
11
# shellcheck shell=bash disable=SC2154,SC2129,SC2148
22
report_results()
33
{
4-
type_FC=`type ${FC}`
5-
fully_qualified_FC="/${type_FC#*/}"
4+
fully_qualified_FC="$(type -P "${FC}")"
65
if [[ ${fully_qualified_FC} != *gfortran* ]]; then
76
emergency "report_results.sh: non-gfortran compiler: \${fully_qualified_FC}=${fully_qualified_FC}"
87
fi
98
# Set path_to_FC fully-qualified gfortran location
10-
compiler_install_root="${fully_qualified_FC%%bin/gfortran*}"
9+
compiler_install_root="${fully_qualified_FC%bin/gfortran*}"
1110

12-
type_MPIFC=`type ${MPIFC}`
13-
fully_qualified_MPIFC="/${type_MPIFC#*/}"
14-
mpi_install_root="${fully_qualified_MPIFC%%bin/mpif90*}"
11+
fully_qualified_MPIFC="$(type -P "${MPIFC}")"
12+
mpi_install_root="${fully_qualified_MPIFC%bin/mpif90*}"
1513

16-
type_CMAKE=`type ${CMAKE}`
17-
fully_qualified_CMAKE="/${type_CMAKE#*/}"
18-
cmake_install_path="${fully_qualified_CMAKE%%/cmake*}"
14+
fully_qualified_CMAKE="$(type -P "${CMAKE}")"
15+
cmake_install_path="${fully_qualified_CMAKE%/cmake*}"
1916

2017
# Report installation success or failure and record locations for software stack:
2118
if [[ -x "${install_path%/}/bin/caf" && -x "${install_path%/}/bin/cafrun" ]]; then

0 commit comments

Comments
 (0)