@@ -32,21 +32,34 @@ build_and_install()
3232 cp " ${download_path} /${package_source_directory} /src/include/mpiimpl.h.patched" " ${download_path} /${package_source_directory} /src/include/mpiimpl.h"
3333 fi
3434
35- info " Configuring ${package_to_build} ${version_to_build} with the following command:"
36- info " FC=\" ${FC:- ' gfortran' } \" CC=\" ${CC:- ' gcc' } \" CXX=\" ${CXX:- ' g++' } \" \" ${download_path} /${package_source_directory} \" /configure --prefix=\" ${install_path} \" "
37- FC=" ${FC:- ' gfortran' } " CC=" ${CC:- ' gcc' } " CXX=" ${CXX:- ' g++' } " " ${download_path} /${package_source_directory} " /configure --prefix=" ${install_path} "
38- info " Building with the following command:"
39- info " FC=\" ${FC:- ' gfortran' } \" CC=\" ${CC:- ' gcc' } \" CXX=\" ${CXX:- ' g++' } \" make -j\" ${num_threads} \" "
40- FC=" ${FC:- ' gfortran' } " CC=" ${CC:- ' gcc' } " CXX=" ${CXX:- ' g++' } " make " -j${num_threads} "
41- info " Installing ${package_to_build} in ${install_path} "
42- if [[ ! -z " ${SUDO:- } " ]]; then
43- info " You do not have write permissions to the installation path ${install_path} "
44- info " If you have administrative privileges, enter your password to install ${package_to_build} "
35+ if [[ " ${package_to_build} " == " cmake" && $( uname) == " Linux" ]]; then
36+
37+ export cmake_binary_installer=" ${download_path} /cmake-${version_to_build} -Linux-x86_64.sh"
38+ ${SUDO:- } mkdir -p " $install_path "
39+ chmod u+x " ${cmake_binary_installer} "
40+ info " Installing Cmake with the following command: "
41+ info " \" ${cmake_binary_installer} \" --prefix=\" $install_path \" --exclude-subdir"
42+ " ${cmake_binary_installer} " --prefix=" $install_path " --exclude-subdir
43+
44+ else # build from source
45+
46+ info " Configuring ${package_to_build} ${version_to_build} with the following command:"
47+ info " FC=\" ${FC:- ' gfortran' } \" CC=\" ${CC:- ' gcc' } \" CXX=\" ${CXX:- ' g++' } \" \" ${download_path} /${package_source_directory} \" /configure --prefix=\" ${install_path} \" "
48+ FC=" ${FC:- ' gfortran' } " CC=" ${CC:- ' gcc' } " CXX=" ${CXX:- ' g++' } " " ${download_path} /${package_source_directory} " /configure --prefix=" ${install_path} "
49+ info " Building with the following command:"
50+ info " FC=\" ${FC:- ' gfortran' } \" CC=\" ${CC:- ' gcc' } \" CXX=\" ${CXX:- ' g++' } \" make -j\" ${num_threads} \" "
51+ FC=" ${FC:- ' gfortran' } " CC=" ${CC:- ' gcc' } " CXX=" ${CXX:- ' g++' } " make " -j${num_threads} "
52+ info " Installing ${package_to_build} in ${install_path} "
53+ if [[ ! -z " ${SUDO:- } " ]]; then
54+ info " You do not have write permissions to the installation path ${install_path} "
55+ info " If you have administrative privileges, enter your password to install ${package_to_build} "
56+ fi
57+ info " Installing with the following command: ${SUDO:- } make install"
58+ ${SUDO:- } make install
59+
4560 fi
46- info " Installing with the following command: ${SUDO:- } make install"
47- ${SUDO:- } make install
4861
49- else # ${package_to_build} == "gcc"
62+ elif [[ ${package_to_build} == " gcc" ]] ; then
5063
5164 info " pushd ${download_path} /${package_source_directory} "
5265 pushd " ${download_path} /${package_source_directory} "
@@ -83,7 +96,10 @@ build_and_install()
8396 info " Installing with the following command: ${SUDO:- } make install"
8497 ${SUDO:- } make install
8598
86- fi # end if [[ "${package_to_build}" != "gcc" ]]; then
99+ else
100+ emergency " This branch should never be reached."
101+ fi # end if [[ "${package_to_build}" != "gcc" && "${package_to_build}" != "cmake" ]]; then
102+
87103
88104 info " popd"
89105 popd
0 commit comments