diff --git a/CMakeLists.txt b/CMakeLists.txt index 11d4cb1531dd0a8ba174cda3990c633d41926806..f254ad85d301c82e07283cf869da4e6cd7ac7b6e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,6 +53,9 @@ endif() if(OGS_USE_PETSC) set(OGS_USE_MPI ON CACHE BOOL "Use MPI" FORCE) endif() +set(OGS_PETSC_CONFIG_OPTIONS "" CACHE STRING + "Additional PETSc configuration options." +) option(OGS_USE_CVODE "Use the Sundials CVODE module?" OFF) option(OGS_BUILD_UTILS "Should the utilities programs be built?" ON) option(OGS_BUILD_TESTING "Should the tests be built?" ON) diff --git a/scripts/cmake/DependenciesExternalProject.cmake b/scripts/cmake/DependenciesExternalProject.cmake index 28e597dcfaa2d8f2718a9e9fad736ce0341ed7b0..a9edd533a348fecb97860964b9bf19a74e058161 100644 --- a/scripts/cmake/DependenciesExternalProject.cmake +++ b/scripts/cmake/DependenciesExternalProject.cmake @@ -24,9 +24,14 @@ if(OGS_USE_PETSC) set(PETSC_EXECUTABLE_RUNS YES) endif() - find_package(PETSc ${ogs.minimum_version.petsc}) + if(NOT OGS_PETSC_CONFIG_OPTIONS) + find_package(PETSc ${ogs.minimum_version.petsc}) + endif() if(NOT PETSC_FOUND) set(_configure_opts "") + if(NOT "--download-fc=1" IN_LIST OGS_PETSC_CONFIG_OPTIONS) + list(APPEND _configure_opts --with-fc=0) + endif() if(ENV{CC}) list(APPEND _configure_opts --with-cc=$ENV{CC}) endif() @@ -39,9 +44,9 @@ if(OGS_USE_PETSC) GIT_REPOSITORY https://gitlab.com/petsc/petsc.git GIT_TAG v${ogs.minimum_version.petsc} CONFIGURE_COMMAND - ./configure --with-fc=0 --download-f2cblaslapack=1 - --prefix=<INSTALL_DIR> --with-debugging=$<CONFIG:Debug> - ${_configure_opts} + ./configure --download-f2cblaslapack=1 --prefix=<INSTALL_DIR> + --with-debugging=$<CONFIG:Debug> ${_configure_opts} + ${OGS_PETSC_CONFIG_OPTIONS} BUILD_IN_SOURCE ON BUILD_COMMAND make -j all INSTALL_COMMAND make -j install