Commit abe0997d authored by Spencer Sherwin's avatar Spencer Sherwin

Merge branch 'master' into 'feature/CMake_CCMIO'

# Conflicts:
#   CHANGELOG.md
parents e8b0468a 067613a8
......@@ -3,6 +3,10 @@ Changelog
v5.0.0
------
**Library**
- Added in sum factorisation version for pyramid expansions and orthogonal
expansion in pyramids (!750)
- Significant overhaul of CMake infrastructure (!770)
**NekMesh**:
- Add feature to read basic 2D geo files as CAD (!731)
......@@ -11,6 +15,9 @@ v5.0.0
- Add non-O BL meshing in 2D (!757)
- Fix issue with reading CCM files due to definition of default arrays rather than a vector (!797)
- Add ability to compile CCIO library but tar file is not yet openly available whist we seek permission from Simens (!799)
- Fix issue with reading CCM files due to definition of default arrays
- rather than a vector (!797)
- Fix inverted triangles and small memory issue in surface meshing (!798)
**Library**
- Added in sum factorisation version for pyramid expansions and orthogonal
......@@ -22,6 +29,15 @@ v5.0.0
**Documentation**:
- Added the developer-guide repository as a submodule (!751)
v4.4.2
------
**NekMesh**:
- Fix uninitialised memory bug in Nek5000 input module (!801)
**Library**
- Fix ability to set default implementation in Collections and added an option
to set eNoCollections in FieldConvert as default (!789)
v4.4.1
------
**Library**
......
......@@ -49,6 +49,7 @@ SET(NEKTAR_VERSION ${NEKTAR_VERSION_MAJOR}.${NEKTAR_VERSION_MINOR}.${NEKTAR_VERS
# Add support for CMAKE_DEPENDENT_OPTION
INCLUDE(CMakeDependentOption)
INCLUDE(CMakeParseArguments)
# Enable CTest.
ENABLE_TESTING()
......@@ -181,28 +182,24 @@ OPTION(NEKTAR_USE_EXPRESSION_TEMPLATES
MARK_AS_ADVANCED(NEKTAR_USE_EXPRESSION_TEMPLATES)
# BLAS Support
OPTION(NEKTAR_USE_BLAS_LAPACK "Use Blas and lapack routines." ON)
CMAKE_DEPENDENT_OPTION(NEKTAR_USE_SYSTEM_BLAS_LAPACK
"Use the system provided blas and lapack libraries" ON
"UNIX; NOT APPLE; NOT NEKTAR_USE_OPENBLAS; NOT NEKTAR_USE_MKL; NOT NEKTAR_USE_ACML; NOT NEKTAR_USE_ACCELERATE_FRAMEWORK" OFF)
CMAKE_DEPENDENT_OPTION(NEKTAR_USE_OPENBLAS
"Use OpenBLAS library as a substitute to native BLAS." OFF
"NEKTAR_USE_BLAS_LAPACK" OFF)
CMAKE_DEPENDENT_OPTION(NEKTAR_USE_SMV
"Use LibSMV library for faster small matrix-vector multiplies." OFF
"NEKTAR_USE_BLAS_LAPACK" OFF)
"NOT NEKTAR_USE_SYSTEM_BLAS_LAPACK" OFF)
CMAKE_DEPENDENT_OPTION(NEKTAR_USE_ACML
"Use the AMD Core Math Library (ACML) for BLAS and Lapack support." OFF
"NEKTAR_USE_BLAS_LAPACK" OFF)
"NOT NEKTAR_USE_SYSTEM_BLAS_LAPACK" OFF)
CMAKE_DEPENDENT_OPTION(NEKTAR_USE_MKL
"Use the Intel Math Kernel Library (MKL) for BLAS and Lapack support." OFF
"NEKTAR_USE_BLAS_LAPACK" OFF)
CMAKE_DEPENDENT_OPTION(NEKTAR_USE_SYSTEM_BLAS_LAPACK
"Use the system provided blas and lapack libraries" ON
"NEKTAR_USE_BLAS_LAPACK; UNIX; NOT APPLE; NOT NEKTAR_USE_OPENBLAS; NOT NEKTAR_USE_MKL; NOT NEKTAR_USE_ACML; NOT NEKTAR_USE_ACCELERATE_FRAMEWORK" OFF)
"NOT NEKTAR_USE_SYSTEM_BLAS_LAPACK" OFF)
CMAKE_DEPENDENT_OPTION(NEKTAR_USE_ACCELERATE_FRAMEWORK
"Use the Mac Accelerate Framework for BLAS and Lapack support." ON
"NEKTAR_USE_BLAS_LAPACK; APPLE" OFF)
"NOT NEKTAR_USE_SYSTEM_BLAS_LAPACK; APPLE" OFF)
CMAKE_DEPENDENT_OPTION(NEKTAR_USE_WIN32_LAPACK
"Use Win32 Lapack provided with the Third Party Distribution."
ON "NEKTAR_USE_BLAS_LAPACK; WIN32" OFF)
ON "NOT NEKTAR_USE_SYSTEM_BLAS_LAPACK; WIN32" OFF)
# Memory pools
OPTION(NEKTAR_USE_MEMORY_POOLS
......@@ -251,7 +248,6 @@ INCLUDE (ThirdPartyFFTW)
INCLUDE (ThirdPartyArpack)
INCLUDE (ThirdPartyMPI)
INCLUDE (ThirdPartyVTK)
INCLUDE (ThirdPartySMV)
INCLUDE (ThirdPartyOCE)
INCLUDE (ThirdPartyTetGen)
INCLUDE (ThirdPartyCCM)
......@@ -260,32 +256,18 @@ INCLUDE (Doxygen)
IF( NEKTAR_USE_MKL )
INCLUDE (FindMKL)
SET(NEKTAR_USING_BLAS TRUE)
SET(NEKTAR_USING_LAPACK TRUE)
SET(NEKTAR_USING_MKL TRUE)
ENDIF( NEKTAR_USE_MKL )
IF( NEKTAR_USE_OPENBLAS )
INCLUDE (FindOpenBlas)
SET(NEKTAR_USING_OPENBLAS TRUE)
ENDIF( NEKTAR_USE_OPENBLAS )
IF( NEKTAR_USE_SMV )
INCLUDE (FindSMV)
SET(NEKTAR_USING_SMV TRUE)
ADD_DEFINITIONS(-DNEKTAR_USING_SMV)
ENDIF( NEKTAR_USE_SMV )
IF( NEKTAR_USE_ACCELERATE_FRAMEWORK )
INCLUDE (FindAccelerateFramework)
ENDIF( NEKTAR_USE_ACCELERATE_FRAMEWORK )
IF( NEKTAR_USE_ACML )
INCLUDE (FindACML)
SET(NEKTAR_USING_BLAS TRUE)
SET(NEKTAR_USING_LAPACK TRUE)
SET(NEKTAR_USING_ACML TRUE)
ADD_DEFINITIONS(-DUSE_ACML)
ENDIF( NEKTAR_USE_ACML )
IF( NEKTAR_USE_WIN32_LAPACK )
......@@ -294,24 +276,12 @@ ENDIF( NEKTAR_USE_WIN32_LAPACK )
IF( NEKTAR_USE_SYSTEM_BLAS_LAPACK )
INCLUDE(ThirdPartyBlasLapack)
SET(NEKTAR_USING_BLAS TRUE)
SET(NEKTAR_USING_LAPACK TRUE)
ENDIF( NEKTAR_USE_SYSTEM_BLAS_LAPACK )
IF( NEKTAR_USE_BLAS_LAPACK )
SET(NEKTAR_USING_BLAS TRUE)
SET(NEKTAR_USING_LAPACK TRUE)
ADD_DEFINITIONS( -DNEKTAR_USING_LAPACK -DNEKTAR_USING_BLAS )
ENDIF( NEKTAR_USE_BLAS_LAPACK )
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 )
......@@ -343,25 +313,26 @@ ENDIF (APPLE)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR})
# Build active components
# Build active components. Add utilities and solvers directories first, because
# that allows us to detect library dependencies automatically.
IF (NEKTAR_BUILD_LIBRARY)
SET(NEKTAR++_LIBRARIES SolverUtils LibUtilities StdRegions SpatialDomains LocalRegions
MultiRegions Collections GlobalMapping FieldUtils NekMeshUtils)
INCLUDE_DIRECTORIES(library)
ENDIF()
INCLUDE_DIRECTORIES(utilities)
ADD_SUBDIRECTORY(utilities)
INCLUDE_DIRECTORIES(solvers)
ADD_SUBDIRECTORY(solvers)
IF (NEKTAR_BUILD_LIBRARY)
# List of Nektar++ libraries will be rebuilt every configuration.
SET(NEKTAR++_LIBRARIES "" CACHE INTERNAL "")
ADD_SUBDIRECTORY(library)
INSTALL(EXPORT Nektar++Libraries DESTINATION ${LIB_DIR}/cmake COMPONENT dev)
ENDIF (NEKTAR_BUILD_LIBRARY)
IF (NEKTAR_BUILD_SOLVERS)
INCLUDE_DIRECTORIES(solvers)
ADD_SUBDIRECTORY(solvers)
ENDIF(NEKTAR_BUILD_SOLVERS)
IF (NEKTAR_BUILD_UTILITIES)
INCLUDE_DIRECTORIES(utilities)
ADD_SUBDIRECTORY(utilities)
ENDIF (NEKTAR_BUILD_UTILITIES)
IF (NEKTAR_BUILD_TESTS)
INCLUDE_DIRECTORIES(tests)
ADD_SUBDIRECTORY(tests)
......@@ -393,17 +364,18 @@ INSTALL(FILES ${CMAKE_BINARY_DIR}/Nektar++Config.cmake
# Install ThirdParty headers to subdirectory of ${NEKTAR_INCLUDE_DIR}
INSTALL(DIRECTORY ${TPDIST}/include/
DESTINATION ${NEKTAR_INCLUDE_DIR}/ThirdParty
COMPONENT ThirdParty
COMPONENT dev
)
# Install ThirdParty libraries into ${NEKTAR_LIB_DIR}
# Install ThirdParty libraries into ${NEKTAR_LIB_DIR}. These are shipped with
# the LibUtilities library.
INSTALL(DIRECTORY ${TPDIST}/lib/
DESTINATION ${NEKTAR_LIB_DIR}
COMPONENT ThirdParty
COMPONENT libutilities
)
ADD_SUBDIRECTORY(docs)
IF(NEKTAR_BUILD_PACKAGES)
add_subdirectory(pkg)
ADD_SUBDIRECTORY(pkg)
ENDIF(NEKTAR_BUILD_PACKAGES)
ADD_SUBDIRECTORY(docs)
SET(GSMPI_SEARCH_PATHS
${CMAKE_SOURCE_DIR}/ThirdParty/gsmpi-1.2/
${CMAKE_SOURCE_DIR}/ThirdParty/gsmpi-1.2/build/
${CMAKE_SOURCE_DIR}/../ThirdParty/gsmpi-1.2/
${CMAKE_SOURCE_DIR}/../ThirdParty/gsmpi-1.2/build
${CMAKE_SOURCE_DIR}/ThirdParty/dist/lib
${CMAKE_SOURCE_DIR}/../ThirdParty/dist/lib)
FIND_LIBRARY(GSMPI_LIBRARY NAMES gsmpi PATHS ${GSMPI_SEARCH_PATHS})
SET(GSMPI_FOUND FALSE)
IF (GSMPI_LIBRARY)
SET(GSMPI_FOUND TRUE)
MARK_AS_ADVANCED(GSMPI_LIBRARY)
ENDIF (GSMPI_LIBRARY)
IF (GSMPI_FOUND)
IF (NOT GSMPI_FIND_QUIETLY)
MESSAGE(STATUS "Found GSMPI")
ENDIF (NOT GSMPI_FIND_QUIETLY)
ELSE(GSMPI_FOUND)
IF (GSMPI_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find GSLib")
ENDIF (GSMPI_FIND_REQUIRED)
ENDIF (GSMPI_FOUND)
......@@ -198,7 +198,7 @@ show :
else (WIN32)
set (libname ${name})
endif (WIN32)
find_library (PETSC_LIBRARY_${suffix} NAMES ${libname} HINTS ${petsc_lib_dir} NO_DEFAULT_PATH)
find_library (PETSC_LIBRARY_${suffix} NAMES ${libname} ${libname}_real HINTS ${petsc_lib_dir} NO_DEFAULT_PATH)
set (PETSC_LIBRARIES_${suffix} "${PETSC_LIBRARY_${suffix}}")
mark_as_advanced (PETSC_LIBRARY_${suffix})
endmacro (PETSC_FIND_LIBRARY suffix name)
......
......@@ -25,7 +25,7 @@
# Always runs the given test, use this when you need to re-run tests
# because parent variables have made old cache entries stale. The LANGUAGE
# variable is either C or CXX indicating which compiler the test should
# use.
# use.
# MULTIPASS_C_SOURCE_RUNS (Name INCLUDES LIBRARIES SOURCE RUNS)
# DEPRECATED! This is only included for backwards compatability. Use
# the more general MULTIPASS_SOURCE_RUNS instead.
......@@ -46,7 +46,7 @@ macro (FIND_PACKAGE_MULTIPASS _name _current)
# The name of the stored value for the given state
set (_stored_var PACKAGE_MULTIPASS_${_NAME}_${_state})
if (NOT "${${_stored_var}}" STREQUAL "${${_NAME}_${_state}}")
set (_states_current "NO")
set (_states_current "NO")
endif (NOT "${${_stored_var}}" STREQUAL "${${_NAME}_${_state}}")
set (${_stored_var} "${${_NAME}_${_state}}" CACHE INTERNAL "Stored state for ${_name}." FORCE)
list (REMOVE_AT _args 0)
......@@ -68,7 +68,7 @@ macro (FIND_PACKAGE_MULTIPASS _name _current)
if (_cmd STREQUAL "DEPENDENTS")
list (REMOVE_AT _args 0)
foreach (dep ${_args})
set (${_NAME}_${dep} "NOTFOUND" CACHE INTERNAL "Cleared" FORCE)
set (${_NAME}_${dep} "NOTFOUND" CACHE INTERNAL "Cleared" FORCE)
endforeach (dep)
endif (_cmd STREQUAL "DEPENDENTS")
set (${_NAME}_FOUND "NOTFOUND" CACHE INTERNAL "Cleared" FORCE)
......
SET(SMV_SEARCH_PATHS
${CMAKE_SOURCE_DIR}/ThirdParty/libsmv/build/lib
${CMAKE_SOURCE_DIR}/../ThirdParty/libsmv/build/lib
${CMAKE_SOURCE_DIR}/ThirdParty/dist/build/lib
${CMAKE_SOURCE_DIR}/../ThirdParty/dist/build/lib)
FIND_PATH(SMV_INCLUDE_DIR NAMES smv.h PATHS ${SMV_SEARCH_PATHS})
FIND_LIBRARY(SMV_LIBRARY NAMES smv PATHS ${SMV_SEARCH_PATHS})
SET(SMV_FOUND FALSE)
IF (SMV_LIBRARY)
SET(SMV_FOUND TRUE)
INCLUDE_DIRECTORIES(${SMV_INCLUDE_DIR})
MARK_AS_ADVANCED(SMV_LIBRARY)
MARK_AS_ADVANCED(SMV_INCLUDE_DIR)
ENDIF (SMV_LIBRARY)
IF (SMV_FOUND)
IF (NOT SMV_FIND_QUIETLY)
MESSAGE(STATUS "Found SMV: ${SMV_INCLUDE_DIR}")
ENDIF (NOT SMV_FIND_QUIETLY)
ELSE(SMV_FOUND)
IF (SMV_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find SMV")
ENDIF (SMV_FIND_REQUIRED)
ENDIF (SMV_FOUND)
SET(XXT_SEARCH_PATHS
${CMAKE_SOURCE_DIR}/ThirdParty/gsmpi-1.2/
${CMAKE_SOURCE_DIR}/ThirdParty/gsmpi-1.2/build/
${CMAKE_SOURCE_DIR}/../ThirdParty/gsmpi-1.2/
${CMAKE_SOURCE_DIR}/../ThirdParty/gsmpi-1.2/build
${CMAKE_SOURCE_DIR}/ThirdParty/dist/lib
${CMAKE_SOURCE_DIR}/../ThirdParty/dist/lib)
FIND_LIBRARY(XXT_LIBRARY NAMES xxt PATHS ${XXT_SEARCH_PATHS})
SET(XXT_FOUND FALSE)
IF (XXT_LIBRARY)
SET(XXT_FOUND TRUE)
MARK_AS_ADVANCED(XXT_LIBRARY)
ENDIF (XXT_LIBRARY)
IF (XXT_FOUND)
IF (NOT XXT_FIND_QUIETLY)
MESSAGE(STATUS "Found XXT")
ENDIF (NOT XXT_FIND_QUIETLY)
ELSE(XXT_FOUND)
IF (XXT_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find XXT")
ENDIF (XXT_FIND_REQUIRED)
ENDIF (XXT_FOUND)
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})
##
## NektarCommon.cmake
##
## Frequently used Nektar++ CMake configuration macros and functions
##
#
# THIRDPARTY_LIBRARY(varname DESCRIPTION <description> [STATIC|SHARED] lib1 [lib2]...)
#
# Updates a variable containing the name of a third-party shared or static
# library to point to an absolute path defining its location instead of adding
# `-llibname` to the linker flags. This avoids the issue of e.g. linking against
# an outdated system zlib installation.
#
# Arguments:
# - `varname`: variable name containing the third-party library name. On
# output will be altered to update the correct path.
# - `DESCRIPTION`: a brief description of the variable (used in the SET
# command).
# - `SHARED`: if the library will be built as a shared library
# - `STATIC`: if the library will be built as a static library
#
MACRO(THIRDPARTY_LIBRARY varname)
CMAKE_PARSE_ARGUMENTS(TPLIB "" "DESCRIPTION" "STATIC;SHARED" ${ARGN})
IF(TPLIB_SHARED)
SET(LIBTYPE "SHARED")
SET(TPLIBS ${TPLIB_SHARED})
ELSEIF(TPLIB_STATIC)
SET(LIBTYPE "STATIC")
SET(TPLIBS ${TPLIB_STATIC})
ENDIF()
FOREACH (lib ${TPLIBS})
LIST(APPEND tmplist "${TPDIST}/lib/${CMAKE_${LIBTYPE}_LIBRARY_PREFIX}${lib}${CMAKE_${LIBTYPE}_LIBRARY_SUFFIX}")
ENDFOREACH()
SET(${varname} ${tmplist} CACHE FILEPATH ${TPLIB_DESCRIPTION} FORCE)
UNSET(tmplist)
UNSET(LIBTYPE)
UNSET(TPLIBS)
UNSET(TPLIB_SHARED)
UNSET(TPLIB_STATIC)
UNSET(lib)
ENDMACRO()
#
# SET_COMMON_PROPERTIES(target)
#
# Sets properties that are common to either library or executable targets. This
# includes:
#
# - Name suffixes: -g for debug, -ms for minsize, -rg for release w/debug.
# - Disable some MSVC compiler warnings
# - Add -pg flag if NEKTAR_ENABLE_PROFILE is switched on and we're using gcc
# - Add compiler definitions and appropriate warning levels to gcc-like
# compilers (e.g. clang)
# - Define versions for the target
# - Make sure that -fPIC is enabled for library code if building shared
# libraries.
#
# Arguments:
# - `target`: target name
#
MACRO(SET_COMMON_PROPERTIES name)
SET_TARGET_PROPERTIES(${name} PROPERTIES DEBUG_POSTFIX -g)
SET_TARGET_PROPERTIES(${name} PROPERTIES MINSIZEREL_POSTFIX -ms)
......@@ -18,8 +75,8 @@ MACRO(SET_COMMON_PROPERTIES name)
# warning)" warning (4800)
# 4250 - Inheritance via dominance. Nektar appears to be handling the
# diamond correctly.
# 4373 - Overriding a virtual method with parameters that differ by const
# or volatile conforms to the standard.
# 4373 - Overriding a virtual method with parameters that differ by const
# or volatile conforms to the standard.
# /Za is necessary to prevent temporaries being bound to reference
# parameters.
SET_TARGET_PROPERTIES(${name} PROPERTIES COMPILE_FLAGS
......@@ -29,14 +86,14 @@ MACRO(SET_COMMON_PROPERTIES name)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
ENDIF( MSVC )
IF( ${CMAKE_COMPILER_IS_GNUCXX} )
IF(NEKTAR_ENABLE_PROFILE)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg")
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -pg")
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -pg")
IF (${CMAKE_COMPILER_IS_GNUCXX})
IF(NEKTAR_ENABLE_PROFILE)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg")
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -pg")
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -pg")
SET(LINK_FLAGS "${LINK_FLAGS} -pg")
ENDIF(NEKTAR_ENABLE_PROFILE)
ENDIF( ${CMAKE_COMPILER_IS_GNUCXX} )
ENDIF()
# Prevent including these common flags multiple times.
IF (NOT ${CMAKE_CXX_FLAGS_DEBUG} MATCHES ".*DNEKTAR_DEBUG.*")
......@@ -47,18 +104,18 @@ MACRO(SET_COMMON_PROPERTIES name)
"${CMAKE_CXX_FLAGS_DEBUG} -DNEKTAR_FULLDEBUG")
ENDIF( NEKTAR_FULL_DEBUG)
IF( NOT MSVC )
IF(NOT MSVC)
SET(CMAKE_CXX_FLAGS_DEBUG
"${CMAKE_CXX_FLAGS_DEBUG} -Wall -Wno-deprecated -Wno-sign-compare")
SET(CMAKE_CXX_FLAGS_RELEASE
"${CMAKE_CXX_FLAGS_RELEASE} -Wall -Wno-deprecated -Wno-sign-compare")
"${CMAKE_CXX_FLAGS_RELEASE} -Wall -Wno-deprecated -Wno-sign-compare")
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO
"${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -Wall -Wno-deprecated -Wno-sign-compare")
"${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -Wall -Wno-deprecated -Wno-sign-compare")
IF (NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang")
SET(CMAKE_CXX_FLAGS_DEBUG
"${CMAKE_CXX_FLAGS_DEBUG} -fpermissive")
ENDIF()
ENDIF( NOT MSVC)
ENDIF (NOT MSVC)
# Define version
SET_PROPERTY(TARGET ${name}
......@@ -76,91 +133,119 @@ MACRO(SET_COMMON_PROPERTIES name)