Cache downloads

This commit is contained in:
Guilhem Lavaux 2023-12-06 09:28:19 +01:00
parent d4b1742cbf
commit 4afc982dfc

View File

@ -2,6 +2,7 @@ include(FindOpenMP)
OPTION(ENABLE_OPENMP "Set to Yes if Healpix and/or you need openMP" OFF)
SET(SOURCE_PREFIX ${CMAKE_SOURCE_DIR})
SET(FFTW_URL "http://www.fftw.org/fftw-3.3.3.tar.gz" CACHE STRING "URL to download FFTW from")
SET(EIGEN_URL "https://gitlab.com/libeigen/eigen/-/archive/3.3.7/eigen-3.3.7.tar.bz2" CACHE STRING "URL to download Eigen from")
SET(GENGETOPT_URL "ftp://ftp.gnu.org/gnu/gengetopt/gengetopt-2.22.5.tar.gz" CACHE STRING "URL to download gengetopt from")
@ -12,6 +13,8 @@ SET(BOOST_URL "https://boostorg.jfrog.io/artifactory/main/release/1.82.0/source/
SET(GSL_URL "https://ftpmirror.gnu.org/gsl/gsl-2.7.tar.gz" CACHE STRING "URL to download GSL from ")
mark_as_advanced(FFTW_URL EIGEN_URL HDF5_URL NETCDF_URL BOOST_URL GSL_URL)
file(MAKE_DIRECTORY ${SOURCE_PREFIX}/downloads)
SET(all_deps)
MACRO(CHECK_CHANGE_STATE VAR)
@ -68,6 +71,7 @@ if (ENABLE_SHARP)
ExternalProject_Add(sharp
URL ${CMAKE_SOURCE_DIR}/external/libsharp-8d51946.tar.gz
PREFIX ${BUILD_PREFIX}/sharp-prefix
DOWNLOAD_DIR ${SOURCE_PREFIX}/downloads
BUILD_IN_SOURCE 1
CONFIGURE_COMMAND
cp -f ${CMAKE_SOURCE_DIR}/external/config.guess . &&
@ -91,6 +95,7 @@ if (INTERNAL_HDF5)
PREFIX ${BUILD_PREFIX}/hdf5-prefix
URL ${HDF5_URL}
URL_HASH MD5=30172c75e436d7f2180e274071a4ca97
DOWNLOAD_DIR ${SOURCE_PREFIX}/downloads
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX=${EXT_INSTALL}
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
@ -177,6 +182,7 @@ if (INTERNAL_NETCDF)
ExternalProject_Add(netcdf
DEPENDS ${hdf5_built}
PREFIX ${BUILD_PREFIX}/netcdf-prefix
DOWNLOAD_DIR ${SOURCE_PREFIX}/downloads
URL ${NETCDF_URL}
LIST_SEPARATOR |
CMAKE_ARGS
@ -244,6 +250,7 @@ if (INTERNAL_BOOST)
ExternalProject_Add(boost
URL ${BOOST_URL}
PREFIX ${BUILD_PREFIX}/boost-prefix
DOWNLOAD_DIR ${SOURCE_PREFIX}/downloads
URL_HASH MD5=f7050f554a65f6a42ece221eaeec1660
CONFIGURE_COMMAND
${BOOST_SOURCE_DIR}/bootstrap.sh --prefix=${CMAKE_BINARY_DIR}/ext_build/boost
@ -287,6 +294,7 @@ IF(INTERNAL_GSL)
ExternalProject_Add(gsl
URL ${GSL_URL}
PREFIX ${BUILD_PREFIX}/gsl-prefix
DOWNLOAD_DIR ${SOURCE_PREFIX}/downloads
CONFIGURE_COMMAND ${GSL_SOURCE_DIR}/configure
--prefix=${EXT_INSTALL} --disable-shared
--with-pic
@ -339,6 +347,7 @@ IF(INTERNAL_FFTW)
ExternalProject_Add(fftw
URL ${FFTW_URL}
PREFIX ${BUILD_PREFIX}/fftw-prefix
DOWNLOAD_DIR ${SOURCE_PREFIX}/downloads
CONFIGURE_COMMAND
${FFTW_SOURCE}/configure
--prefix=${EXT_INSTALL}
@ -368,6 +377,7 @@ IF (INTERNAL_EIGEN)
ExternalProject_Add(eigen
URL ${EIGEN_URL}
URL_HASH MD5=b9e98a200d2455f06db9c661c5610496
DOWNLOAD_DIR ${SOURCE_PREFIX}/downloads
PREFIX ${BUILD_PREFIX}/eigen-prefix
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXT_INSTALL}
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
@ -400,6 +410,7 @@ SET(cosmotool_DEPS ${cosmotool_DEPS} omptl)
SET(OMPTL_BUILD_DIR ${BUILD_PREFIX}/omptl-prefix/src/omptl)
ExternalProject_Add(omptl
PREFIX ${BUILD_PREFIX}/omptl-prefix
DOWNLOAD_DIR ${SOURCE_PREFIX}/downloads
URL ${CMAKE_SOURCE_DIR}/external/omptl-20120422.tar.bz2
CONFIGURE_COMMAND echo "No configure"
BUILD_COMMAND echo "No build"