MAJOR=3.9
MINOR=6
VERSION=${MAJOR}.${MINOR}
-NAME=cmake-${VERSION}
+
+# We try to determine if we have a linux platform to use tarball install
+# instead of configure/make due to possible missing autotools on some
+# HPC clusters. We need to do this, because tarball install on MacOS or
+# other platforms is not maintainable by the candi authors.
+
+if [ -z "${PLATFORM_OSTYPE}" ]; then
+ cecho ${WARN} "WARNING: could not determine your Operating System Type (assuming linux)"
+ PLATFORM_OSTYPE=linux
+fi
+
+if [ ${PLATFORM_OSTYPE} == "linux" ]; then
+ # tarball install
+ NAME=cmake-${VERSION}-Linux-x86_64
+ PACKING=.tar.gz
+ CHECKSUM=3cd4a1e13d2f42f2ff5668b13d7fd23b
+ BUILDCHAIN=ignore
+
+else
+ # configure/make/install
+ NAME=cmake-${VERSION}
+ PACKING=.tar.gz
+ CHECKSUM=084b1c8b2efc1c1ba432dea37243c0ae
+
+ if builtin command -v cmake > /dev/null; then
+ # configure/make with cmake (older or newer version already installed)
+ BUILDCHAIN=cmake
+ else
+ # configure/make with autotools
+ BUILDCHAIN=autotools
+ fi
+fi
+
SOURCE=https://cmake.org/files/v${MAJOR}/
-PACKING=.tar.gz
-CHECKSUM=084b1c8b2efc1c1ba432dea37243c0ae
-BUILDCHAIN=cmake
+
+if [ ${BUILDCHAIN} == "ignore" ]; then
+ package_specific_install () {
+ cp -rf ${UNPACK_PATH}/${EXTRACTSTO} ${INSTALL_PATH}
+ INSTALL_PATH=${INSTALL_PATH}/${EXTRACTSTO}
+ }
+fi
package_specific_register () {
export PATH=${INSTALL_PATH}/bin:${PATH}
# Check if we hit cmake-3.10+ and deal.II v8.5.1 configure error (MPI / FindMPI)
# cf. https://github.com/dealii/dealii/issues/5510
-if [ ${DEAL_II_VERSION} = "v8.5.1" ]; then
+if [ ${DEAL_II_VERSION} == "v8.5.1" ]; then
# check for cmake version 3.10 and above
CMAKE_VER_MAJOR=$(cmake --version | perl -pe '($_)=/([0-9]+([.][0-9]+)+)/' | cut -d '.' -f1)
CMAKE_VER_MINOR=$(cmake --version | perl -pe '($_)=/([0-9]+([.][0-9]+)+)/' | cut -d '.' -f2)
# Check if we hit cmake-3.10+ and deal.II v8.5.1 configure error (MPI / FindMPI)
# cf. https://github.com/dealii/dealii/issues/5510
-if [ ${DEAL_II_VERSION} = "v8.5.1" ]; then
+if [ ${DEAL_II_VERSION} == "v8.5.1" ]; then
# check for cmake version 3.10 and above
CMAKE_VER_MAJOR=$(cmake --version | perl -pe '($_)=/([0-9]+([.][0-9]+)+)/' | cut -d '.' -f1)
CMAKE_VER_MINOR=$(cmake --version | perl -pe '($_)=/([0-9]+([.][0-9]+)+)/' | cut -d '.' -f2)