Skip to content
Snippets Groups Projects
Commit 9f4bedba authored by Dave Moxey's avatar Dave Moxey
Browse files

Merge branch 'feature/new_PETSc_v3.19' into 'master'

Enable using new PETSc version with Nektar master

See merge request !1618
parents 6cbbedea cc8fe791
No related branches found
No related tags found
No related merge requests found
......@@ -230,6 +230,8 @@ v5.4.0
- Remove useless ReadExpressions and SubstituteExpressions function in sessionReader (!1608)
- Corrected workspace size in triangle BwdTrans (!1610)
- Reactivate Reactivate Movement_fixed_3D_stacked_cylinders_curved_hdf5_par test except on ARM MacOS (!1536)
- Updated the PETSc version to v3.19.3 for THIRDPARTY_USE_PETSC, enabled local PETSc version usage (!1618)
- Rename communicator in LinearAlgebra (!1612)
- Add IProductWRTDerivBase operator for 3DH1D problems (!1483)
- Full support of mixed-order elements in DG (!1606)
......
......@@ -12,7 +12,7 @@ OPTION(NEKTAR_USE_PETSC
IF (NEKTAR_USE_PETSC)
SET(PETSC_FIND_QUIETLY ON)
FIND_PACKAGE(PkgConfig REQUIRED)
PKG_SEARCH_MODULE(PETSC PETSc IMPORTED_TARGET)
PKG_SEARCH_MODULE(PETSC PETSc IMPORTED_TARGET PATHS ${PKG_CONFIG_PATH})
IF (PETSC_FOUND)
# Prefer to use absolute paths to avoid separate link directories on
......@@ -35,7 +35,7 @@ IF (NEKTAR_USE_PETSC)
IF (THIRDPARTY_BUILD_PETSC)
INCLUDE(ExternalProject)
FIND_PACKAGE(PythonInterp 2 REQUIRED)
FIND_PACKAGE(Python3 REQUIRED)
UNSET(PATCH CACHE)
FIND_PROGRAM(PATCH patch)
......@@ -72,12 +72,14 @@ IF (NEKTAR_USE_PETSC)
LIST(GET BLAS_LAPACK 0 LAPACK)
LIST(GET BLAS_LAPACK 1 BLAS)
GET_FILENAME_COMPONENT(BLAS_LAPACK_DIR ${BLAS} PATH)
IF( NEKTAR_USE_MKL OR NEKTAR_USE_SYSTEM_BLAS_LAPACK)
IF(NEKTAR_USE_SYSTEM_BLAS_LAPACK)
SET(PETSC_MUMPS ${PETSC_MUMPS} --with-blas-lib=${BLAS}
--with-lapack-lib=${LAPACK})
IF(THIRDPARTY_BUILD_BLAS_LAPACK)
SET(PETSC_DEPS ${PETSC_DEPS} lapack-3.7.1)
ENDIF()
ELSEIF(NEKTAR_USE_MKL)
SET(PETSC_MUMPS ${PETSC_MUMPS} --with-blaslapack-dir=${MKLROOT})
ELSE()
MESSAGE(STATUS "No suitable blas/lapack found, downloading")
SET(PETSC_MUMPS ${PETSC_MUMPS} --download-fblaslapack)
......@@ -93,17 +95,17 @@ IF (NEKTAR_USE_PETSC)
ENDIF()
EXTERNALPROJECT_ADD(
petsc-3.11.4
petsc-3.19.3
DEPENDS ${PETSC_DEPS}
PREFIX ${TPSRC}
STAMP_DIR ${TPBUILD}/stamp
DOWNLOAD_DIR ${TPSRC}
SOURCE_DIR ${TPBUILD}/petsc-3.11.4
TMP_DIR ${TPBUILD}/petsc-3.11.4-tmp
SOURCE_DIR ${TPBUILD}/petsc-3.19.3
TMP_DIR ${TPBUILD}/petsc-3.19.3-tmp
INSTALL_DIR ${TPDIST}
BINARY_DIR ${TPBUILD}/petsc-3.11.4
URL https://www.nektar.info/thirdparty/petsc-lite-3.11.4.tar.gz
URL_MD5 "33da4b6a430d5d9e13b19871d707af0f"
BINARY_DIR ${TPBUILD}/petsc-3.19.3
URL https://www.nektar.info/thirdparty/petsc-3.19.3.tar.gz
URL_MD5 "b493f0c19c067994ce7e9b5f4d13216c"
CONFIGURE_COMMAND
OMPI_FC=${CMAKE_Fortran_COMPILER}
OMPI_CC=${CMAKE_C_COMPILER}
......@@ -122,12 +124,18 @@ IF (NEKTAR_USE_PETSC)
--with-ssl=0
--prefix=${TPDIST}
--with-petsc-arch=c-opt
--download-hypre
--download-ml
--with-debugging=0
--with-pkg-config
${PETSC_MUMPS}
${PETSC_NO_MPI}
BUILD_COMMAND $(MAKE)
TEST_COMMAND $(MAKE)
PETSC_DIR=${TPDIST} PETSC_ARCH=c-opt test)
PETSC_DIR=${TPDIST} PETSC_ARCH= check)
MESSAGE("TPDist: ${TPDIST}")
MESSAGE("TPBuild: ${TPBUILD}")
THIRDPARTY_LIBRARY(PETSC_LIBRARIES SHARED petsc
DESCRIPTION "PETSc library")
SET(PETSC_INCLUDE_DIRS ${TPDIST}/include CACHE FILEPATH
......@@ -136,10 +144,10 @@ IF (NEKTAR_USE_PETSC)
SET(PETSC_CONFIG_INCLUDE_DIR ${TPINC})
ELSE (THIRDPARTY_BUILD_PETSC)
SET(PETSC_CONFIG_INCLUDE_DIR ${PETSC_INCLUDE_DIRS})
ADD_CUSTOM_TARGET(petsc-3.11.4 ALL)
ADD_CUSTOM_TARGET(petsc-3.19.3 ALL)
ENDIF (THIRDPARTY_BUILD_PETSC)
ADD_DEPENDENCIES(thirdparty petsc-3.11.4)
ADD_DEPENDENCIES(thirdparty petsc-3.19.3)
ADD_DEFINITIONS(-DNEKTAR_USING_PETSC)
INCLUDE_DIRECTORIES(${PETSC_INCLUDE_DIRS})
......
......@@ -697,7 +697,21 @@ can be selected using the following options:
\item \inlsh{NEKTAR\_USE\_PETSC}
Build \nekpp with support for the PETSc package for solving linear systems.
Build \nekpp with support for the PETSc package for solving linear systems.
The user has the option to use either their own PETSc installations, or use
the packaged PETSc version 3.19.3. To use your own PETSc install, specify
the variables \inlsh{PETSC\_DIR} and \inlsh{PETSC\_ARCH} in your bash session
or \inlsh{.bashrc} before the \nekpp compilation step using the following commands:
\begin{lstlisting}[style=BashInputStyle]
export PETSC_DIR=/path/to/petsc
export PETSC_ARCH=name-of-petsc_arch
\end{lstlisting}
and then set the \inlsh{LD\_LIBRARY\_PATH} and \inlsh{PKG\_CONFIG\_PATH}
\begin{lstlisting}[style=BashInputStyle]
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PETSC_DIR/$PETSC_ARCH/lib/
export PKG_CONFIG_PATH=$PETSC_DIR/$PETSC_ARCH/lib/pkgconfig/:$PKG_CONFIG_PATH
\end{lstlisting}
\item \inlsh{NEKTAR\_USE\_PYTHON3} (Requires \inlsh{NEKTAR\_BUILD\_PYTHON})
......@@ -777,7 +791,7 @@ automatically built during the \nekpp build process. Below are the choices of X:
\item \inlsh{PETSC}
A package for the parallel solution of linear algebra systems.
A package for the parallel solution of linear algebra systems. If this is switched on, then a packaged PETSc version 3.19.3 will be installed within the \nekpp installation.
\item \inlsh{SCOTCH}
......
......@@ -460,7 +460,7 @@ ENDIF()
IF( NEKTAR_USE_PETSC )
TARGET_LINK_LIBRARIES(LibUtilities LINK_PRIVATE ${PETSC_LIBRARIES})
TARGET_LINK_LIBRARIES(LibUtilities LINK_PUBLIC ${CMAKE_DL_LIBS})
ADD_DEPENDENCIES(LibUtilities petsc-3.11.4)
ADD_DEPENDENCIES(LibUtilities petsc-3.19.3)
ENDIF( NEKTAR_USE_PETSC )
IF (NEKTAR_BUILD_PYTHON)
......
......@@ -132,7 +132,7 @@ ENDIF( NEKTAR_USE_MPI )
IF( NEKTAR_USE_PETSC )
TARGET_LINK_LIBRARIES(MultiRegions LINK_PRIVATE ${PETSC_LIBRARIES})
ADD_DEPENDENCIES(MultiRegions petsc-3.11.4)
ADD_DEPENDENCIES(MultiRegions petsc-3.19.3)
ENDIF( NEKTAR_USE_PETSC )
IF (NEKTAR_BUILD_PYTHON)
......
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