Commit b6f85d3f authored by Dave Moxey's avatar Dave Moxey

Refactor METIS

parent 9172b68e
......@@ -128,6 +128,7 @@ CMAKE_DEPENDENT_OPTION(NEKTAR_USE_WIN32_LAPACK
"Use Win32 Lapack provided with the Third Party Distribution."
ON "NEKTAR_USE_BLAS_LAPACK; WIN32" OFF)
# Memory pools
OPTION(NEKTAR_USE_MEMORY_POOLS
"Use memory pools to accelerate memory allocation." ON)
MARK_AS_ADVANCED(NEKTAR_USE_MEMORY_POOLS)
......
SET(METIS_SEARCH_PATHS
${CMAKE_SOURCE_DIR}/ThirdParty/metis-5.0.2/
${CMAKE_SOURCE_DIR}/ThirdParty/metis-5.0.2/build/
${CMAKE_SOURCE_DIR}/../ThirdParty/metis-5.0.2/
${CMAKE_SOURCE_DIR}/../ThirdParty/metis-5.0.2/build
${CMAKE_SOURCE_DIR}/ThirdParty/dist/lib
${CMAKE_SOURCE_DIR}/../ThirdParty/dist/lib)
FIND_LIBRARY(METIS_LIB NAMES metis PATHS ${METIS_SEARCH_PATHS})
SET(METIS_FOUND FALSE)
IF (METIS_LIB)
SET(METIS_FOUND TRUE)
GET_FILENAME_COMPONENT(METIS_PATH ${METIS_LIB} PATH)
INCLUDE_DIRECTORIES(${METIS_PATH}/../include)
MARK_AS_ADVANCED(METIS_PATH)
MARK_AS_ADVANCED(METIS_LIB)
ENDIF (METIS_LIB)
IF (METIS_FOUND)
IF (NOT METIS_LIB_FIND_QUIETLY)
MESSAGE(STATUS "Found Metis: ${METIS_LIB}")
ENDIF (NOT METIS_LIB_FIND_QUIETLY)
ELSE(METIS_FOUND)
IF (METIS_LIB_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find Metis")
ENDIF (METIS_LIB_FIND_REQUIRED)
ENDIF (METIS_FOUND)
SET(THIRDPARTY_BUILD_METIS ON CACHE BOOL
"Build ModMetis library from ThirdParty")
########################################################################
#
# ThirdParty configuration for Nektar++
#
# Loki headers library
#
########################################################################
IF (THIRDPARTY_BUILD_METIS)
INCLUDE(ExternalProject)
EXTERNALPROJECT_ADD(
modmetis-5.1.0
PREFIX ${TPSRC}
URL ${TPURL}/modmetis-5.1.0_2.tar.bz2
URL_MD5 "8a1f1afd39b46a4477c1ea15464cdf89"
STAMP_DIR ${TPBUILD}/stamp
DOWNLOAD_DIR ${TPSRC}
SOURCE_DIR ${TPSRC}/modmetis-5.1.0
BINARY_DIR ${TPBUILD}/modmetis-5.1.0
TMP_DIR ${TPBUILD}/modmetis-5.1.0-tmp
INSTALL_DIR ${TPDIST}
CONFIGURE_COMMAND ${CMAKE_COMMAND}
-DCMAKE_C_COMPILER:FILEPATH=${CMAKE_C_COMPILER}
-DCMAKE_CXX_COMPILER:FILEPATH=${CMAKE_CXX_COMPILER}
-DCMAKE_INSTALL_PREFIX:PATH=${TPDIST}
-DCMAKE_C_FLAGS:STRING=-fPIC
-DGKLIB_PATH:PATH=${TPSRC}/modmetis-5.1.0/GKlib
${TPSRC}/modmetis-5.1.0
INCLUDE(ExternalProject)
EXTERNALPROJECT_ADD(
modmetis-5.1.0
PREFIX ${TPSRC}
URL ${TPURL}/modmetis-5.1.0_2.tar.bz2
URL_MD5 "8a1f1afd39b46a4477c1ea15464cdf89"
STAMP_DIR ${TPBUILD}/stamp
DOWNLOAD_DIR ${TPSRC}
SOURCE_DIR ${TPSRC}/modmetis-5.1.0
BINARY_DIR ${TPBUILD}/modmetis-5.1.0
TMP_DIR ${TPBUILD}/modmetis-5.1.0-tmp
INSTALL_DIR ${TPDIST}
CONFIGURE_COMMAND ${CMAKE_COMMAND}
-DCMAKE_C_COMPILER:FILEPATH=${CMAKE_C_COMPILER}
-DCMAKE_CXX_COMPILER:FILEPATH=${CMAKE_CXX_COMPILER}
-DCMAKE_INSTALL_PREFIX:PATH=${TPDIST}
-DCMAKE_C_FLAGS:STRING=-fPIC
-DGKLIB_PATH:PATH=${TPSRC}/modmetis-5.1.0/GKlib
${TPSRC}/modmetis-5.1.0
)
SET(METIS_LIB metis CACHE FILEPATH
"METIS library" FORCE)
MARK_AS_ADVANCED(METIS_LIB)
LINK_DIRECTORIES(${TPDIST}/lib)
INCLUDE_DIRECTORIES(${TPDIST}/include)
MESSAGE(STATUS "Build Metis: ${TPDIST}/lib/lib${METIS_LIB}.a")
ELSE (THIRDPARTY_BUILD_METIS)
INCLUDE (FindMetis)
ENDIF (THIRDPARTY_BUILD_METIS)
SET(METIS_LIB metis CACHE FILEPATH
"METIS library" FORCE)
MARK_AS_ADVANCED(METIS_LIB)
LINK_DIRECTORIES(${TPDIST}/lib)
INCLUDE_DIRECTORIES(${TPDIST}/include)
MESSAGE(STATUS "Build Metis: ${TPDIST}/lib/lib${METIS_LIB}.a")
\ No newline at end of file
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