@@ -21,7 +21,7 @@ build_and_install()
21
21
fi
22
22
mkdir -p " ${build_path} "
23
23
info " pushd ${build_path} "
24
- pushd " ${build_path} "
24
+ pushd " ${build_path} " || emergency " build_and_install.sh: pushd failed "
25
25
26
26
if [[ " ${package_to_build} " != " gcc" ]]; then
27
27
@@ -46,7 +46,7 @@ build_and_install()
46
46
export cmake_binary_installer=" ${download_path} /cmake-${version_to_build} -Linux-x86_64.sh"
47
47
${SUDO:- } mkdir -p " $install_path "
48
48
chmod u+x " ${cmake_binary_installer} "
49
- if [[ ! -z " ${SUDO:- } " ]]; then
49
+ if [[ -n " ${SUDO:- } " ]]; then
50
50
info " You do not have write permissions to the installation path ${install_path} "
51
51
info " If you have administrative privileges, enter your password to install ${package_to_build} "
52
52
fi
@@ -63,7 +63,7 @@ build_and_install()
63
63
info " FC=\" ${FC:- ' gfortran' } \" CC=\" ${CC:- ' gcc' } \" CXX=\" ${CXX:- ' g++' } \" make -j\" ${num_threads} \" "
64
64
FC=" ${FC:- ' gfortran' } " CC=" ${CC:- ' gcc' } " CXX=" ${CXX:- ' g++' } " make " -j${num_threads} "
65
65
info " Installing ${package_to_build} in ${install_path} "
66
- if [[ ! -z " ${SUDO:- } " ]]; then
66
+ if [[ -n " ${SUDO:- } " ]]; then
67
67
info " You do not have write permissions to the installation path ${install_path} "
68
68
info " If you have administrative privileges, enter your password to install ${package_to_build} "
69
69
fi
@@ -75,7 +75,7 @@ build_and_install()
75
75
elif [[ ${package_to_build} == " gcc" ]]; then
76
76
77
77
info " pushd ${download_path} /${package_source_directory} "
78
- pushd " ${download_path} /${package_source_directory} "
78
+ pushd " ${download_path} /${package_source_directory} " || emergency " build_and_install.sh: pushd failed "
79
79
80
80
# Patch gfortran if necessary
81
81
export patches_dir=" ${OPENCOARRAYS_SRC_DIR} /prerequisites/build-functions/patches/${package_to_build} /${version_to_build} "
@@ -96,13 +96,13 @@ build_and_install()
96
96
" ${PWD} " /contrib/download_prerequisites
97
97
98
98
info " popd"
99
- popd
99
+ popd || emergency " build_and_install.sh: popd failed "
100
100
info " Configuring gcc/g++/gfortran builds with the following command:"
101
101
info " ${download_path} /${package_source_directory} /configure --prefix=${install_path} --enable-languages=c,c++,fortran,lto --disable-multilib --disable-werror ${bootstrap_configure} "
102
- " ${download_path} /${package_source_directory} /configure" --prefix=" ${install_path} " --enable-languages=c,c++,fortran,lto --disable-multilib --disable-werror ${bootstrap_configure}
102
+ " ${download_path} /${package_source_directory} /configure" --prefix=" ${install_path} " --enable-languages=c,c++,fortran,lto --disable-multilib --disable-werror " ${bootstrap_configure} "
103
103
info " Building with the following command: 'make -j${num_threads} ${bootstrap_build} '"
104
- make " -j${num_threads} " ${bootstrap_build}
105
- if [[ ! -z " ${SUDO:- } " ]]; then
104
+ make " -j${num_threads} " " ${bootstrap_build} "
105
+ if [[ -n " ${SUDO:- } " ]]; then
106
106
info " You do not have write permissions to the installation path ${install_path} "
107
107
info " If you have administrative privileges, enter your password to install ${package_to_build} "
108
108
fi
@@ -115,5 +115,5 @@ build_and_install()
115
115
116
116
117
117
info " popd"
118
- popd
118
+ popd || emergency " build_and_install.sh: popd failed "
119
119
}
0 commit comments