From 5dcf00c2a951f73adb11e19b3ec72f01452f2ee9 Mon Sep 17 00:00:00 2001 From: Lars Bilke <lars.bilke@ufz.de> Date: Tue, 6 Jul 2021 10:05:31 +0200 Subject: [PATCH] Moved LIS dependency from Conan to ExternalProject. --- scripts/cmake/ConanSetup.cmake | 7 +------ scripts/cmake/DependenciesExternalProject.cmake | 17 +++++++++++++++++ scripts/cmake/Find.cmake | 5 ----- .../devguide/getting-started/prerequisites.md | 1 - web/data/versions.json | 3 ++- 5 files changed, 20 insertions(+), 13 deletions(-) diff --git a/scripts/cmake/ConanSetup.cmake b/scripts/cmake/ConanSetup.cmake index 36cf7667daa..23700f41b24 100644 --- a/scripts/cmake/ConanSetup.cmake +++ b/scripts/cmake/ConanSetup.cmake @@ -11,7 +11,7 @@ if(OGS_USE_CONAN_lower STREQUAL "auto" AND POETRY) else() find_program(CONAN_CMD conan) endif() -if(NOT CONAN_CMD AND (OGS_USE_LIS OR OGS_USE_NETCDF)) +if(NOT CONAN_CMD AND OGS_USE_NETCDF) message(WARNING "conan executable not found. Specify CMake option " "OGS_USE_CONAN=auto for automatic installation in the build directory " "OR install it system-wide (https://www.opengeosys.org/docs/devguide/" @@ -32,11 +32,6 @@ set(CONAN_SYSTEM_INCLUDES ON) include(${PROJECT_SOURCE_DIR}/scripts/cmake/conan/conan.cmake) -if(OGS_USE_LIS) - list(APPEND CONAN_OPTIONS lis:with_omp=True) - set(CONAN_REQUIRES ${CONAN_REQUIRES} lis/1.7.37@bilke/stable) -endif() - if(OGS_USE_NETCDF) set(CONAN_REQUIRES ${CONAN_REQUIRES} netcdf-cxx/4.3.1-1@bilke/testing) endif() diff --git a/scripts/cmake/DependenciesExternalProject.cmake b/scripts/cmake/DependenciesExternalProject.cmake index 032ea1b7324..3eb0f15f671 100644 --- a/scripts/cmake/DependenciesExternalProject.cmake +++ b/scripts/cmake/DependenciesExternalProject.cmake @@ -63,3 +63,20 @@ if(OGS_USE_PETSC) set_target_properties(petsc PROPERTIES IMPORTED_LOCATION ${PETSC_LIBRARIES}) target_compile_definitions(petsc INTERFACE USE_PETSC) endif() + +if(OGS_USE_LIS) + find_package(LIS) + if(NOT LIS_FOUND) + BuildExternalProject( + LIS + GIT_REPOSITORY https://github.com/anishida/lis.git + GIT_TAG ${ogs.minimum_version.lis} + CONFIGURE_COMMAND ./configure --enable-omp --prefix=<INSTALL_DIR> + BUILD_IN_SOURCE ON + BUILD_COMMAND make -j + INSTALL_COMMAND make -j install + ) + set(ENV{LIS_ROOT_DIR} ${PROJECT_BINARY_DIR}/_ext/LIS) + find_package(LIS REQUIRED) + endif() +endif() diff --git a/scripts/cmake/Find.cmake b/scripts/cmake/Find.cmake index 25387f83a50..fdf557b24b0 100644 --- a/scripts/cmake/Find.cmake +++ b/scripts/cmake/Find.cmake @@ -104,11 +104,6 @@ find_package(LAPACK QUIET) # geotiff ## find_package(GEOTIFF) -# lis ## -if(OGS_USE_LIS) - find_package(LIS REQUIRED) -endif() - if(OGS_USE_MKL) find_package(MKL REQUIRED) endif() diff --git a/web/content/docs/devguide/getting-started/prerequisites.md b/web/content/docs/devguide/getting-started/prerequisites.md index 323cc6c2785..e40357f66fe 100644 --- a/web/content/docs/devguide/getting-started/prerequisites.md +++ b/web/content/docs/devguide/getting-started/prerequisites.md @@ -313,7 +313,6 @@ See Linux-tab! You only need Conan if you intend to build with one of the following settings **and** do not want to install their dependencies manually: -- `OGS_USE_LIS` - `OGS_USE_NETCDF` – NetCDF IO, requires netcdf-cxx4 Install Conan (>= {{< dataFile "versions.minimum_version.conan" >}}) with Python's pip: diff --git a/web/data/versions.json b/web/data/versions.json index 1ffdf73dd41..31f7999fef6 100644 --- a/web/data/versions.json +++ b/web/data/versions.json @@ -22,7 +22,8 @@ "snakemake": "5.27.4", "hdf5": "1.10.5", "libxml2": "2.9.12", - "tfel-rliv": "3.4" + "tfel-rliv": "3.4", + "lis": "1.7.37" }, "tested_version": { "ubuntu": "20.04", -- GitLab