Commit 6747dd8f authored by GILLES Sebastien's avatar GILLES Sebastien

#1217 Beginning compilation with CMake: so far it compiles Utilities with...

#1217 Beginning compilation with CMake: so far it compiles Utilities with compilation options hardcoded.
parent 174d062a
# A minimum version for cmake command is required.
cmake_minimum_required(VERSION 3.8)
set (CMAKE_CXX_STANDARD 17)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
include(CustomCommands)
include(Paths)
MESSAGE( STATUS "${OPS_DIR}: " ${OPS_DIR} )
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/Sources /
${OPS_DIR} /
${SELDON_DIR} /
${OPEN_MPI_INCL_DIR} /
${PETSC_GENERAL_INCL_DIR} /
${PETSC_DEBUG_INCL_DIR} /
${PARMETIS_INCL_DIR} /
${LUA_INCL_DIR} /
${BOOST_INCL_DIR}
)
set(UTILITIES_SRC /
Sources/Utilities/Filesystem/Folder.cpp /
Sources/Utilities/Filesystem/File.cpp /
Sources/Utilities/TimeKeep/TimeKeep.cpp /
Sources/Utilities/Exceptions/Exception.cpp /
Sources/Utilities/Exceptions/PrintAndAbort.cpp /
Sources/Utilities/Exceptions/Factory.cpp /
Sources/Utilities/InputParameterList/Definitions.cpp /
Sources/Utilities/InputParameterList/ExtendedOps.cpp /
Sources/Utilities/InputParameterList/Internal/TupleIteration/Impl/PrepareDefaultEntry.cpp /
Sources/Utilities/InputParameterList/Internal/TupleIteration/Traits/Traits.cpp /
Sources/Utilities/InputParameterList/Internal/ManualParsing/ManualParsing.cpp /
Sources/Utilities/InputParameterList/Exceptions/InputParameterList.cpp /
Sources/Utilities/Singleton/Exceptions/Singleton.cpp /
Sources/Utilities/Environment/EnvironmentVariable.cpp /
Sources/Utilities/String/EmptyString.cpp /
Sources/Utilities/String/String.cpp /
Sources/Utilities/Containers/BoolArray.cpp)
set(THIRD_PARTY_SRC /
Sources/ThirdParty/Wrappers/Mpi/Exceptions/Mpi.cpp /
Sources/ThirdParty/Wrappers/Mpi/MacroEncapsulation/Op.cpp /
Sources/ThirdParty/Wrappers/Mpi/MacroEncapsulation/Comm.cpp /
Sources/ThirdParty/Wrappers/Mpi/Mpi.cpp /
Sources/ThirdParty/Wrappers/Parmetis/Exceptions/Parmetis.cpp /
Sources/ThirdParty/Wrappers/Parmetis/Parmetis.cpp /
Sources/ThirdParty/Wrappers/Seldon/MatrixOperations.cpp /
Sources/ThirdParty/Wrappers/Seldon/SeldonFunctions.cpp /
Sources/ThirdParty/Wrappers/Petsc/Viewer.cpp /
Sources/ThirdParty/Wrappers/Petsc/Petsc.cpp /
Sources/ThirdParty/Wrappers/Petsc/Print.cpp /
Sources/ThirdParty/Wrappers/Petsc/Solver/Internal/Convergence/KspConvergenceReason.cpp /
Sources/ThirdParty/Wrappers/Petsc/Solver/Internal/Convergence/SnesConvergenceReason.cpp /
Sources/ThirdParty/Wrappers/Petsc/Solver/Internal/Solver.cpp /
Sources/ThirdParty/Wrappers/Petsc/Solver/Instantiations/Umfpack.cpp /
Sources/ThirdParty/Wrappers/Petsc/Solver/Instantiations/Gmres.cpp /
Sources/ThirdParty/Wrappers/Petsc/Solver/Instantiations/Mumps.cpp /
Sources/ThirdParty/Wrappers/Petsc/Solver/Snes.cpp /
Sources/ThirdParty/Wrappers/Petsc/Exceptions/Petsc.cpp /
Sources/ThirdParty/Wrappers/Petsc/Vector/AccessGhostContent.cpp /
Sources/ThirdParty/Wrappers/Petsc/Vector/Internal/VectorHelper.cpp /
Sources/ThirdParty/Wrappers/Petsc/Vector/Internal/CheckUpdateGhostManager.cpp /
Sources/ThirdParty/Wrappers/Petsc/Vector/Vector.cpp /
Sources/ThirdParty/Wrappers/Petsc/Vector/AccessVectorContent.cpp /
Sources/ThirdParty/Wrappers/Petsc/Matrix/MatrixPattern.cpp /
Sources/ThirdParty/Wrappers/Petsc/Matrix/Internal/BaseMatrix.cpp /
Sources/ThirdParty/Wrappers/Petsc/Matrix/MatrixInfo.cpp /
Sources/ThirdParty/Wrappers/Petsc/Matrix/Matrix.cpp /
Sources/ThirdParty/Wrappers/Libmesh/Libmesh.cpp
)
add_library(utilities STATIC ${UTILITIES_SRC} ${THIRD_PARTY_SRC})
# add a compiler flag only if it is accepted
macro(add_cxx_compiler_flag _flag)
string(REPLACE "-" "_" _flag_var ${_flag})
check_cxx_accepts_flag("${_flag}" CXX_COMPILER_${_flag_var}_OK)
if(CXX_COMPILER_${_flag_var}_OK)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_flag}")
endif()
endmacro()
# Choose C and C++ compilers. You might also specifies here clang static analyzer (paths to ccc-analyzer and c++-analyzer respectively) to perform static analysis of the code.
set(COMPILER 'clang )
set(COMPILER_DIRECTORY 'clang )
set(CC /Users/Shared/LibraryVersions/clang/Openmpi/bin/mpicc )
set(CXX /Users/Shared/LibraryVersions/clang/Openmpi/bin/mpic++ )
# Choose either 'debug' or 'release'.
set(MODE 'debug )
# Choose either 'static' or 'shared'.
set(LIBRARY_TYPE 'static )
# Whether specific macros should be activated or not.
# If true, add a (costly) method that gives an hint whether an UpdateGhost() call was relevant or not.
set(MOREFEM_CHECK_UPDATE_GHOSTS_CALL_RELEVANCE False)
# If true, TimeKeep gains the ability to track times between each call of PrintTimeElapsed(). If not, PrintTimeElapsed() is flatly ignored.
set(MOREFEM_EXTENDED_TIME_KEEP False)
# If true, there are additional checks that no nan and inf appears in the code. Even if False, solver always check for the validity of its solution (if a nan or an inf is present the SolveLinear() or SolveNonLinear() operation throws with a dedicated Petsc error). Advised in debug mode and up to you in release mode.
set(MOREFEM_CHECK_NAN_AND_INF True)
# OpenMPI libary.
set(OPEN_MPI_INCL_DIR /Users/Shared/LibraryVersions/clang/Openmpi/include )
set(OPEN_MPI_LIB_DIR /Users/Shared/LibraryVersions/clang/Openmpi/lib )
# BLAS Library.
set(BLAS_CUSTOM_LINKER True)
set(BLAS_LIB_DIR None)
set(BLAS_LIB '-framework Accelerate )
# Petsc library.
set(PETSC_GENERAL_INCL_DIR /Users/Shared/LibraryVersions/clang/Petsc/include )
set(PETSC_DEBUG_INCL_DIR /Users/Shared/LibraryVersions/clang/Petsc/debug/include )
set(PETSC_RELEASE_INCL_DIR /Users/Shared/LibraryVersions/clang/Petsc/release/include )
set(PETSC_DEBUG_LIB_DIR /Users/Shared/LibraryVersions/clang/Petsc/debug/lib )
set(PETSC_RELEASE_LIB_DIR /Users/Shared/LibraryVersions/clang/Petsc/release/lib )
# Parmetis library.
set(PARMETIS_INCL_DIR /Users/Shared/LibraryVersions/clang/Parmetis/include )
set(PARMETIS_LIB_DIR /Users/Shared/LibraryVersions/clang/Parmetis/lib )
# Lua library.
set(LUA_INCL_DIR /Users/Shared/LibraryVersions/clang/Lua/include )
set(LUA_LIB_DIR /Users/Shared/LibraryVersions/clang/Lua/lib )
# Boost library
set(BOOST_INCL_DIR /Users/Shared/LibraryVersions/clang/Boost/include )
set(BOOST_LIB_DIR /Users/Shared/LibraryVersions/clang/Boost/lib )
# Ops directory (source files are looked there and library is compiled by Morefem).
set(OPS_DIR /Users/Shared/LibraryVersions/clang/Ops )
# Seldon directory (source files are looked there and library is compiled by Morefem).
set(SELDON_DIR /Users/Shared/LibraryVersions/clang/Seldon )
# If you want to couple Morefem with Phillips library. None in most of the cases!
set(PHILLIPS_LINKER False)
set(PHILLIPS_DIR None)
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