Skip to content
Snippets Groups Projects
Commit c5ec9292 authored by Lars Bilke's avatar Lars Bilke Committed by Dmitri Naumov
Browse files

[cmake] Added option OGS_PETSC_CONFIG_OPTIONS.

Can be used to pass petsc config options such as --download-hypre etc.
parent 2e39341d
No related branches found
No related tags found
No related merge requests found
...@@ -53,6 +53,9 @@ endif() ...@@ -53,6 +53,9 @@ endif()
if(OGS_USE_PETSC) if(OGS_USE_PETSC)
set(OGS_USE_MPI ON CACHE BOOL "Use MPI" FORCE) set(OGS_USE_MPI ON CACHE BOOL "Use MPI" FORCE)
endif() endif()
set(OGS_PETSC_CONFIG_OPTIONS "" CACHE STRING
"Additional PETSc configuration options."
)
option(OGS_USE_CVODE "Use the Sundials CVODE module?" OFF) option(OGS_USE_CVODE "Use the Sundials CVODE module?" OFF)
option(OGS_BUILD_UTILS "Should the utilities programs be built?" ON) option(OGS_BUILD_UTILS "Should the utilities programs be built?" ON)
option(OGS_BUILD_TESTING "Should the tests be built?" ON) option(OGS_BUILD_TESTING "Should the tests be built?" ON)
......
...@@ -24,9 +24,14 @@ if(OGS_USE_PETSC) ...@@ -24,9 +24,14 @@ if(OGS_USE_PETSC)
set(PETSC_EXECUTABLE_RUNS YES) set(PETSC_EXECUTABLE_RUNS YES)
endif() 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) if(NOT PETSC_FOUND)
set(_configure_opts "") 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}) if(ENV{CC})
list(APPEND _configure_opts --with-cc=$ENV{CC}) list(APPEND _configure_opts --with-cc=$ENV{CC})
endif() endif()
...@@ -39,9 +44,9 @@ if(OGS_USE_PETSC) ...@@ -39,9 +44,9 @@ if(OGS_USE_PETSC)
GIT_REPOSITORY https://gitlab.com/petsc/petsc.git GIT_REPOSITORY https://gitlab.com/petsc/petsc.git
GIT_TAG v${ogs.minimum_version.petsc} GIT_TAG v${ogs.minimum_version.petsc}
CONFIGURE_COMMAND CONFIGURE_COMMAND
./configure --with-fc=0 --download-f2cblaslapack=1 ./configure --download-f2cblaslapack=1 --prefix=<INSTALL_DIR>
--prefix=<INSTALL_DIR> --with-debugging=$<CONFIG:Debug> --with-debugging=$<CONFIG:Debug> ${_configure_opts}
${_configure_opts} ${OGS_PETSC_CONFIG_OPTIONS}
BUILD_IN_SOURCE ON BUILD_IN_SOURCE ON
BUILD_COMMAND make -j all BUILD_COMMAND make -j all
INSTALL_COMMAND make -j install INSTALL_COMMAND make -j install
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment