Skip to content
Snippets Groups Projects
Commit abc6d2d5 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

add support for latest dev version of petsc (sigh)

parent 96992783
No related branches found
No related tags found
No related merge requests found
...@@ -941,6 +941,16 @@ if(HAVE_SOLVER) ...@@ -941,6 +941,16 @@ if(HAVE_SOLVER)
# find includes by parsing the petscvariables file # find includes by parsing the petscvariables file
file(STRINGS ${ENV_PETSC_DIR}/${ENV_PETSC_ARCH}/conf/petscvariables file(STRINGS ${ENV_PETSC_DIR}/${ENV_PETSC_ARCH}/conf/petscvariables
PETSC_VARIABLES NEWLINE_CONSUME) PETSC_VARIABLES NEWLINE_CONSUME)
endif(EXISTS ${ENV_PETSC_DIR}/${ENV_PETSC_ARCH}/conf/petscvariables)
if(EXISTS ${ENV_PETSC_DIR}/${ENV_PETSC_ARCH}/lib/petsc-conf/petscvariables)
# old-style PETSc installations (using PETSC_DIR and PETSC_ARCH)
message(STATUS "Using PETSc dir: ${ENV_PETSC_DIR}")
message(STATUS "Using PETSc arch: ${ENV_PETSC_ARCH}")
# find includes by parsing the petscvariables file
file(STRINGS ${ENV_PETSC_DIR}/${ENV_PETSC_ARCH}/lib/petsc-conf/petscvariables
PETSC_VARIABLES NEWLINE_CONSUME)
endif(EXISTS ${ENV_PETSC_DIR}/${ENV_PETSC_ARCH}/lib/petsc-conf/petscvariables)
if(PETSC_VARIABLES)
# try to find PETSC_CC_INCLUDES for PETSc >= 3.4 # try to find PETSC_CC_INCLUDES for PETSc >= 3.4
string(REGEX MATCH "PETSC_CC_INCLUDES = [^\n\r]*" PETSC_PACKAGES_INCLUDES string(REGEX MATCH "PETSC_CC_INCLUDES = [^\n\r]*" PETSC_PACKAGES_INCLUDES
${PETSC_VARIABLES}) ${PETSC_VARIABLES})
...@@ -1031,7 +1041,7 @@ if(HAVE_SOLVER) ...@@ -1031,7 +1041,7 @@ if(HAVE_SOLVER)
string(STRIP ${LLIBS} LLIBS) string(STRIP ${LLIBS} LLIBS)
list(APPEND EXTERNAL_LIBRARIES "${LLIBS}") list(APPEND EXTERNAL_LIBRARIES "${LLIBS}")
endif(LLIBS) endif(LLIBS)
else(EXISTS ${ENV_PETSC_DIR}/${ENV_PETSC_ARCH}/conf/petscvariables) else(PETSC_VARIABLES)
# new-style PETSc installations (in standard system directories) # new-style PETSc installations (in standard system directories)
find_library(PETSC_LIBS petsc) find_library(PETSC_LIBS petsc)
find_path(PETSC_INC "petsc.h" PATH_SUFFIXES include/petsc) find_path(PETSC_INC "petsc.h" PATH_SUFFIXES include/petsc)
...@@ -1049,7 +1059,7 @@ if(HAVE_SOLVER) ...@@ -1049,7 +1059,7 @@ if(HAVE_SOLVER)
list(APPEND EXTERNAL_LIBRARIES ${PETSC_LIBS}) list(APPEND EXTERNAL_LIBRARIES ${PETSC_LIBS})
list(APPEND EXTERNAL_INCLUDES ${PETSC_INC}) list(APPEND EXTERNAL_INCLUDES ${PETSC_INC})
endif(PETSC_LIBS AND PETSC_INC) endif(PETSC_LIBS AND PETSC_INC)
endif(EXISTS ${ENV_PETSC_DIR}/${ENV_PETSC_ARCH}/conf/petscvariables) endif(PETSC_VARIABLES)
endif(ENABLE_PETSC) endif(ENABLE_PETSC)
endif(HAVE_SOLVER) endif(HAVE_SOLVER)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment