diff --git a/CMakeLists.txt b/CMakeLists.txt index 299c436ed49bd2cd87ee59fea35df9dbca220d5d..f0151a3825e36eb86dc3be6505f1767210924663 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,16 +4,16 @@ ## ## Contents: ## - definition of build options -## - compiler variables ( c++ standard, warnings etc. ) +## - compiler variables ( c++ standard, warnings etc. ) ## - Finding of service libraries. Required: boost, Optional: MPI, PE, METIS ## the include paths are set, and the libraries are added to variable SERVICE_LIBS ## - Subdirectory cmake lists are called -## -> src/ this folder contains all modules, each module (that contains c or cpp files) is linked to a -## static library. Dependencies between these shared libraries are tracked manually, +## -> src/ this folder contains all modules, each module (that contains c or cpp files) is linked to a +## static library. Dependencies between these shared libraries are tracked manually, ## for more information see waLBerlaModuleDependencySystem.cmake ## -> tests/ Same subdirectories as src/ folder. Contains tests for each module ## - Export of variables into internal cache variables, for usage in applications or projects that use walberla as -## subdirectory. Variables containing the service-libs, +## subdirectory. Variables containing the service-libs, ## ############################################################################################################################ @@ -28,7 +28,7 @@ CMAKE_MINIMUM_REQUIRED (VERSION 2.8) -PROJECT ( walberla ) +PROJECT ( walberla ) set ( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${walberla_SOURCE_DIR}/cmake ) @@ -41,12 +41,12 @@ if( CMAKE_VERSION VERSION_LESS 2.8.3 ) else() include( CMakeParseArguments ) endif() - + # Enable CTest enable_testing() include( CTest ) - + ############################################################################################################################ @@ -62,20 +62,20 @@ include( CTest ) # Build options option ( WALBERLA_DOUBLE_ACCURACY "Floating point accuracy, defaults to double" ON ) option ( WALBERLA_ENABLE_GUI "Compile with GUI" ) - + option ( WALBERLA_BUILD_TESTS "Build Testcases" ) option ( WALBERLA_BUILD_BENCHMARKS "Build Benchmarks" ON ) option ( WALBERLA_BUILD_TOOLS "Build Tools" ) option ( WALBERLA_BUILD_TUTORIALS "Build Tutorials" ON ) - + option ( WALBERLA_BUILD_WITH_MPI "Build with MPI" ON ) option ( WALBERLA_BUILD_WITH_METIS "Build with metis graph partitioner" OFF ) - + option ( WALBERLA_BUILD_WITH_GPROF "Enables gprof" ) option ( WALBERLA_BUILD_WITH_GCOV "Enables gcov" ) option ( WALBERLA_BUILD_WITH_LTO "Enable link time optimizations" ) -option ( WALBERLA_BUILD_WITH_OPENMP "Enable OpenMP support" ) -option ( WALBERLA_BUILD_WITH_PYTHON "Support for embedding Python" ) +option ( WALBERLA_BUILD_WITH_OPENMP "Enable OpenMP support" ) +option ( WALBERLA_BUILD_WITH_PYTHON "Support for embedding Python" ) option ( WALBERLA_BUILD_WITH_PYTHON_MODULE "Build waLBerla python module" ) option ( WALBERLA_BUILD_WITH_PYTHON_LBM "Include LBM module into python module" OFF ) @@ -83,9 +83,9 @@ option ( WALBERLA_BUILD_WITH_LIKWID_MARKERS "Compile in markers for likwid-perfc option ( WALBERLA_BUILD_WITH_FASTMATH "Fast math" ) - + option ( WALBERLA_SIMD_FORCE_SCALAR "Do not use SIMD operations even when available" OFF ) - + option ( WALBERLA_BUFFER_DEBUG "Type checking for BufferSystem ( slow )" OFF ) option ( WALBERLA_NO_OUTDATED_FEATURES "Show warning/errors when outdated features " @@ -108,7 +108,7 @@ endif() SET_PROPERTY( CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS Debug Release DebugOptimized RelWithDebInfo MinSizeRel ) # Debugging options ) -option ( WALBERLA_STL_BOUNDS_CHECKS "Use debug capabilites of libstd++: iterator and bounds checks" ) +option ( WALBERLA_STL_BOUNDS_CHECKS "Use debug capabilites of libstd++: iterator and bounds checks" ) # Warning options option ( WARNING_DISABLE "Disables additional compiler warnings" OFF ) @@ -122,7 +122,7 @@ option ( WALBERLA_SANITIZE_UNDEFINED "Enables undefined behavior sanitizer in g # Every folder that is listed here can contain modules or tests # this can be extended by applications to have own modules -# Here the src/ folder is added to this list, where all modules are located +# Here the src/ folder is added to this list, where all modules are located list( APPEND WALBERLA_MODULE_DIRS "${walberla_SOURCE_DIR}/src" "${walberla_SOURCE_DIR}/tests" ) list( REMOVE_DUPLICATES WALBERLA_MODULE_DIRS ) set ( WALBERLA_MODULE_DIRS ${WALBERLA_MODULE_DIRS} CACHE INTERNAL "All folders that contain modules or tests" ) @@ -172,7 +172,7 @@ else() option ( WALBERLA_CXX_COMPILER_IS_GNU "Use gnu compiler" OFF ) endif() mark_as_advanced ( WALBERLA_CXX_COMPILER_IS_GNU ) - + # Check for Visual Studio if ( MSVC ) option ( WALBERLA_CXX_COMPILER_IS_MSVC "Use Visual Studio compiler" ON ) @@ -339,32 +339,32 @@ if( WALBERLA_OPTIMIZE_FOR_LOCALHOST ) add_flag ( CMAKE_C_FLAGS "-xhost" ) endif() endif() -endif() +endif() -# warning flags +# warning flags if( WALBERLA_CXX_COMPILER_IS_INTEL ) # system headers are also supported by intel, but cmake does not recognize that set( CMAKE_INCLUDE_SYSTEM_FLAG_CXX "-isystem " ) add_flag ( CMAKE_CXX_FLAGS "-wd2928,2504,2259,1682,597" ) elseif( WALBERLA_CXX_COMPILER_IS_GNU ) - add_flag ( CMAKE_CXX_FLAGS "-Wfloat-equal -Wextra" ) + add_flag ( CMAKE_CXX_FLAGS "-Wfloat-equal -Wextra" ) elseif( WALBERLA_CXX_COMPILER_IS_NEC ) add_flag ( CMAKE_CXX_FLAGS "-wall" ) endif() if ( WARNING_PEDANTIC AND WALBERLA_CXX_COMPILER_IS_GNU ) - add_flag ( CMAKE_CXX_FLAGS "-pedantic" ) + add_flag ( CMAKE_CXX_FLAGS "-pedantic" ) endif ( ) - + # omit deprecated warnings -if( NOT WARNING_DEPRECATED) +if( NOT WARNING_DEPRECATED) if( WALBERLA_CXX_COMPILER_IS_INTEL ) add_flag( CMAKE_CXX_FLAGS "-wd1478" ) # Disable compiler warning # 1478: "declared as deprecated" elseif( WALBERLA_CXX_COMPILER_IS_GNU OR WALBERLA_CXX_COMPILER_IS_CLANG ) add_flag ( CMAKE_CXX_FLAGS "-Wno-deprecated-declarations") endif() endif() - + # Treat warnings as errors if ( WARNING_ERROR ) if( WALBERLA_CXX_COMPILER_IS_GNU OR WALBERLA_CXX_COMPILER_IS_INTEL OR WALBERLA_CXX_COMPILER_IS_CLANG ) @@ -394,15 +394,15 @@ if ( WALBERLA_BUILD_WITH_FASTMATH ) if ( WALBERLA_CXX_COMPILER_IS_INTEL ) add_flag( CMAKE_CXX_FLAGS "-fp-model fast=2 -no-prec-sqrt -no-prec-div" ) endif() - + if ( WALBERLA_CXX_COMPILER_IS_GNU OR WALBERLA_CXX_COMPILER_IS_CLANG ) add_flag( CMAKE_CXX_FLAGS "-ffast-math") endif() - + if( WALBERLA_CXX_COMPILER_IS_MSVC ) add_flag( CMAKE_CXX_FLAGS "/fp:fast" ) endif() -endif() +endif() # Xcode generator disables -isystem flag, even though current versions of Xcode support it if(CMAKE_GENERATOR STREQUAL "Xcode") @@ -459,33 +459,33 @@ if ( WALBERLA_CXX_COMPILER_IS_MSVC ) if( WALBERLA_VS_MULTI_PROCESS_BUILD ) add_flag ( CMAKE_CXX_FLAGS "-MP" ) # enable multi-threaded compiling endif() - + add_definitions ( "-DNOMINMAX" ) # Disable Min/Max-Macros add_definitions ( "-D_WIN32_WINNT=0x501" ) # Minimum Windows versions is Windows XP add_definitions ( "-DWINVER=0x501" ) # Minimum Windows versions is Windows XP add_definitions ( "-D_CRT_SECURE_NO_WARNINGS" ) # disable warnings promoting Microsoft's security enhanced CRT add_definitions ( "-D_SCL_SECURE_NO_WARNINGS" ) # disable warnings triggered by Microsoft's checked iterators - add_flag ( CMAKE_CXX_FLAGS "-W4" ) # set warning level to maximum + add_flag ( CMAKE_CXX_FLAGS "-W4" ) # set warning level to maximum add_flag ( CMAKE_CXX_FLAGS "-bigobj" ) # enable big object files add_flag ( CMAKE_CXX_FLAGS "-wd4127" ) # disable compiler warning C4127: "conditional expression is constant" add_flag ( CMAKE_CXX_FLAGS "-wd4512" ) # disable compiler warning C4512: "assignment operator could not be generated" - add_flag ( CMAKE_CXX_FLAGS "-wd4913" ) # disable compiler warning C4512: "user defined binary operator ',' exists but + add_flag ( CMAKE_CXX_FLAGS "-wd4913" ) # disable compiler warning C4512: "user defined binary operator ',' exists but # no overload could convert all operands, default built-in binary operator ',' # used" add_flag ( CMAKE_CXX_FLAGS "-wd4702" ) # disable compiler warning C4702: "unreachable code" add_flag ( CMAKE_CXX_FLAGS "-wd4505" ) # disable compiler warning C4505: "unreferenced local function has been removed" add_flag ( CMAKE_CXX_FLAGS "-wd4503" ) # disable compiler warning C4503: "'identifier' : decorated name length exceeded, name was truncated" - + if ( WARNING_ERROR ) add_flag ( CMAKE_CXX_FLAGS "-WX" ) # Treat warnings as errors endif ( ) - + if( NOT WARNING_DEPRECATED) add_definitions( "-D_CRT_SECURE_NO_DEPRECATE" ) add_definitions( "-D_SCL_SECURE_NO_DEPRECATE" ) add_flag ( CMAKE_CXX_FLAGS "-wd4996" ) # Disable compiler warning C4996: "declared as deprecated" endif() - + endif ( ) ############################################################################################################################ @@ -498,7 +498,7 @@ endif ( ) ## ############################################################################################################################# if ( WALBERLA_BUILD_WITH_PYTHON ) - + set ( waLBerla_REQUIRED_MIN_PYTHON_VERSION "2.7") if( WALBERLA_CXX_COMPILER_IS_MSVC ) find_package( PythonLibs QUIET REQUIRED) @@ -506,15 +506,15 @@ if ( WALBERLA_BUILD_WITH_PYTHON ) # For Linux the standard find script does not work properly: # Python is configured here using the command "python-config" which has to be on the PATH if ( NOT PYTHONLIBS_VERSION_STRING ) - find_program( PYTHON_CONFIG_EXE NAMES python3.5m-config python3.5-config - python3.4m-config python3.4-config - python3.3m-config python3.3-config + find_program( PYTHON_CONFIG_EXE NAMES python3.5m-config python3.5-config + python3.4m-config python3.4-config + python3.3m-config python3.3-config python3m-config python3-config python2.7-config python2-config python-config ) if ( NOT PYTHON_CONFIG_EXE ) message( WARNING "Found python but no python-config, python-devel package not installed?" ) - else() + else() execute_process( COMMAND ${PYTHON_CONFIG_EXE} --includes OUTPUT_VARIABLE PYTHON_INCLUDES ) separate_arguments( PYTHON_INCLUDES ) list(GET PYTHON_INCLUDES 0 PYTHON_INCLUDES ) @@ -525,54 +525,54 @@ if ( WALBERLA_BUILD_WITH_PYTHON ) string( REPLACE "Python " "" PYTHONLIBS_VERSION_STRING ${PYTHONLIBS_VERSION_STRING} ) endif() endif() - + if ( NOT PYTHON_LIBRARY ) execute_process( COMMAND ${PYTHON_CONFIG_EXE} --libs OUTPUT_VARIABLE PYTHON_LIB OUTPUT_STRIP_TRAILING_WHITESPACE ) execute_process( COMMAND ${PYTHON_CONFIG_EXE} --ldflags OUTPUT_VARIABLE PYTHON_LIB_DIR OUTPUT_STRIP_TRAILING_WHITESPACE ) string( REGEX MATCH "(-lpython[0-9a-z.-]*)" PYTHON_LIB ${PYTHON_LIB} ) string( REGEX REPLACE "[-][l]([^ ]+)" "\\1" PYTHON_LIB "${PYTHON_LIB}" ) # take everything that "python-config --ldflags" gives us, remove "-L" and give it to find_library as possible paths - # in this output there are also linker flags that are not paths but find_library can handle this - # overall this seems the most robust method - string( REPLACE "-L" "" PYTHON_LIB_DIR ${PYTHON_LIB_DIR} ) + # in this output there are also linker flags that are not paths but find_library can handle this + # overall this seems the most robust method + string( REPLACE "-L" "" PYTHON_LIB_DIR ${PYTHON_LIB_DIR} ) separate_arguments( PYTHON_LIB_DIR ) - find_library( PYTHON_LIBRARY NAMES ${PYTHON_LIB} + find_library( PYTHON_LIBRARY NAMES ${PYTHON_LIB} PATHS ${PYTHON_LIB_DIR} /usr/lib /usr/lib64 PATH_SUFFIXES lib lib64 NO_DEFAULT_PATH ) endif() endif() - + if( PYTHONLIBS_VERSION_STRING VERSION_LESS ${waLBerla_REQUIRED_MIN_PYTHON_VERSION} ) message( FATAL_ERROR "Found old python library: ${PYTHONLIBS_VERSION_STRING} need at least ${waLBerla_REQUIRED_MIN_PYTHON_VERSION}" ) endif() - + option( WALBERLA_USE_PYTHON_DEBUG_LIBRARY "Make use of the python debug library" OFF ) - + if( WALBERLA_USE_PYTHON_DEBUG_LIBRARY ) # you have to make sure this matches the settings you compiled boost with! add_definitions( "-DBOOST_DEBUG_PYTHON" ) endif() - + if( NOT (PYTHON_LIBRARY AND PYTHON_INCLUDE_DIR ) ) message( FATAL_ERROR "Couldn't find any python library" ) endif() - + SET( WALBERLA_BUILD_WITH_PYTHON 1 ) include_directories( ${PYTHON_INCLUDE_DIR} ) list ( APPEND SERVICE_LIBS ${PYTHON_LIBRARY} ) - + if( NOT WALBERLA_CXX_COMPILER_IS_MSVC ) list ( APPEND SERVICE_LIBS -lutil ) endif() - + if ( WALBERLA_BUILD_WITH_PYTHON_MODULE ) # a python module is a shared library - so everything has to be compiled to position independent code - # otherwise linking the static libs into the shared lib will result in errors + # otherwise linking the static libs into the shared lib will result in errors if( NOT WALBERLA_CXX_COMPILER_IS_MSVC ) add_flag ( CMAKE_CXX_FLAGS "-fPIC" ) add_flag ( CMAKE_C_FLAGS "-fPIC" ) endif() endif() - + if( MSVC10 ) include(CMakeDependentOption) CMAKE_DEPENDENT_OPTION( PYTHON_FIXED_HYPOT_REDEFINITION "fixed _hypot redefinition by python" OFF "WALBERLA_BUILD_WITH_PYTHON" OFF ) @@ -580,14 +580,14 @@ if ( WALBERLA_BUILD_WITH_PYTHON ) message( WARNING "Make sure you modified your pyconfig.h that _hypot is not redefined -> see: http://connect.microsoft.com/VisualStudio/feedback/details/633988/warning-in-math-h-line-162-re-nonstandard-extensions-used" ) endif() endif() - + # Sphinx documentation # to build documentation make sure to have sphinx and read-the-docs theme installed # Install with: "pip install sphinx sphinx_rtd_theme" add_custom_target( docPython sphinx-build -b html "${walberla_SOURCE_DIR}/python/waLBerla_docs" "${walberla_BINARY_DIR}/doc/python" COMMENT "Building HTML documentation for Python extension with Sphinx") - + endif() @@ -616,8 +616,8 @@ endif() # This variable is necessary, if the CMAKE version used is not aware of a more recent boost version (keep this up to date!) set ( Boost_ADDITIONAL_VERSIONS - "1.45" "1.45.0" "1.46" "1.46.0" "1.46.1" "1.47" "1.47.0" "1.48" "1.48.0" "1.49" "1.49.0" - "1.50" "1.50.0" "1.51" "1.51.0" "1.52" "1.52.0" "1.53" "1.53.0" "1.54" "1.54.0" "1.55" "1.55.0" + "1.45" "1.45.0" "1.46" "1.46.0" "1.46.1" "1.47" "1.47.0" "1.48" "1.48.0" "1.49" "1.49.0" + "1.50" "1.50.0" "1.51" "1.51.0" "1.52" "1.52.0" "1.53" "1.53.0" "1.54" "1.54.0" "1.55" "1.55.0" "1.56" "1.56.0" "1.57" "1.57.0" "1.58" "1.58.0" "1.59" "1.59.0" "1.60" "1.60.0" "1.61" "1.61.0" "1.62" "1.62.0" "1.63" "1.63.0") set ( Boost_USE_STATIC_LIBS OFF CACHE BOOL "Use boost static libraries" ) @@ -633,12 +633,12 @@ if ( NOT BOOST_ROOT ) break ( ) endif ( ) endforeach ( ) -endif ( ) +endif ( ) find_package ( Boost ${waLBerla_REQUIRED_MIN_BOOST_VERSION} COMPONENTS ${waLBerla_REQUIRED_BOOST_COMPONENTS} QUIET ) if( NOT Boost_FOUND ) - message ( WARNING + message ( WARNING "The specified configuration of the BOOST libraries was not found on your system! Now trying some other configuration..." ) foreach ( Boost_USE_STATIC_LIBS ON OFF ) foreach ( Boost_USE_MULTITHREADED ON OFF ) @@ -668,12 +668,12 @@ if ( Boost_FOUND ) link_directories ( ${Boost_LIBRARY_DIRS} ) list ( APPEND SERVICE_LIBS ${Boost_LIBRARIES} ) add_definitions ( -DBOOST_ALL_NO_LIB ) # Disable Boost auto-linking (CMAKE does that for us...) - + #fix for static lib usage: http://stackoverflow.com/questions/11812463/boost-python-link-errors-under-windows-msvc10 if( PYTHONLIBS_FOUND AND Boost_USE_STATIC_LIBS) add_definitions( -DBOOST_PYTHON_STATIC_LIB ) endif() - + #fix for strange link behaviour of boost to python: boost only links to 'pyhton*.lib' and not to the absolute path if( WIN32 AND PYTHONLIBS_FOUND ) get_filename_component( PYTHON_LIBRARY_DIR ${PYTHON_INCLUDE_DIR} PATH ) @@ -733,9 +733,9 @@ endif() ## ############################################################################################################################ -if ( WALBERLA_BUILD_WITH_MPI AND NOT WALBERLA_CXX_COMPILER_IS_MPI_WRAPPER ) +if ( WALBERLA_BUILD_WITH_MPI AND NOT WALBERLA_CXX_COMPILER_IS_MPI_WRAPPER ) find_package ( MPI ) - + # FindMPI does not really work under windows, because it expects linux formatted strings from the mpi compiler. # Nevertheless for Microsoft MPI and MPICH there are workarounds included, but not for OpenMPI. # Here is a workaround for windows with OpenMPI (use configure twice to see correct output). @@ -762,18 +762,18 @@ if ( WALBERLA_BUILD_WITH_MPI AND NOT WALBERLA_CXX_COMPILER_IS_MPI_WRAPPER ) if ( NOT MPI_CXX_LIBRARIES STREQUAL "MPI_CXX_LIBRARIES-NOTFOUND" ) set ( MPI_CXX_FOUND ON FORCE ) endif ( ) - + set ( MPI_C_LIBRARIES "MPI_C_LIBRARIES-NOTFOUND" CACHE FILEPATH "Cleared" FORCE ) find_library ( MPI_C_LIBRARIES NAMES mpi mpich mpich2 msmpi libmpi libmpich libmpich2 libmsmpi HINTS ${MPI_PATH} PATH_SUFFIXES lib ) set ( MPI_EXTRA_LIBRARY "MPI_C_LIBRARIES" CACHE FILEPATH "" FORCE ) - + if ( NOT MPI_C_LIBRARIES STREQUAL "MPI_C_LIBRARIES-NOTFOUND" ) set ( MPI_C_FOUND ON FORCE ) endif ( ) - + if ( MPI_PATH MATCHES ".*OpenMPI.*" ) set ( MPI_CXX_COMPILE_FLAGS "/DOMPI_IMPORTS" CACHE STRING "" FORCE ) set ( MPI_C_COMPILE_FLAGS "/DOMPI_IMPORTS" CACHE STRING "" FORCE ) @@ -782,9 +782,9 @@ if ( WALBERLA_BUILD_WITH_MPI AND NOT WALBERLA_CXX_COMPILER_IS_MPI_WRAPPER ) else ( ) message ( WARNING "Found MPI Compiler but no Libraries -> invent a new workaround" ) endif ( ) - endif ( ) - - if ( MPI_FOUND ) + endif ( ) + + if ( MPI_FOUND ) if ( MPI_CXX_FOUND ) include_directories ( SYSTEM ${MPI_CXX_INCLUDE_PATH} ${MPI_C_INCLUDE_PATH} ) foreach( LIB ${MPI_C_LIBRARIES} ${MPI_CXX_LIBRARIES} ) @@ -802,11 +802,11 @@ if ( WALBERLA_BUILD_WITH_MPI AND NOT WALBERLA_CXX_COMPILER_IS_MPI_WRAPPER ) endif ( ) add_flag ( CMAKE_C_FLAGS "${MPI_COMPILE_FLAGS}" ) endif ( ) - + add_flag ( CMAKE_MODULE_LINKER_FLAGS "${MPI_CXX_LINK_FLAGS}" ) add_flag ( CMAKE_EXE_LINKER_FLAGS "${MPI_CXX_LINK_FLAGS}" ) add_flag ( CMAKE_SHARED_LINKER_FLAGS "${MPI_CXX_LINK_FLAGS}" ) - + # When using Intel MPI, mpi.h has to be included before including the standard library # therefore we use the -include flag to enforce this. if ( MPI_INCLUDE_PATH MATCHES "intel" ) @@ -831,14 +831,14 @@ if ( WALBERLA_ENABLE_GUI ) find_package( Qt4 COMPONENTS QtCore QtGui QtOpenGL QtXml REQUIRED ) find_package( OpenGL REQUIRED ) - + INCLUDE( ${QT_USE_FILE} ) list ( APPEND SERVICE_LIBS ${OPENGL_LIBRARIES} ${QT_LIBRARIES} ) - + # Workaround for Qt4 moc and newer boost versions - moc cannot parse BOOST_JOIN # so additional defines are passed to the moc compiler that prevent the problematic header to be parsed - set( QT_MOC_EXECUTABLE ${QT_MOC_EXECUTABLE} -DBOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION -DBOOST_TT_HAS_OPERATOR_HPP_INCLUDED ) - + set( QT_MOC_EXECUTABLE ${QT_MOC_EXECUTABLE} -DBOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION -DBOOST_TT_HAS_OPERATOR_HPP_INCLUDED ) + endif(WALBERLA_ENABLE_GUI) ############################################################################################################################ @@ -853,9 +853,9 @@ endif(WALBERLA_ENABLE_GUI) if ( WALBERLA_BUILD_WITH_METIS ) find_package ( Metis QUIET ) - + if ( METIS_FOUND ) - include_directories( ${METIS_INCLUDE_DIRS} ) + include_directories( ${METIS_INCLUDE_DIRS} ) link_directories ( ${METIS_LIBRARY_DIR} ) list ( APPEND SERVICE_LIBS ${METIS_LIBRARIES} ) set ( WALBERLA_BUILD_WITH_METIS TRUE ) @@ -863,7 +863,7 @@ if ( WALBERLA_BUILD_WITH_METIS ) set ( WALBERLA_BUILD_WITH_METIS OFF CACHE BOOL "Build with metis graph partitioner" FORCE ) endif() else() - set ( METIS_FOUND OFF CACHE BOOL "Metis found" FORCE ) + set ( METIS_FOUND OFF CACHE BOOL "Metis found" FORCE ) endif() ############################################################################################################################ @@ -880,7 +880,7 @@ if( WALBERLA_BUILD_WITH_MPI ) find_package( PFFT ) find_package( FFTW3 ) set( FFT_REQUIRED_LIBRARIES pfft fftw3_mpi fftw3 ) - if( PFFT_FOUND AND FFTW3_MPI_FOUND ) + if( PFFT_FOUND AND FFTW3_MPI_FOUND ) set( WALBERLA_BUILD_WITH_FFT TRUE CACHE INTERNAL "Build with FFT" ) include_directories( SYSTEM ${PFFT_INCLUDE_DIR} ${FFTW3_MPI_INCLUDE_DIR} ) list( APPEND SERVICE_LIBS ${PFFT_LIBRARIES} ${FFTW3_LIBRARIES} ${FFTW3_MPI_LIBRARIES} ) @@ -919,11 +919,11 @@ if ( WALBERLA_CXX_COMPILER_IS_MSVC ) string(REPLACE "/Ob0" "/Ob2" CMAKE_CXX_FLAGS_DEBUGOPTIMIZED ${CMAKE_CXX_FLAGS_DEBUGOPTIMIZED}) string(REPLACE "/RTC1" "" CMAKE_CXX_FLAGS_DEBUGOPTIMIZED ${CMAKE_CXX_FLAGS_DEBUGOPTIMIZED}) elseif( WALBERLA_CXX_COMPILER_IS_GNU OR WALBERLA_CXX_COMPILER_IS_INTEL OR WALBERLA_CXX_COMPILER_IS_CLANG ) - set( CMAKE_C_FLAGS_DEBUGOPTIMIZED "${CMAKE_C_FLAGS_DEBUGOPTIMIZED} -O3" ) - set( CMAKE_CXX_FLAGS_DEBUGOPTIMIZED "${CMAKE_CXX_FLAGS_DEBUGOPTIMIZED} -O3" ) + set( CMAKE_C_FLAGS_DEBUGOPTIMIZED "${CMAKE_C_FLAGS_DEBUGOPTIMIZED} -O3" ) + set( CMAKE_CXX_FLAGS_DEBUGOPTIMIZED "${CMAKE_CXX_FLAGS_DEBUGOPTIMIZED} -O3" ) endif() -set(CMAKE_C_FLAGS_DEBUGOPTIMIZED ${CMAKE_C_FLAGS_DEBUGOPTIMIZED} CACHE STRING +set(CMAKE_C_FLAGS_DEBUGOPTIMIZED ${CMAKE_C_FLAGS_DEBUGOPTIMIZED} CACHE STRING "Flags used by the compiler during DebugOptimized builds") set(CMAKE_CXX_FLAGS_DEBUGOPTIMIZED ${CMAKE_CXX_FLAGS_DEBUGOPTIMIZED} CACHE STRING "Flags used by the compiler during DebugOptimized builds") @@ -955,7 +955,7 @@ endif() - + ############################################################################################################################ ## ## OpenMP @@ -998,7 +998,7 @@ endif() ############################################################################################################################ ## -## Testing Coverage +## Testing Coverage ## ############################################################################################################################ if (WALBERLA_BUILD_WITH_GCOV AND CMAKE_COMPILER_IS_GNUCXX ) @@ -1017,7 +1017,7 @@ endif() if ( WALBERLA_BUILD_WITH_GPROF ) if ( WALBERLA_CXX_COMPILER_IS_INTEL ) - add_flag ( CMAKE_CXX_FLAGS "-pg" ) + add_flag ( CMAKE_CXX_FLAGS "-pg" ) add_flag ( CMAKE_EXE_LINKER_FLAGS "-pg" ) elseif ( WALBERLA_CXX_COMPILER_IS_GNU OR WALBERLA_CXX_COMPILER_IS_CLANG ) add_flag ( CMAKE_CXX_FLAGS "-pg" ) @@ -1035,7 +1035,7 @@ endif() if ( WALBERLA_BUILD_WITH_LIKWID_MARKERS ) find_library( LIKWID_LIB likwid HINTS $ENV{LIKWID_ROOT} ) - + if ( LIKWID_LIB ) set( LIKWID_FOUND 1) list ( APPEND SERVICE_LIBS ${LIKWID_LIB} ) @@ -1054,7 +1054,7 @@ endif() ## ############################################################################################################################ if ( WALBERLA_BUILD_WITH_LTO ) - + if( WALBERLA_CXX_COMPILER_IS_INTEL ) add_flag( CMAKE_CXX_FLAGS_RELEASE "-ip -ipo3" ) add_flag( CMAKE_C_FLAGS_RELEASE "-ip -ipo3" ) @@ -1065,20 +1065,20 @@ if ( WALBERLA_BUILD_WITH_LTO ) add_flag ( CMAKE_CXX_FLAGS_RELEASE "-flto=3" ) add_flag ( CMAKE_EXE_LINKER_FLAGS "-fuse-linker-plugin" ) endif ( ) - + if( WALBERLA_CXX_COMPILER_IS_MSVC ) add_flag ( CMAKE_CXX_FLAGS_RELEASE "/GL" ) add_flag ( CMAKE_EXE_LINKER_FLAGS_RELEASE "/LTCG" ) add_flag ( CMAKE_SHARED_LINKER_FLAGS_RELEASE "/LTCG" ) add_flag ( CMAKE_MODULE_LINKER_FLAGS_RELEASE "/LTCG" ) endif ( ) - + if( WALBERLA_CXX_COMPILER_IS_IBM ) add_flag ( CMAKE_C_FLAGS_RELEASE "-qipa" ) add_flag ( CMAKE_CXX_FLAGS_RELEASE "-qipa" ) add_flag ( CMAKE_EXE_LINKER_FLAGS "-qipa" ) - endif( ) - + endif( ) + endif ( ) ############################################################################################################################ @@ -1112,17 +1112,17 @@ if ( HTML_HELP_COMPILER EQUAL "" ) else ( ) set ( HTML_HELP_FOUND "YES" ) endif ( ) - + if ( DOXYGEN_FOUND ) set ( DOXYGEN_HTML_HEADER ${walberla_SOURCE_DIR}/doc/header.html ) set ( DOXYGEN_HTML_FOOTER ${walberla_SOURCE_DIR}/doc/footer.html ) set ( DOXYGEN_HTML_OUTPUT "html" ) - + configure_file ( ${walberla_SOURCE_DIR}/doc/doxygen.in ${walberla_BINARY_DIR}/doc/doxygen.cfg @ONLY ) add_custom_target ( doc ${DOXYGEN_EXECUTABLE} ${walberla_BINARY_DIR}/doc/doxygen.cfg COMMENT "Generating API documentation with Doxygen" VERBATIM ) - + endif ( ) ############################################################################################################################ @@ -1164,14 +1164,14 @@ endif() # Add binary dir for generated headers include_directories ( ${CMAKE_CURRENT_BINARY_DIR}/src ) -# All include paths are specified relative to src/ directory +# All include paths are specified relative to src/ directory include_directories ( ${CMAKE_CURRENT_SOURCE_DIR}/src ) # Generate file with compile options, and add install rule for it -configure_file ( src/waLBerlaDefinitions.in.h +configure_file ( src/waLBerlaDefinitions.in.h src/waLBerlaDefinitions.h ) - + install( FILES ${walberla_BINARY_DIR}/src/waLBerlaDefinitions.h DESTINATION walberla/ ) # sources