Skip to content

Commit

Permalink
compatible with PETSc 3.21.x
Browse files Browse the repository at this point in the history
  • Loading branch information
MarDiehl committed Mar 31, 2024
1 parent bc6a37b commit 9375275
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ endif()
project(Prerequisites LANGUAGES)
set(ENV{PKG_CONFIG_PATH} "$ENV{PETSC_DIR}/$ENV{PETSC_ARCH}/lib/pkgconfig:$ENV{PKG_CONFIG_PATH}")
pkg_check_modules(PETSC_MIN REQUIRED PETSc>=3.12.0 QUIET) #CMake does not support version range
pkg_check_modules(PETSC REQUIRED PETSc<3.21.0)
pkg_check_modules(PETSC REQUIRED PETSc<3.22.0)

pkg_get_variable(CMAKE_Fortran_COMPILER PETSc fcompiler)
pkg_get_variable(CMAKE_C_COMPILER PETSc ccompiler)
Expand Down
14 changes: 9 additions & 5 deletions src/CLI.f90
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
!> @brief Parse command line interface for PETSc-based solvers
!--------------------------------------------------------------------------------------------------
#define PETSC_MINOR_MIN 12
#define PETSC_MINOR_MAX 20
#define PETSC_MINOR_MAX 21

module CLI
use, intrinsic :: ISO_fortran_env
Expand Down Expand Up @@ -46,11 +46,11 @@ subroutine CLI_init()
-- UNSUPPORTED PETSc VERSION --- UNSUPPORTED PETSc VERSION --- UNSUPPORTED PETSc VERSION ---
#endif
#if PETSC_VERSION_MAJOR==3 && PETSC_VERSION_MINOR==18
character(len=*), parameter :: PETSc_DOI = '10.2172/1893326'
#define PETSC_DOI '10.2172/1893326'
#elif PETSC_VERSION_MAJOR==3 && PETSC_VERSION_MINOR==19
character(len=*), parameter :: PETSc_DOI = '10.2172/1968587'
#define PETSC_DOI '10.2172/1968587'
#elif PETSC_VERSION_MAJOR==3 && PETSC_VERSION_MINOR==20
character(len=*), parameter :: PETSc_DOI = '10.2172/2205494'
#define PETSC_DOI '10.2172/2205494'
#endif
character(len=:), allocatable :: &
commandLine, & !< command line call as string
Expand All @@ -65,7 +65,9 @@ subroutine CLI_init()
i, s
integer, dimension(8) :: &
dateAndTime

#ifdef PETSC_DOI
character(len=*), parameter :: PETSc_DOI = PETSC_DOI
#endif

workingDirArg = getCWD()

Expand Down Expand Up @@ -97,7 +99,9 @@ subroutine CLI_init()
print'(1x,a)', 'https://doi.org/10.1016/j.commatsci.2018.04.030'//IO_EOL
#if PETSC_VERSION_MAJOR==3 && PETSC_VERSION_MINOR>=18
print'(1x,a,i0,a,i0)', 'S. Balay et al., PETSc/TAO User Manual Revision ',PETSC_VERSION_MAJOR,'.',PETSC_VERSION_MINOR
#ifdef PETSC_DOI
print'(1x,a)', 'https://doi.org/'//PETSc_DOI
#endif
#endif
print'(/,1x,a)', 'Version: '//DAMASKVERSION

Expand Down

0 comments on commit 9375275

Please sign in to comment.