From 47f2e247e9c158be66e4791306ab4d9373fc1173 Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Tue, 29 Sep 2020 15:56:52 +0200 Subject: [PATCH] Harden build procedure --- CMakeLists.txt | 2 +- external/external_build.cmake | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2690baf..565a80e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -54,7 +54,7 @@ IF(YORICK_SUPPORT) ENDIF((EXISTS ${NETCDFCPP_INCLUDE_PATH}/netcdf AND ${NETCDFCPP_LIBRARY} MATCHES "netcdf_c\\+\\+4") OR (INTERNAL_NETCDF)) ENDIF(YORICK_SUPPORT) -find_program(CYTHON cython3 cython) +find_program(CYTHON NAMES cython3 cython) find_library(ZLIB_LIBRARY z) find_library(DL_LIBRARY dl) find_library(MATH_LIBRARY m) diff --git a/external/external_build.cmake b/external/external_build.cmake index bd4b18b..5459427 100644 --- a/external/external_build.cmake +++ b/external/external_build.cmake @@ -2,8 +2,8 @@ include(FindOpenMP) OPTION(ENABLE_OPENMP "Set to Yes if Healpix and/or you need openMP" OFF) -SET(FFTW_URL "http://www.fftw.org/fftw-3.3.3.tar.gz" CACHE URL "URL to download FFTW from") -SET(EIGEN_URL "https://gitlab.com/libeigen/eigen/-/archive/3.3.7/eigen-3.3.7.tar.bz2" CACHE URL "URL to download Eigen from") +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") SET(HDF5_URL "https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.8/hdf5-1.8.18/src/hdf5-1.8.18.tar.bz2" CACHE STRING "URL to download HDF5 from") SET(NETCDF_URL "ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-4.5.0.tar.gz" CACHE STRING "URL to download NetCDF from") @@ -291,13 +291,19 @@ IF(INTERNAL_GSL) set(GSL_LIBRARIES ${GSL_LIBRARY} ${GSLCBLAS_LIBRARY}) SET(cosmotool_DEPS ${cosmotool_DEPS} gsl) ELSE(INTERNAL_GSL) - find_path(GSL_INCLUDE_PATH NAMES gsl/gsl_blas.h) - find_library(GSL_LIBRARY gsl) - find_library(GSLCBLAS_LIBRARY gslcblas) + IF (NOT DEFINED GSL_LIBRARY OR NOT GSL_LIBRARY) + find_library(GSL_LIBRARY gsl) + ENDIF() + IF (NOT DEFINED GSL_INCLUDE_PATH OR NOT GSL_INCLUDE_PATH) + find_path(GSL_INCLUDE_PATH NAMES gsl/gsl_blas.h) + ENDIF() + IF (NOT DEFINED GSL_CBLAS_LIBRARY OR NOT GSL_CBLAS_LIBRARY) + find_library(GSLCBLAS_LIBRARY gslcblas) + ENDIF() set(GSL_LIBRARIES ${GSL_LIBRARY} ${GSLCBLAS_LIBRARY}) - ENDIF(INTERNAL_GSL) + mark_as_advanced(GSL_LIBRARY GSLCBLAS_LIBRARY GSL_INCLUDE_PATH)