Skip to content

Commit 5f3d7b1

Browse files
author
Damian Rouson
committed
fix #679: add mpich configure args with GCC >= 10
1 parent 1a84435 commit 5f3d7b1

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

prerequisites/build-functions/build_and_install.sh

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,20 @@ build_and_install()
2525

2626
if [[ "${package_to_build}" != "gcc" ]]; then
2727

28-
if [[ "${package_to_build}" == "mpich" && "${version_to_build}" == "3.2" ]]; then
29-
info "Patching MPICH 3.2 on Mac OS due to segfault bug (see http://lists.mpich.org/pipermail/discuss/2016-May/004764.html)."
30-
sed 's/} MPID_Request ATTRIBUTE((__aligned__(32)));/} ATTRIBUTE((__aligned__(32))) MPID_Request;/g' \
31-
"${download_path}/${package_source_directory}/src/include/mpiimpl.h" > "${download_path}/${package_source_directory}/src/include/mpiimpl.h.patched"
32-
cp "${download_path}/${package_source_directory}/src/include/mpiimpl.h.patched" "${download_path}/${package_source_directory}/src/include/mpiimpl.h"
28+
if [[ "${package_to_build}" == "mpich" ]]; then
29+
if [[ "${version_to_build}" == "3.2" ]]; then
30+
info "Patching MPICH 3.2 on Mac OS due to segfault bug (see http://lists.mpich.org/pipermail/discuss/2016-May/004764.html)."
31+
sed 's/} MPID_Request ATTRIBUTE((__aligned__(32)));/} ATTRIBUTE((__aligned__(32))) MPID_Request;/g' \
32+
"${download_path}/${package_source_directory}/src/include/mpiimpl.h" > "${download_path}/${package_source_directory}/src/include/mpiimpl.h.patched"
33+
cp "${download_path}/${package_source_directory}/src/include/mpiimpl.h.patched" "${download_path}/${package_source_directory}/src/include/mpiimpl.h"
34+
fi
35+
36+
FC_version=$($FC --version)
37+
text_before_dot="${FC_version%%.*}" # grab text before first dot
38+
major_version="${text_before_dot##* }" # grab text after final space
39+
if (( ${major_version} >= 10 )); then
40+
export FFLAGS="-w -fallow-argument-mismatch"
41+
fi
3342
fi
3443

3544
if [[ "${package_to_build}" == "cmake" && $(uname) == "Linux" ]]; then
@@ -48,8 +57,8 @@ build_and_install()
4857
else # build from source
4958

5059
info "Configuring ${package_to_build} ${version_to_build} with the following command:"
51-
info "FC=\"${FC:-'gfortran'}\" CC=\"${CC:-'gcc'}\" CXX=\"${CXX:-'g++'}\" \"${download_path}/${package_source_directory}\"/configure --prefix=\"${install_path}\""
52-
FC="${FC:-'gfortran'}" CC="${CC:-'gcc'}" CXX="${CXX:-'g++'}" "${download_path}/${package_source_directory}"/configure --prefix="${install_path}"
60+
info "FFLAGS=${FFLAGS:-} FC=\"${FC:-'gfortran'}\" CC=\"${CC:-'gcc'}\" CXX=\"${CXX:-'g++'}\" \"${download_path}/${package_source_directory}\"/configure --prefix=\"${install_path}\""
61+
FFLAGS=${FFLAGS:-} FC="${FC:-'gfortran'}" CC="${CC:-'gcc'}" CXX="${CXX:-'g++'}" "${download_path}/${package_source_directory}"/configure --prefix="${install_path}"
5362
info "Building with the following command:"
5463
info "FC=\"${FC:-'gfortran'}\" CC=\"${CC:-'gcc'}\" CXX=\"${CXX:-'g++'}\" make -j\"${num_threads}\""
5564
FC="${FC:-'gfortran'}" CC="${CC:-'gcc'}" CXX="${CXX:-'g++'}" make "-j${num_threads}"

0 commit comments

Comments
 (0)