Commit 2bd067eb authored by Chris Cantwell's avatar Chris Cantwell

Updated CMake build system to use a top-level CMakeLists.txt.

All libraries, solvers, demos, regressionTests and utilities now built using a
  single configuration/build cycle.
Each component build can be enabled/disabled by the user.
Cleaned up CMake configuration and moved non-essential options to Advanced.


git-svn-id: https://gforge.sci.utah.edu/svn/nektar/trunk@3628 305cdda6-5ce1-45b3-a98d-dfc68c8b3305
parent 94a7d5ea
This diff is collapsed.
SET(ARPACK_SEARCH_PATHS ${CMAKE_SOURCE_DIR} /opt/local/lib/ ../ThirdParty/ARPACK)
SET(ARPACK_SEARCH_PATHS ${CMAKE_SOURCE_DIR} /opt/local/lib/ ThirdParty/ARPACK)
FIND_LIBRARY(ARPACK_LIB NAMES arpack.1 arpack PATHS ${ARPACK_SEARCH_PATHS})
SET(ARPACK_FOUND FALSE)
IF (ARPACK_LIB)
SET(ARPACK_FOUND TRUE)
SET(ARPACK_FOUND TRUE)
MARK_AS_ADVANCED(ARPACK_LIB)
ENDIF (ARPACK_LIB)
......@@ -14,6 +14,8 @@ IF (ARPACK_FOUND)
MESSAGE(STATUS "Found Arpack : ${ARPACK_LIB}")
GET_FILENAME_COMPONENT(ARPACK_PATH ${ARPACK_LIB} PATH CACHE)
SET(ARPACK_INCLUDE_DIR ${ARPACK_PATH}/../include CACHE FILEPATH "ARPACK include directory.")
MARK_AS_ADVANCED(ARPACK_PATH)
MARK_AS_ADVANCED(ARPACK_INCLUDE_DIR)
ENDIF (NOT ARPACK_LIB_FIND_QUIETLY)
ELSE(ARPACK_FOUND)
IF (ARPACK_LIB_FIND_REQUIRED)
......
......@@ -18,9 +18,11 @@ IF (FFTW_FOUND)
MESSAGE(STATUS "Found FFTW")
GET_FILENAME_COMPONENT(FFTW_PATH ${FFTW_LIB} PATH CACHE)
SET(FFTW_INCLUDE_DIR ${FFTW_PATH}/../include CACHE FILEPATH "FFTW include directory.")
MARK_AS_ADVANCED(FFTW_PATH)
MARK_AS_ADVANCED(FFTW_INCLUDE_DIR)
ENDIF (NOT FFTW_LIB_FIND_QUIETLY)
ELSE(FFTW_FOUND)
IF (FFTW_LIB_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find FFTW")
ENDIF (FFTW_LIB_FIND_REQUIRED)
ENDIF (FFTW_FOUND)
\ No newline at end of file
ENDIF (FFTW_FOUND)
SET(GSMPI_SEARCH_PATHS
${CMAKE_SOURCE_DIR}/ThirdParty/gsmpi-1.0/
${CMAKE_SOURCE_DIR}/ThirdParty/gsmpi-1.0/build/
${CMAKE_SOURCE_DIR}/../ThirdParty/gsmpi-1.0/
${CMAKE_SOURCE_DIR}/../ThirdParty/gsmpi-1.0/build/
${CMAKE_SOURCE_DIR}/../../ThirdParty/gsmpi-1.0/
${CMAKE_SOURCE_DIR}/../../ThirdParty/gsmpi-1.0/build )
${CMAKE_SOURCE_DIR}/../ThirdParty/gsmpi-1.0/build )
FIND_LIBRARY(GSMPI_LIBRARY NAMES gsmpi PATHS ${GSMPI_SEARCH_PATHS})
......
......@@ -5,12 +5,12 @@ FIND_PATH(LOKI_INCLUDE_DIR loki/Typelist.h
${LOKI_ADDITIONAL_INCLUDE_DIRS}
/usr/include
/usr/local/include
${CMAKE_SOURCE_DIR}/../ThirdParty/loki/include/
${CMAKE_SOURCE_DIR}/../ThirdParty/loki-0.1.3/include
${CMAKE_SOURCE_DIR}/ThirdParty/loki/include/
${CMAKE_SOURCE_DIR}/ThirdParty/loki-0.1.3/include
${CMAKE_SOURCE_DIR}/ThirdParty/loki-0.1.3/loki-0.1.3/include
${CMAKE_SOURCE_DIR}/../ThirdParty/loki/include/
${CMAKE_SOURCE_DIR}/../ThirdParty/loki-0.1.3/include/
${CMAKE_SOURCE_DIR}/../ThirdParty/loki-0.1.3/loki-0.1.3/include
${CMAKE_SOURCE_DIR}/../../ThirdParty/loki/include/
${CMAKE_SOURCE_DIR}/../../ThirdParty/loki-0.1.3/include/
${CMAKE_SOURCE_DIR}/../../ThirdParty/loki-0.1.3/loki-0.1.3/include
"C:\\Program Files\\Microsoft Visual Studio .NET 2003\\Vc7\\include"
"C:\\Program Files\\Microsoft Visual Studio 8\\VC\\include"
)
......@@ -31,3 +31,6 @@ ELSE(LOKI_FOUND)
MESSAGE(FATAL_ERROR "Could not find Loki")
ENDIF (Loki_FIND_REQUIRED)
ENDIF (LOKI_FOUND)
MARK_AS_ADVANCED(LOKI_INCLUDE_DIR)
MARK_AS_ADVANCED(LOKI_LIB_DIR)
SET(METIS_SEARCH_PATHS
${CMAKE_SOURCE_DIR}/ThirdParty/modmetis-4.0/
${CMAKE_SOURCE_DIR}/ThirdParty/modmetis-4.0/build/
${CMAKE_SOURCE_DIR}/../ThirdParty/modmetis-4.0/
${CMAKE_SOURCE_DIR}/../ThirdParty/modmetis-4.0/build/
${CMAKE_SOURCE_DIR}/../../ThirdParty/modmetis-4.0/
${CMAKE_SOURCE_DIR}/../../ThirdParty/modmetis-4.0/build )
${CMAKE_SOURCE_DIR}/../ThirdParty/modmetis-4.0/build )
FIND_LIBRARY(METIS_LIB NAMES modmetis PATHS ${METIS_SEARCH_PATHS})
......
......@@ -20,5 +20,6 @@ ELSE(NATIVE_BLAS_LAPACK_FOUND)
ENDIF (NATIVE_BLAS_LAPACK_FIND_REQUIRED)
ENDIF (NATIVE_BLAS_LAPACK_FOUND)
MARK_AS_ADVANCED(NATIVE_BLAS)
MARK_AS_ADVANCED(NATIVE_LAPACK)
......@@ -3,18 +3,19 @@
SET(NIST_SPARSE_BLAS_SEARCH_PATHS
${NIST_SPARSE_BLAS_ADDITIONAL_INCLUDE_DIRS}
${CMAKE_SOURCE_DIR}/../ThirdParty/spblastk0.9b/lib
${CMAKE_SOURCE_DIR}/../../ThirdParty/spblastk0.9b/lib )
${CMAKE_SOURCE_DIR}/ThirdParty/spblastk0.9b/lib
${CMAKE_SOURCE_DIR}/../ThirdParty/spblastk0.9b/lib )
FIND_LIBRARY(NIST_SPARSE_BLAS NAMES sbtk PATHS ${NIST_SPARSE_BLAS_SEARCH_PATHS})
FIND_LIBRARY(NIST_SPARSE_BLAS_DEBUG NAMES sbtk-g PATHS ${NIST_SPARSE_BLAS_SEARCH_PATHS})
GET_FILENAME_COMPONENT(LIB_PATH ${NIST_SPARSE_BLAS} PATH CACHE)
SET(NIST_SPARSE_BLAS_INCLUDE_DIR ${LIB_PATH}/../include CACHE FILEPATH "Sparse matrix solve include directory.")
GET_FILENAME_COMPONENT(NIST_SPARSE_BLAS_LIB_PATH ${NIST_SPARSE_BLAS} PATH CACHE)
SET(NIST_SPARSE_BLAS_INCLUDE_DIR ${NIST_SPARSE_BLAS_LIB_PATH}/../include CACHE FILEPATH "Sparse matrix solve include directory.")
MARK_AS_ADVANCED(NIST_SPARSE_BLAS)
MARK_AS_ADVANCED(NIST_SPARSE_BLAS_DEBUG)
MARK_AS_ADVANCED(NIST_SPARSE_BLAS_INCLUDE_DIR)
MARK_AS_ADVANCED(NIST_SPARSE_BLAS_LIB_PATH)
IF (NIST_SPARSE_BLAS)
SET(NIST_SPARSE_BLAS_FOUND ON)
......
# Use TINYXML_ADDITIONAL_INCLUDE_DIRS to customize search.
GET_FILENAME_COMPONENT(FIRST_THIRD_PARTY_INCLUDE ${CMAKE_SOURCE_DIR}/../ThirdParty ABSOLUTE)
GET_FILENAME_COMPONENT(SECOND_THIRD_PARTY_INCLUDE ${CMAKE_SOURCE_DIR}/../../ThirdParty ABSOLUTE)
GET_FILENAME_COMPONENT(FIRST_THIRD_PARTY_INCLUDE ${CMAKE_SOURCE_DIR}/ThirdParty ABSOLUTE)
GET_FILENAME_COMPONENT(SECOND_THIRD_PARTY_INCLUDE ${CMAKE_SOURCE_DIR}/../ThirdParty ABSOLUTE)
FIND_PATH(TINYXML_BASE tinyxml/tinyxml.h
${TINYXML_ADDITIONAL_INCLUDE_DIRS}
......@@ -21,6 +21,8 @@ SET (TINYXML_LIB_DIR ${TINYXML_BASE}/lib )
SET (TINYXML_SRC_DIR ${TINYXML_BASE}/tinyxml)
SET (TINYXML_INCLUDE_DIR ${TINYXML_BASE}/tinyxml)
MARK_AS_ADVANCED(TINYXML_BASE)
IF (TINYXML_FOUND)
IF (NOT TINYXML_FIND_QUIETLY)
MESSAGE(STATUS "Found TinyXML: ${TINYXML_INCLUDE_DIR}")
......
SET(NEKTAR_VERSION_MAJOR 3)
SET(NEKTAR_VERSION_MINOR 0)
SET(NEKTAR_VERSION_PATCH 0)
SET(NEKTAR_VERSION ${NEKTAR_VERSION_MAJOR}.${NEKTAR_VERSION_MINOR}.${NEKTAR_VERSION_PATCH})
SET(NEKTAR_BIN_DIR bin)
SET(NEKTAR_LIB_DIR ${LIB_DIR})
SET(NEKTAR_INCLUDE_DIR include/nektar++)
SET(NEKTAR_SHARE_DIR share/nektar++)
MACRO(CHANGE_EXTENSION output var new_ext)
GET_FILENAME_COMPONENT(FileName ${var} NAME_WE)
GET_FILENAME_COMPONENT(Path ${var} PATH)
SET(${output} ${Path}/${FileName}.${new_ext})
ENDMACRO()
IF( MSVC )
# Needed for M_PI to be visible in visual studio.
ADD_DEFINITIONS(-D_USE_MATH_DEFINES)
# Removes the warnings about unsafe methods such as strcpy, std::copy,
# memcmp, etc.
ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_DEPRECATE)
ENDIF( )
IF( NEKTAR_USE_TINYXML_STL )
ADD_DEFINITIONS( -DTIXML_USE_STL)
ENDIF( NEKTAR_USE_TINYXML_STL )
IF( NEKTAR_USE_DIRECT_BLAS_CALLS )
ADD_DEFINITIONS(-DNEKTAR_USING_DIRECT_BLAS_CALLS)
ENDIF( NEKTAR_USE_DIRECT_BLAS_CALLS )
IF( NEKTAR_USE_EXPRESSION_TEMPLATES )
ADD_DEFINITIONS(-DNEKTAR_USE_EXPRESSION_TEMPLATES -DNEKTAR_USING_CMAKE)
ENDIF( NEKTAR_USE_EXPRESSION_TEMPLATES )
IF( NEKTAR_USE_MEMORY_POOLS )
ADD_DEFINITIONS(-DNEKTAR_MEMORY_POOL_ENABLED)
ELSE( NEKTAR_USE_MEMORY_POOLS )
REMOVE_DEFINITIONS(-DNEKTAR_MEMORY_POOL_ENABLED)
ENDIF( NEKTAR_USE_MEMORY_POOLS )
IF( NEKTAR_BUILD_SHARED )
SET(NEKTAR_LIBRARY_TYPE "SHARED")
ELSE( NEKTAR_BUILD_SHARED )
SET(NEKTAR_LIBRARY_TYPE "STATIC")
ENDIF( NEKTAR_BUILD_SHARED )
IF( NEKTAR_USE_METIS )
INCLUDE (FindMetis)
ADD_DEFINITIONS(-DNEKTAR_USING_METIS)
ENDIF( NEKTAR_USE_METIS )
IF( NEKTAR_USE_FFTW )
INCLUDE (FindFFTW)
ADD_DEFINITIONS(-DNEKTAR_USING_FFTW)
ENDIF( NEKTAR_USE_FFTW )
IF( NEKTAR_USE_ARPACK )
INCLUDE (FindArpack)
ADD_DEFINITIONS(-DNEKTAR_USING_ARPACK)
ENDIF( NEKTAR_USE_ARPACK)
IF( NEKTAR_USE_VTK )
INCLUDE (FindVTK)
INCLUDE (${VTK_USE_FILE})
ADD_DEFINITIONS(-DNEKTAR_USING_VTK)
ENDIF( NEKTAR_USE_VTK )
IF( NEKTAR_USE_MKL )
INCLUDE (FindMKL)
ENDIF( NEKTAR_USE_MKL )
IF( NEKTAR_USE_NIST_SPARSE_BLAS_TOOLKIT )
INCLUDE (FindNistSparseBlas)
ENDIF (NEKTAR_USE_NIST_SPARSE_BLAS_TOOLKIT )
IF( NEKTAR_USE_ACCELERATE_FRAMEWORK )
INCLUDE (FindAccelerateFramework)
ENDIF( NEKTAR_USE_ACCELERATE_FRAMEWORK )
IF( NEKTAR_USE_CHUD_FRAMEWORK )
INCLUDE (FindCHUDFramework)
ADD_DEFINITIONS(-DNEKTAR_USING_CHUD)
ENDIF( NEKTAR_USE_CHUD_FRAMEWORK )
IF( NEKTAR_USE_ACML )
INCLUDE (FindACML)
ENDIF( NEKTAR_USE_ACML )
IF( NEKTAR_USE_WIN32_LAPACK )
INCLUDE (FindWin32Lapack)
ENDIF( NEKTAR_USE_WIN32_LAPACK )
IF( NEKTAR_USE_SYSTEM_BLAS_LAPACK )
INCLUDE(FindNativeBlasLapack)
ENDIF( NEKTAR_USE_SYSTEM_BLAS_LAPACK )
# Use MPI
IF( NEKTAR_USE_MPI )
INCLUDE(FindMPI)
# Use synchronous messaging
IF (MPI_SYNC)
ADD_DEFINITIONS(-DMPI_SYNC)
ENDIF (MPI_SYNC)
ADD_DEFINITIONS(-DNEKTAR_USE_MPI)
ENDIF( NEKTAR_USE_MPI )
IF( NEKTAR_USE_MKL )
SET(NEKTAR_USING_BLAS TRUE)
SET(NEKTAR_USING_LAPACK TRUE)
SET(NEKTAR_USING_MKL TRUE)
ADD_DEFINITIONS(-DNEKTAR_USING_LAPACK -DNEKTAR_USING_BLAS)
ENDIF( NEKTAR_USE_MKL )
IF( NEKTAR_USE_ACML )
SET(NEKTAR_USING_BLAS TRUE)
SET(NEKTAR_USING_LAPACK TRUE)
SET(NEKTAR_USING_ACML TRUE)
ADD_DEFINITIONS(-DNEKTAR_USING_LAPACK -DNEKTAR_USING_BLAS -DUSE_ACML)
ADD_DEFINITIONS(-DNEKTAR_USING_LAPACK -DNEKTAR_USING_BLAS)
ENDIF( NEKTAR_USE_ACML )
IF( NEKTAR_USE_BLAS_LAPACK )
ADD_DEFINITIONS( -DNEKTAR_USING_LAPACK -DNEKTAR_USING_BLAS )
ENDIF( NEKTAR_USE_BLAS_LAPACK )
IF( NEKTAR_USE_ARPACK )
ADD_DEFINITIONS( -DNEKTAR_USING_ARPACK )
ENDIF( NEKTAR_USE_ARPACK)
MACRO(SET_LAPACK_LINK_LIBRARIES name)
IF( NEKTAR_USE_BLAS_LAPACK )
IF( NEKTAR_USE_MKL AND MKL_FOUND )
......
# Packaging
SET(NEKTAR_PACKAGE_GENERATOR "None" CACHE STRING
"Support Packaging: RPM or DEB" )
MARK_AS_ADVANCED(NEKTAR_PACKAGE_GENERATOR)
# Define components
SET(CPACK_COMPONENTS_ALL dev lib demos extra-demos)
#SET(CPACK_RPM_PACKAGE_DEBUG ON)
SET(CPACK_COMPONENT_LIB_NAME "nektar++-lib")
SET(CPACK_COMPONENT_LIB_DISPLAY_NAME "nektar++-lib")
SET(CPACK_COMPONENT_LIB_DESCRIPTION "Nektar++ Libraries")
SET(CPACK_COMPONENT_DEV_NAME "nektar++-dev")
SET(CPACK_COMPONENT_DEV_DISPLAY_NAME "nektar++-dev")
SET(CPACK_COMPONENT_DEV_DESCRIPTION "Development files for Nektar++")
SET(CPACK_COMPONENT_DEV_DEPENDS lib)
SET(CPACK_COMPONENT_DEMOS_NAME "nektar++-demos")
SET(CPACK_COMPONENT_DEMOS_DISPLAY_NAME "nektar++-demos")
SET(CPACK_COMPONENT_DEMOS_DESCRIPTION "Framework demonstration binaries")
SET(CPACK_COMPONENT_DEMOS_DEPENDS lib)
SET(CPACK_COMPONENT_EXTRA-DEMOS_NAME "nektar++-extra-demos")
SET(CPACK_COMPONENT_EXTRA-DEMOS_DISPLAY_NAME "nektar++-extra-demos")
SET(CPACK_COMPONENT_EXTRA-DEMOS_DESCRIPTION
"Framework extra demonstration binaries")
SET(CPACK_COMPONENT_EXTRA-DEMOS_DEPENDS lib)
# CPack setup
IF (NOT ${NEKTAR_PACKAGE_GENERATOR} MATCHES "None")
......@@ -15,12 +44,18 @@ IF (NOT ${NEKTAR_PACKAGE_GENERATOR} MATCHES "None")
SET(CPACK_PACKAGE_VENDOR "Imperial College London")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY
"Spectral/hp Element Framework for solving PDEs")
SET(CPACK_PACKAGE_DESCRIPTION "
The nektar++ packages provide a spectral/hp element framework for the numerical
solution of partial differential equations (PDEs). Demonstration codes are
provided in the nektar++-demos package, along with a number of time-dependent
solvers in the nektar++-solvers package.")
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "nektar++")
SET(CPACK_PACKAGE_CONTACT "Chris Cantwell <c.cantwell@imperial.ac.uk>")
SET(CPACK_PACKAGE_VERSION ${NEKTAR_VERSION})
SET(CPACK_PACKAGE_VERSION_MAJOR ${NEKTAR_VERSION_MAJOR})
SET(CPACK_PACKAGE_VERSION_MINOR ${NEKTAR_VERSION_MINOR})
SET(CPACK_PACKAGE_VERSION_PATCH ${NEKTAR_VERSION_PATCH})
SET(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_SOURCE_DIR}/LICENSE)
# RPM packaging
IF (${NEKTAR_PACKAGE_GENERATOR} MATCHES "RPM")
......@@ -36,7 +71,19 @@ provided in the nektar++-demos package, along with a number of time-dependent
solvers in the nektar++-solvers package.")
ENDIF()
# Finally, include the CPack module
IF (${NEKTAR_PACKAGE_GENERATOR} MATCHES "DEB")
MESSAGE(STATUS "Generating Packaging for DEB")
SET(CPACK_DEB_PACKAGE_URL "www.nektar.info")
SET(CPACK_DEB_COMPONENT_INSTALL ON)
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libfftw3-3,libboost-date-time1.42.0,libboost-filesystem1.42.0,libboost-iostreams1.42.0,libboost-program-options1.42.0,libboost-system1.42.0,libboost-thread1.42.0,zlib1g")
SET(CPACK_DEBIAN_PACKAGE_DESCRIPTION
"${CPACK_PACKAGE_DESCRIPTION_SUMMARY}
${CPACK_PACKAGE_DESCRIPTION}")
SET(CPACK_DEBIAN_PACKAGE_SECTION "devel")
SET(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
ENDIF()
# Finally, include the CPack module
INCLUDE(CPack)
ENDIF()
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
SET(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build,
options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release
RelWithDebInfo MinSizeRel.")
PROJECT(Nektar++)
INCLUDE(CMakeExportBuildSettings)
ENABLE_TESTING()
# Use the CMake 2.4 policy for CMake 2.6
if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 OLD)
endif(COMMAND cmake_policy)
# Find the modules included with Nektar
SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR} ${CMAKE_MODULE_PATH})
IF( NOT NEKTAR_PASSED_FIRST_CONFIGURE )
SET(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/dist CACHE PATH "" FORCE)
ENDIF()
SET(LIB_DIR "lib")
IF( CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" )
SET(LIB_DIR "lib64")
ENDIF()
# Set up RPATH
SET(CMAKE_SKIP_BUILD_RPATH FALSE)
SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${LIB_DIR}")
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
SET(CMAKE_INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/${LIB_DIR}")
LIST(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES
"${CMAKE_INSTALL_PREFIX}/${LIB_DIR}" isSystemDir)
IF("${isSystemDir}" STREQUAL "-1")
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${LIB_DIR}")
ENDIF("${isSystemDir}" STREQUAL "-1")
SET(NEKTAR_USE_METIS ON CACHE BOOL "Use Metis routines for partitioning and reordering graphs.")
MARK_AS_ADVANCED(NEKTAR_USE_METIS)
SET(NEKTAR_USE_ARPACK OFF CACHE BOOL "Use Arpack routines for evaluating the
eigenvalues and eigenvectors")
MARK_AS_ADVANCED(NEKTAR_USE_ARPACK)
SET(NEKTAR_USE_FFTW OFF CACHE BOOL "Use FFTW routines for performing the Fast Fourier Transform.")
MARK_AS_ADVANCED(NEKTAR_USE_FFTW)
SET(NEKTAR_USE_VTK OFF CACHE BOOL "Use VTK library for utilities.")
MARK_AS_ADVANCED(NEKTAR_USE_VTK)
# Parallelisation
SET(NEKTAR_USE_MPI OFF CACHE BOOL "Use MPICH2 for parallelisation.")
SET(MPI_SYNC OFF CACHE BOOL "Use synchronous MPI calls when sending data.")
MARK_AS_ADVANCED(MPI_SYNC)
IF( NEKTAR_USE_MPI )
INCLUDE (FindGSMPI)
ENDIF( NEKTAR_USE_MPI )
SET(NEKTAR_USE_TINYXML_STL ON CACHE BOOL "Use STL with TinyXML library.")
SET(NEKTAR_USE_DIRECT_BLAS_CALLS OFF CACHE BOOL "Use direct BLAS calls rather than NekMatrix calls in the StdRegions and LocalRegions sublibrary")
SET(NEKTAR_FULL_DEBUG OFF CACHE BOOL "Enable Full Debugging.")
SET(NEKTAR_USE_PRECOMPILED_HEADERS OFF CACHE BOOL "Enable the use of precompiled headers.")
IF (${CMAKE_COMPILER_IS_GNUCXX})
SET(NEKTAR_ENABLE_PROFILE OFF CACHE BOOL "Compiles Nektar++ with the -pg compiler flag")
MARK_AS_ADVANCED(NEKTAR_ENABLE_PROFILE)
ENDIF (${CMAKE_COMPILER_IS_GNUCXX})
SET(NEKTAR_BUILD_DEMOS ON CACHE BOOL "Build Demo Projects")
SET(NEKTAR_BUILD_UNIT_TESTS OFF CACHE BOOL "Build Unit Tests Projects")
SET(NEKTAR_BUILD_SHARED ON CACHE BOOL "Build Nektar++ as shared libraries")
SET(NEKTAR_BUILD_TIMINGS OFF CACHE BOOL "Build Timings directory")
MARK_AS_ADVANCED(NEKTAR_BUILD_TIMINGS)
SET(ExpressionTemplateDefault OFF)
SET(NEKTAR_USE_EXPRESSION_TEMPLATES ${ExpressionTemplateDefault} CACHE BOOL "")
MARK_AS_ADVANCED(NEKTAR_USE_DIRECT_BLAS_CALLS)
MARK_AS_ADVANCED(NEKTAR_FULL_DEBUG)
MARK_AS_ADVANCED(NEKTAR_USE_MEMORY_POOLS)
MARK_AS_ADVANCED(NEKTAR_USE_PRECOMPILED_HEADERS)
MARK_AS_ADVANCED(NEKTAR_USE_EXPRESSION_TEMPLATES)
SET(NEKTAR_USE_ACML OFF CACHE BOOL "Use the AMD Core Math Library (ACML) for BLAS and Lapack support." )
SET(NEKTAR_USE_MEMORY_POOLS ON CACHE BOOL "Use memory pools to accelerate memory allocation.")
SET(NEKTAR_USE_BLAS_LAPACK ON CACHE BOOL "Use Blas and lapack routines.")
MARK_AS_ADVANCED(NEKTAR_USE_BLAS_LAPACK)
SET(NEKTAR_USE_NIST_SPARSE_BLAS_TOOLKIT ON CACHE BOOL "Use NIST Fortran Sparse Blas Toolkit library" )
MARK_AS_ADVANCED(NEKTAR_USE_NIST_SPARSE_BLAS_TOOLKIT)
SET(NEKTAR_USE_MKL OFF CACHE BOOL "Use the Intel Math Kernel Library (MKL) for BLAS and Lapack support." )
IF( APPLE )
SET(NEKTAR_USE_ACCELERATE_FRAMEWORK ON CACHE BOOL "Use the Mac Accelerate Framework for BLAS and Lapack support." )
SET(NEKTAR_USE_CHUD_FRAMEWORK OFF CACHE BOOL "Use the Mac CHUD Framework (for Shark support)." )
MARK_AS_ADVANCED(NEKTAR_USE_CHUD_FRAMEWORK)
ELSE(APPLE)
IF( UNIX )
SET(NEKTAR_USE_SYSTEM_BLAS_LAPACK ON CACHE BOOL "Use the system provided blas and lapack libraries")
ENDIF(UNIX)
ENDIF(APPLE)
# Turn on NEKTAR_USE_WIN32_LAPACK if we are in Windows and the libraries exist.
IF( WIN32 )
FIND_LIBRARY( WIN32_BLAS NAMES blas_win32 PATHS ${CMAKE_SOURCE_DIR}/../ThirdParty )
FIND_LIBRARY( WIN32_LAPACK NAMES lapack_win32 PATHS ${CMAKE_SOURCE_DIR}/../ThirdParty )
IF( WIN32_BLAS AND WIN32_LAPACK )
SET(Win32LapackDefault ON)
ELSE(WIN32_BLAS AND WIN32_LAPACK)
SET(Win32LapackDefault OFF)
ENDIF(WIN32_BLAS AND WIN32_LAPACK)
ELSE(WIN32)
SET(Win32LapackDefault OFF)
ENDIF(WIN32)
SET(NEKTAR_USE_WIN32_LAPACK ${Win32LapackDefault} CACHE BOOL "Use Win32 Lapack provided with the Third Party Distribution.")
INCLUDE (NektarCommon)
INCLUDE (FindLoki)
INCLUDE (FindTinyXml)
IF(NEKTAR_USE_FFTW)
INCLUDE (FindFFTW)
ENDIF(NEKTAR_USE_FFTW)
IF(NEKTAR_USE_ARPACK)
INCLUDE (FindArpack)
ENDIF(NEKTAR_USE_ARPACK)
IF( NOT WIN32 )
SET(Boost_USE_STATIC_LIBS OFF)
ELSE( NOT WIN32 )
SET(Boost_USE_STATIC_LIBS ON)
ENDIF( NOT WIN32 )
SET(Boost_USE_MULTITHREAD ON)
SET(Boost_ADDITIONAL_VERSIONS "1.48" "1.48.0" "1.47.0" "1.47" "1.46" "1.46.1" "1.40" "1.40.0" "1.35.0" "1.35")
IF( NOT BOOST_ROOT )
#If the user has not set BOOST_ROOT, look in a couple common places first.
SET(BOOST_ROOT ${CMAKE_SOURCE_DIR}/../ThirdParty/boost)
FIND_PACKAGE( Boost COMPONENTS thread iostreams zlib date_time filesystem system program_options)
SET(BOOST_ROOT ${CMAKE_SOURCE_DIR}/../../ThirdParty/boost)
FIND_PACKAGE( Boost COMPONENTS thread iostreams zlib date_time filesystem system program_options)
ELSE()
FIND_PACKAGE( Boost COMPONENTS thread iostreams zlib date_time filesystem system program_options)
ENDIF()
IF(NOT Boost_ZLIB_FOUND)
FIND_PACKAGE( ZLIB )
IF (ZLIB_FOUND)
SET(Boost_ZLIB_LIBRARY ${ZLIB_LIBRARIES})
SET(Boost_ZLIB_LIBRARY_RELEASE ${ZLIB_LIBRARIES})
SET(Boost_ZLIB_LIBRARY_DEBUG ${ZLIB_LIBRARIES})
ENDIF()
ENDIF()
INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR} ${Boost_INCLUDE_DIRS} ${LOKI_INCLUDE_DIR} ${TINYXML_BASE})
IF(NEKTAR_USE_FFTW)
INCLUDE_DIRECTORIES(${FFTW_INCLUDE_DIR})
ENDIF(NEKTAR_USE_FFTW)
IF( NEKTAR_USE_MPI )
INCLUDE_DIRECTORIES( ${MPI_INCLUDE_PATH} )
ENDIF( NEKTAR_USE_MPI )
IF(NEKTAR_USE_ARPACK)
INCLUDE_DIRECTORIES(${ARPACK_INCLUDE_DIR})
ENDIF(NEKTAR_USE_ARPACK)
IF(NEKTAR_USE_VTK)
INCLUDE_DIRECTORIES(${VTK_INCLUDE_DIRS})
ENDIF(NEKTAR_USE_VTK)
IF( NEKTAR_USE_PRECOMPILED_HEADERS )
ADD_DEFINITIONS(-DNEKTAR_USE_PRECOMPILED_HEADERS)
ELSE( NEKTAR_USE_PRECOMPILED_HEADERS )
REMOVE_DEFINITIONS(-DNEKTAR_USE_PRECOMPILED_HEADERS)
ENDIF( NEKTAR_USE_PRECOMPILED_HEADERS )
IF( NEKTAR_USE_NIST_SPARSE_BLAS_TOOLKIT )
INCLUDE (FindNistSparseBlas)
ENDIF( NEKTAR_USE_NIST_SPARSE_BLAS_TOOLKIT )
SET(LibrarySubDirs LibUtilities LocalRegions MultiRegions SpatialDomains
StdRegions)
SET(UnitTestSubDirs UnitTests)
......@@ -194,6 +6,8 @@ SET(TimingsSubDirs Timings)
SUBDIRS(${LibrarySubDirs} )
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/library)
IF( NEKTAR_BUILD_UNIT_TESTS )
SUBDIRS(${UnitTestSubDirs})
ENDIF( NEKTAR_BUILD_UNIT_TESTS )
......@@ -205,58 +19,3 @@ ENDIF( NEKTAR_BUILD_DEMOS )
IF( NEKTAR_BUILD_TIMINGS )
SUBDIRS(${TimingsSubDirs})
ENDIF( NEKTAR_BUILD_TIMINGS )
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/Nektar++Config.cmake.in
${CMAKE_BINARY_DIR}/Nektar++Config.cmake @ONLY)
INSTALL(FILES ${CMAKE_BINARY_DIR}/Nektar++Config.cmake
${CMAKE_SOURCE_DIR}/FindLoki.cmake
${CMAKE_SOURCE_DIR}/FindAccelerateFramework.cmake
${CMAKE_SOURCE_DIR}/FindCHUDFramework.cmake
${CMAKE_SOURCE_DIR}/FindACML.cmake
${CMAKE_SOURCE_DIR}/FindArpack.cmake
${CMAKE_SOURCE_DIR}/FindNistSparseBlas.cmake
${CMAKE_SOURCE_DIR}/FindNativeBlasLapack.cmake
${CMAKE_SOURCE_DIR}/FindMKL.cmake
${CMAKE_SOURCE_DIR}/FindMetis.cmake
${CMAKE_SOURCE_DIR}/FindFFTW.cmake
${CMAKE_SOURCE_DIR}/FindWin32Lapack.cmake
${CMAKE_SOURCE_DIR}/NektarCommon.cmake
${CMAKE_SOURCE_DIR}/FindTinyXml.cmake
${CMAKE_SOURCE_DIR}/FindGSMPI.cmake
DESTINATION ${CMAKE_INSTALL_PREFIX})
INSTALL(EXPORT Nektar++Libraries DESTINATION ${LIB_DIR})
SET(NEKTAR_PASSED_FIRST_CONFIGURE ON CACHE BOOL INTERNAL)
# Packaging
SET(NEKTAR_PACKAGE_GENERATOR "None" CACHE STRING "Support Packaging: RPM or DEB" )
MARK_AS_ADVANCED(NEKTAR_PACKAGE_GENERATOR)
# Define components
SET(CPACK_COMPONENTS_ALL dev lib demos extra-demos)
#SET(CPACK_RPM_PACKAGE_DEBUG ON)
SET(CPACK_COMPONENT_LIB_NAME "nektar++-lib")
SET(CPACK_COMPONENT_LIB_DISPLAY_NAME "nektar++-lib")
SET(CPACK_COMPONENT_LIB_DESCRIPTION "Nektar++ Libraries")
SET(CPACK_COMPONENT_DEV_NAME "nektar++-dev")
SET(CPACK_COMPONENT_DEV_DISPLAY_NAME "nektar++-dev")
SET(CPACK_COMPONENT_DEV_DESCRIPTION "Development files for Nektar++")
SET(CPACK_COMPONENT_DEV_DEPENDS lib)
SET(CPACK_COMPONENT_DEMOS_NAME "nektar++-demos")
SET(CPACK_COMPONENT_DEMOS_DISPLAY_NAME "nektar++-demos")
SET(CPACK_COMPONENT_DEMOS_DESCRIPTION "Framework demonstration binaries")
SET(CPACK_COMPONENT_DEMOS_DEPENDS lib)
SET(CPACK_COMPONENT_EXTRA-DEMOS_NAME "nektar++-extra-demos")
SET(CPACK_COMPONENT_EXTRA-DEMOS_DISPLAY_NAME "nektar++-extra-demos")
SET(CPACK_COMPONENT_EXTRA-DEMOS_DESCRIPTION
"Framework extra demonstration binaries")
SET(CPACK_COMPONENT_EXTRA-DEMOS_DEPENDS lib)
INCLUDE(NektarPackageGenerator)
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(REGRESSION)
SET(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/dist CACHE FILEPATH "" FORCE)
ENABLE_TESTING()
# Look for Nektar++ in the standard location (Nektar++/builds)
# This will work no matter where the regression build is.
SET(Nektar++_DIR "${CMAKE_SOURCE_DIR}/../builds/dist" CACHE PATH "")
FIND_PACKAGE(Nektar++ REQUIRED)
ADD_DEFINITIONS(-DNEKTAR_BIN_DIR="${NEKTAR++_BIN_DIR}/")
MACRO(ADD_REGRESSION_EXECUTABLE name source)
ADD_EXECUTABLE(${name} ${source} ${ARGN})
TARGET_LINK_LIBRARIES(${name} ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY})
TARGET_LINK_LIBRARIES(${name}
${Boost_FILESYSTEM_LIBRARY}
${Boost_SYSTEM_LIBRARY}
)
IF( ${CMAKE_SYSTEM} MATCHES "Linux.*")
TARGET_LINK_LIBRARIES(${name} optimized rt debug rt)
TARGET_LINK_LIBRARIES(${name} optimized rt debug rt)
ENDIF()
IF( ${CMAKE_SYSTEM} MATCHES "Darwin-*")
......@@ -45,17 +36,14 @@ IF( WIN32 )
ADD_DEFINITIONS(-DUSR_WIN_32="1")
ENDIF(WIN32)
ADD_DEFINITIONS(-DREG_PATH="${CMAKE_SOURCE_DIR}/")
#ADD_DEFINITIONS(-DREG_PATH="${CMAKE_INSTALL_PREFIX}/${NEKTAR_SHARE_DIR}/test/")
ADD_DEFINITIONS(-DNEKTAR_BIN_DIR="${CMAKE_BINARY_DIR}/dist/bin/")
ADD_DEFINITIONS(-DREG_PATH="${CMAKE_CURRENT_SOURCE_DIR}/")
IF (REGRESSION_USE_PATH)
ADD_DEFINITIONS(-DUSE_PATH="1")
ADD_DEFINITIONS(-DUSE_PATH="1")
ENDIF (REGRESSION_USE_PATH)
#SET(SOLVER_DIR "${CMAKE_SOURCE_DIR}/../solvers/builds/dist" CACHE PATH "")
SET(SOLVER_DIR "${CMAKE_SOURCE_DIR}/../solvers/builds/dist" CACHE PATH "")
ADD_DEFINITIONS(-DNEKTAR_SOLVER_DIR="${SOLVER_DIR}/")
ADD_DEFINITIONS(-DNEKTAR_SOLVER_DIR="${CMAKE_INSTALL_PREFIX}/")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/runtests.sh
${CMAKE_CURRENT_BINARY_DIR}/runtests.sh COPYONLY)
......
######################################################
# This CMakeLists.txt is used to generate an executable
# that uses Nektar++. Customization points for your
# projects are marked below.
######################################################
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(SOLVERS)
IF( CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" )
SET(LIB_DIR "lib64")
ENDIF()
# Setup where CMake will look for modules. You probably
# won't need to modify this.
SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR} ${CMAKE_MODULE_PATH})
IF( NOT(CMAKE_INSTALL_PREFIX_SET) )
SET(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/dist CACHE FILEPATH "Install Path" FORCE)
ENDIF()
SET(CMAKE_INSTALL_PREFIX_SET ON CACHE INTERNAL "")
# Set up RPATH
SET(CMAKE_SKIP_BUILD_RPATH FALSE)
SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
LIST(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES
"${CMAKE_INSTALL_PREFIX}/lib" isSystemDir)
IF("${isSystemDir}" STREQUAL "-1")
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
ENDIF("${isSystemDir}" STREQUAL "-1")
# Look for Nektar++ in the standard location (Nektar++/builds)
# Users can modify this directly in CMake if they used a non-standard location.
SET(Nektar++_DIR "${CMAKE_SOURCE_DIR}/../builds/dist" CACHE PATH "")
# Finds Nektar++. This may introduce other dependencies, such
# as Boost and Loki.
FIND_PACKAGE(Nektar++ REQUIRED)
IF( NEKTAR++_FOUND )
INCLUDE_DIRECTORIES(${NEKTAR++_INCLUDE_DIRS})
LINK_DIRECTORIES(${NEKTAR++_LIBRARY_DIRS})
ADD_DEFINITIONS(${NEKTAR++_DEFINITIONS})
INCLUDE_DIRECTORIES(${SOLVERS_SOURCE_DIR})