Commit ac38fee2 authored by Kilian Lackhove's avatar Kilian Lackhove

fix PetSc blas/lapack dirs

parent 8f7a4d99
......@@ -229,7 +229,6 @@ INCLUDE (ThirdPartyBoost)
INCLUDE (ThirdPartyFFTW)
INCLUDE (ThirdPartyArpack)
INCLUDE (ThirdPartyMPI)
INCLUDE (ThirdPartyPETSc)
INCLUDE (ThirdPartyVTK)
INCLUDE (ThirdPartyQT4)
INCLUDE (ThirdPartySMV)
......@@ -303,6 +302,8 @@ ELSE( NEKTAR_USE_MEMORY_POOLS )
REMOVE_DEFINITIONS(-DNEKTAR_MEMORY_POOL_ENABLED)
ENDIF( NEKTAR_USE_MEMORY_POOLS )
INCLUDE (ThirdPartyPETSc)
SET(Boost_USE_STATIC_LIBS OFF)
IF( WIN32 )
# The auto-linking feature has problems with USE_STATIC_LIBS off, so we use
......
......@@ -62,6 +62,7 @@ ENDIF ( MKL_LAPACK_FOUND )
SET( MKL_BLAS_INCLUDE_FILE ${MKL_INCLUDE_DIR}/mkl_blas.h )
SET( MKL_LAPACK_INCLUDE_FILE ${MKL_INCLUDE_DIR}/mkl_lapack.h )
GET_FILENAME_COMPONENT(MKL_LIB_DIR ${MKL_CORE} DIRECTORY)
IF (MKL_INCLUDE_DIR)
SET(MKL_FOUND ON)
......@@ -78,6 +79,7 @@ ELSE(MKL_FOUND OR MKL_INTEL_FOUND )
ENDIF (MKL_FOUND OR MKL_INTEL_FOUND )
MARK_AS_ADVANCED(MKL_INCLUDE_DIR)
MARK_AS_ADVANCED(MKL_LIB_DIR)
MARK_AS_ADVANCED(MKL_LAPACK)
MARK_AS_ADVANCED(MKL)
MARK_AS_ADVANCED(MKL_GUIDE)
......
......@@ -4,6 +4,8 @@ SET(NATIVE_BLAS_LAPACK_SEARCH_PATHS /usr/lib /usr/lib64 /usr/local/lib /usr/loca
FIND_LIBRARY(NATIVE_BLAS NAMES blas PATHS ${NATIVE_BLAS_LAPACK_SEARCH_PATHS})
FIND_LIBRARY(NATIVE_LAPACK NAMES lapack PATHS ${NATIVE_BLAS_LAPACK_SEARCH_PATHS})
GET_FILENAME_COMPONENT(NATIVE_BLAS_LIB_DIR ${NATIVE_BLAS} DIRECTORY)
GET_FILENAME_COMPONENT(NATIVE_LAPACK_LIB_DIR ${NATIVE_LAPACK} DIRECTORY)
IF (NATIVE_BLAS AND NATIVE_LAPACK)
......@@ -22,4 +24,6 @@ ENDIF (NATIVE_BLAS_LAPACK_FOUND)
MARK_AS_ADVANCED(NATIVE_BLAS)
MARK_AS_ADVANCED(NATIVE_LAPACK)
MARK_AS_ADVANCED(NATIVE_BLAS_LIB_DIR)
MARK_AS_ADVANCED(NATIVE_LAPACK_LIB_DIR)
......@@ -49,6 +49,23 @@ IF (NEKTAR_USE_PETSC)
# we use a MUMPS build in ordering here, in the future it might make
# sense to hook it up with metis/scotch since this MIGHT be faster
SET(PETSC_MUMPS --download-scalapack --download-mumps)
IF( NEKTAR_USE_BLAS_LAPACK )
IF( NEKTAR_USE_MKL AND MKL_FOUND )
SET(PETSC_MUMPS ${PETSC_MUMPS} --with-blas-lapack-dir=${MKL_LIB_DIR})
ELSEIF( NEKTAR_USE_WIN32_LAPACK )
SET(PETSC_MUMPS ${PETSC_MUMPS} --with-blas-lapack-dir=${LAPACK_DIR})
ELSEIF( NEKTAR_USE_SYSTEM_BLAS_LAPACK )
SET(PETSC_MUMPS ${PETSC_MUMPS} --with-blas-lapack-dir=${NATIVE_BLAS_LIB_DIR},${NATIVE_LAPACK_LIB_DIR})
ELSE()
MESSAGE(STATUS "No suitable blas/lapack found, downloading")
SET(PETSC_MUMPS ${PETSC_MUMPS} --download-fblaslapack)
ENDIF()
ELSE()
MESSAGE(STATUS "No suitable blas/lapack found, downloading")
SET(PETSC_MUMPS ${PETSC_MUMPS} --download-fblaslapack)
ENDIF()
ELSE()
MESSAGE(WARNING "No Fortran support. Building PETSc without MUMPS support")
SET(PETSC_Fortran_COMPILER "0")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment