@@ -23,7 +23,7 @@ build_and_install()
2323 info " pushd ${build_path} "
2424 pushd " ${build_path} "
2525
26- if [[ " ${package_to_build} " != " gcc" && " ${package_to_build} " != " cmake " ]]; then
26+ if [[ " ${package_to_build} " != " gcc" ]]; then
2727
2828 if [[ " ${package_to_build} " == " mpich" && " ${version_to_build} " == " 3.2" ]]; then
2929 info " Patching MPICH 3.2 on Mac OS due to segfault bug (see http://lists.mpich.org/pipermail/discuss/2016-May/004764.html)."
@@ -32,23 +32,32 @@ 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} "
45- fi
46- info " Installing with the following command: ${SUDO:- } make install"
47- ${SUDO:- } make install
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
4859
49- elif [[ ${package_to_build} == " cmake" ]]; then
50-
51- emergency " Ready to install cmake binary in ${PWD} "
60+ fi
5261
5362 elif [[ ${package_to_build} == " gcc" ]]; then
5463
0 commit comments