Skip to content
Snippets Groups Projects
Commit 422a76e6 authored by Soeren Peters's avatar Soeren Peters
Browse files

Add VF_COMPILER_DEFINITION and VF_LINK_OPTION to cmake.

Make use of the new cmake command: target_link_options, target_compile_options and target_compile_definitions.
parent 34f3fbc8
No related branches found
No related tags found
No related merge requests found
Showing
with 86 additions and 201 deletions
...@@ -2,5 +2,5 @@ GET_FILENAME_COMPONENT( CURRENT_DIR ${CMAKE_CURRENT_LIST_FILE} PATH) ...@@ -2,5 +2,5 @@ GET_FILENAME_COMPONENT( CURRENT_DIR ${CMAKE_CURRENT_LIST_FILE} PATH)
COLLECT_PACKAGE_DATA_WITH_OPTION(${CURRENT_DIR} ALL_SOURCES outOption outSourceGroupName) COLLECT_PACKAGE_DATA_WITH_OPTION(${CURRENT_DIR} ALL_SOURCES outOption outSourceGroupName)
IF(${outOption}) IF(${outOption})
LIST(APPEND CAB_ADDTIONAL_COMPILER_FLAGS -DMC_CUBES ) list(APPEND VF_COMPILER_DEFINITION MC_CUBES)
ENDIF() ENDIF()
...@@ -63,15 +63,26 @@ INCLUDE(${VF_CMAKE_DIR}/CMakeSetCompilerFlags.cmake) ...@@ -63,15 +63,26 @@ INCLUDE(${VF_CMAKE_DIR}/CMakeSetCompilerFlags.cmake)
############################################################################################################### ###############################################################################################################
# Reset the compiler and linker flags # Reset the compiler and linker flags
############################################################################################################### ###############################################################################################################
SET(CAB_ADDTIONAL_COMPILER_FLAGS) SET(VF_COMPILER_DEFINITION)
SET(VF_LINK_OPTIONS)
SET(CAB_ADDITIONAL_LINK_FLAGS)
SET(CAB_ADDITIONAL_LINK_FLAGS_DEBUG)
SET(CAB_ADDITIONAL_LINK_FLAGS_RELEASE)
SET(CAB_ADDITIONAL_LINK_LIBRARIES) SET(CAB_ADDITIONAL_LINK_LIBRARIES)
LIST(APPEND CAB_ADDTIONAL_COMPILER_FLAGS -DSOURCE_ROOT=${VF_ROOT_DIR} ) LIST(APPEND VF_COMPILER_DEFINITION SOURCE_ROOT=${VF_ROOT_DIR} )
#################################################################
### OS DEFINES ###
#################################################################
IF(WIN32)
list(APPEND VF_COMPILER_DEFINITION __WIN__)
ELSEIF(UNIX)
list(APPEND VF_COMPILER_DEFINITION __unix__)
ENDIF()
IF(APPLE)
list(APPEND VF_COMPILER_DEFINITION __APPLE__)
endif()
############################################################### ###############################################################
# set hostname -> CAB_MACHINE and load an optional config file # set hostname -> CAB_MACHINE and load an optional config file
...@@ -89,8 +100,7 @@ IF(NOT CAB_MACHINE) ...@@ -89,8 +100,7 @@ IF(NOT CAB_MACHINE)
ENDIF() ENDIF()
CHECK_FOR_VARIABLE(CAB_MACHINE "machine name, e.g. ALTIX, ARWEN") CHECK_FOR_VARIABLE(CAB_MACHINE "machine name, e.g. ALTIX, ARWEN")
LIST(APPEND CAB_ADDTIONAL_COMPILER_FLAGS -DCAB_MACHINE_${CAB_MACHINE}) LIST(APPEND VF_COMPILER_DEFINITION CAB_MACHINE=${CAB_MACHINE})
LIST(APPEND CAB_ADDTIONAL_COMPILER_FLAGS -DCAB_MACHINE=${CAB_MACHINE})
SET(CMAKE_CONFIG_FILE "${VF_CMAKE_DIR}/cmake_config_files/${CAB_MACHINE}.config.cmake") SET(CMAKE_CONFIG_FILE "${VF_CMAKE_DIR}/cmake_config_files/${CAB_MACHINE}.config.cmake")
IF(NOT EXISTS ${CMAKE_CONFIG_FILE}) IF(NOT EXISTS ${CMAKE_CONFIG_FILE})
......
...@@ -2,27 +2,12 @@ ...@@ -2,27 +2,12 @@
### SET_COMPILER_SPECIFIC_FLAGS ### ### SET_COMPILER_SPECIFIC_FLAGS ###
### determines compiler flags variables ### ### determines compiler flags variables ###
################################################################ ################################################################
MACRO(SET_COMPILER_SPECIFIC_FLAGS) MACRO(LOAD_COMPILER_FLAGS_FROM_FILE)
IF(NOT CMAKE_CXX_COMPILER)
MESSAGE(FATAL_ERROR "before SET_CAB_COMPILER-Macro PROJECT-Macro has to be called")
ENDIF()
###############################################################################################################
## Flags ruecksetzen
###############################################################################################################
SET(CAB_COMPILER_ADDITIONAL_LINK_PROPS "")
SET(CAB_COMPILER_ADDITIONAL_LINK_PROPS_DEBUG "")
SET(CAB_COMPILER_ADDITIONAL_LINK_PROPS_RELEASE "")
SET(CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "") SET(CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "")
SET(CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS_DEBUG "") SET(CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS_DEBUG "")
SET(CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS_RELEASE "") SET(CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS_RELEASE "")
SET(CAB_COMPILER_ADDTIONAL_C_COMPILER_FLAGS "")
SET(CAB_COMPILER_ADDTIONAL_C_COMPILER_FLAGS_DEBUG "")
SET(CAB_COMPILER_ADDTIONAL_C_COMPILER_FLAGS_RELEASE "")
# https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_COMPILER_ID.html#variable:CMAKE_<LANG>_COMPILER_ID # https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_COMPILER_ID.html#variable:CMAKE_<LANG>_COMPILER_ID
IF( SPECIFIC_COMPILER_FLAG_FILE ) IF( SPECIFIC_COMPILER_FLAG_FILE )
...@@ -34,18 +19,14 @@ MACRO(SET_COMPILER_SPECIFIC_FLAGS) ...@@ -34,18 +19,14 @@ MACRO(SET_COMPILER_SPECIFIC_FLAGS)
MESSAGE(FATAL_ERROR "compiler=${CMAKE_CXX_COMPILER_ID} seems to be a not supported compiler") MESSAGE(FATAL_ERROR "compiler=${CMAKE_CXX_COMPILER_ID} seems to be a not supported compiler")
ENDIF() ENDIF()
ENDMACRO(SET_COMPILER_SPECIFIC_FLAGS) ENDMACRO()
################################################################ ################################################################
### ADD_COMPILER_FLAGS_TO_PROJECT ### ### ADD_COMPILER_FLAGS_TO_PROJECT ###
### adds COMPILER_FLGAS TO project ###
################################################################ ################################################################
MACRO(ADD_COMPILER_FLAGS_TO_PROJECT project_name) MACRO(ADD_COMPILER_FLAGS_TO_PROJECT project_name)
################################################################ LOAD_COMPILER_FLAGS_FROM_FILE()
# SET_COMPILER_SPECIFIC_FLAGS
################################################################
SET_COMPILER_SPECIFIC_FLAGS()
#workaround fuer itanium processoren #workaround fuer itanium processoren
IF(${CMAKE_SYSTEM_PROCESSOR} MATCHES "ia64") IF(${CMAKE_SYSTEM_PROCESSOR} MATCHES "ia64")
...@@ -53,49 +34,18 @@ MACRO(ADD_COMPILER_FLAGS_TO_PROJECT project_name) ...@@ -53,49 +34,18 @@ MACRO(ADD_COMPILER_FLAGS_TO_PROJECT project_name)
LIST(APPEND CAB_COMPILER_ADDTIONAL_C_COMPILER_FLAGS -D_M_IA64) LIST(APPEND CAB_COMPILER_ADDTIONAL_C_COMPILER_FLAGS -D_M_IA64)
ENDIF() ENDIF()
################################################################
# LINKER PROPS
################################################################
status("additional linker probs: ${CAB_COMPILER_ADDITIONAL_LINK_PROPS}")
IF(CAB_COMPILER_ADDITIONAL_LINK_PROPS)
ADD_TARGET_PROPERTIES(${project_name} LINK_FLAGS ${CAB_COMPILER_ADDITIONAL_LINK_PROPS})
ENDIF()
IF(CAB_COMPILER_ADDITIONAL_LINK_PROPS_DEBUG)
ADD_TARGET_PROPERTIES(${project_name} LINK_FLAGS ${CAB_COMPILER_ADDITIONAL_LINK_PROPS_DEBUG})
ENDIF()
IF(CAB_COMPILER_ADDITIONAL_LINK_PROPS_RELEASE)
ADD_TARGET_PROPERTIES(${project_name} LINK_FLAGS ${CAB_COMPILER_ADDITIONAL_LINK_PROPS_RELEASE})
ENDIF()
################################################################ foreach(flag IN LISTS CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS)
# COMPILER FLAGS target_compile_options(${project_name} PRIVATE "$<$<COMPILE_LANGUAGE:CXX>:${flag}>")
################################################################ endforeach()
#message (COMPILE FLAGS INTERN: ${CAB_COMPILER_ADDTIONAL_${project_language}_COMPILER_FLAGS})
# TODO: Clean this up!! foreach(flag IN LISTS CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS_DEBUG)
IF(CAB_COMPILER_ADDTIONAL_${project_language}_COMPILER_FLAGS) target_compile_options(${project_name} PRIVATE "$<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CONFIG:DEBUG>>:${flag}>")
#message (COMPILE FLAGS INTERN: ${CAB_COMPILER_ADDTIONAL_${project_language}_COMPILER_FLAGS}) endforeach()
foreach(flag IN LISTS CAB_COMPILER_ADDTIONAL_${project_language}_COMPILER_FLAGS)
#message(compiler option: ${flag})
target_compile_options(${project_name} PRIVATE "$<$<COMPILE_LANGUAGE:${project_language}>:${flag}>")
endforeach()
#get_target_property(var ${project_name} COMPILE_OPTIONS)
#message(set compile options: ${var})
#add_custom_command(TARGET ${project_name} POST_BUILD COMMAND echo built with the flags: ${var}) foreach(flag IN LISTS CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS_RELEASE)
#ADD_TARGET_PROPERTIES(${project_name} COMPILE_FLAGS ${CAB_COMPILER_ADDTIONAL_${project_language}_COMPILER_FLAGS}) target_compile_options(${project_name} PRIVATE "$<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CONFIG:RELEASE>>:${flag}>")
#target_compile_options (${project_name} PRIVATE $<$<COMPILE_LANGUAGE:CXX>:${CAB_COMPILER_ADDTIONAL_${project_language}_COMPILER_FLAGS}>) endforeach()
ENDIF()
IF(CAB_COMPILER_ADDTIONAL_${project_language}_COMPILER_FLAGS_DEBUG)
MESSAGE(STATUS "ADD_COMPILER_FLAGS_TO_PROJECT: sorry, a long as CMake has no support for COMPILE_FLAGS_<CONFIG> -> DEBUG flags are neglected")
#ADD_TARGET_PROPERTIES(${project_name} COMPILE_FLAGS_DEBUG ${CAB_COMPILER_ADDTIONAL_${project_language}_COMPILER_FLAGS_DEBUG})
ENDIF()
IF(CAB_COMPILER_ADDTIONAL_${project_language}_COMPILER_FLAGS_RELEASE)
MESSAGE(STATUS "ADD_COMPILER_FLAGS_TO_PROJECT: sorry, a long as CMake has no support for COMPILE_FLAGS_<CONFIG> -> RELEASE flags are set for RELEASE AND DEBUG")
ADD_TARGET_PROPERTIES(${project_name} COMPILE_FLAGS ${CAB_COMPILER_ADDTIONAL_${project_language}_COMPILER_FLAGS_RELEASE})
#ADD_TARGET_PROPERTIES(${project_name} COMPILE_FLAGS_RELEASE ${CAB_COMPILER_ADDTIONAL_${project_language}_COMPILER_FLAGS_RELEASE})
ENDIF()
ENDMACRO(ADD_COMPILER_FLAGS_TO_PROJECT project_name) ENDMACRO(ADD_COMPILER_FLAGS_TO_PROJECT project_name)
\ No newline at end of file
...@@ -11,6 +11,14 @@ function(status msg) ...@@ -11,6 +11,14 @@ function(status msg)
message(STATUS " VF - ${msg}") message(STATUS " VF - ${msg}")
endfunction() endfunction()
#################################################################################
## include intern macros
#################################################################################
include(${VF_CMAKE_DIR}/CMakeCABMacros.cmake)
include(${VF_CMAKE_DIR}/FileUtilities.cmake)
include(${VF_CMAKE_DIR}/3rd.cmake)
################################################################################# #################################################################################
## set global project file endings ## set global project file endings
################################################################################# #################################################################################
...@@ -24,6 +32,7 @@ set (VIRTUAL_FLUIDS_GLOB_FILES ...@@ -24,6 +32,7 @@ set (VIRTUAL_FLUIDS_GLOB_FILES
CACHE INTERNAL "File endings to glob for source files" ) CACHE INTERNAL "File endings to glob for source files" )
################################################################################# #################################################################################
## Sets the library name to the current folder name. ## Sets the library name to the current folder name.
## output parameter: library_name ## output parameter: library_name
...@@ -79,18 +88,6 @@ function(vf_add_library) ...@@ -79,18 +88,6 @@ function(vf_add_library)
includeProductionFiles (${library_name} "${sourceFiles}") includeProductionFiles (${library_name} "${sourceFiles}")
#################################################################
### OS DEFINES ###
#################################################################
IF(WIN32)
LIST(APPEND CAB_ADDTIONAL_COMPILER_FLAGS -D__WIN__)
ELSEIF(APPLE)
LIST(APPEND CAB_ADDTIONAL_COMPILER_FLAGS -D__APPLE__)
ELSEIF(UNIX)
LIST(APPEND CAB_ADDTIONAL_COMPILER_FLAGS -D__unix__)
ENDIF()
################################################################# #################################################################
### ADDITIONAL_MAKE_CLEAN_FILES ### ### ADDITIONAL_MAKE_CLEAN_FILES ###
################################################################# #################################################################
...@@ -133,36 +130,20 @@ function(vf_add_library) ...@@ -133,36 +130,20 @@ function(vf_add_library)
################################################################# #################################################################
ADD_COMPILER_FLAGS_TO_PROJECT(${library_name}) ADD_COMPILER_FLAGS_TO_PROJECT(${library_name})
status("compiler flags for compiler ${CAB_COMPILER} on machine ${CAB_MACHINE} for project ${project_name} (${ARG_BUILDTYPE}) have been configured") status("compiler flags for compiler ${CAB_COMPILER} on machine ${CAB_MACHINE} for project ${project_name} (${ARG_BUILDTYPE}) have been configured")
status("compiler flags: ${CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS}") status("compiler flags CXX: ${CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS}")
status("additional compiler flags: ${CAB_ADDTIONAL_COMPILER_FLAGS}") status("additional compiler flags CXX debug: ${CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS_DEBUG}")
status("additional compiler flags CXX release: ${CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS_RELEASE}")
#MESSAGE (COMPILE FLAGS: ${CAB_ADDTIONAL_COMPILER_FLAGS}) status("additional compiler definitions: ${VF_COMPILER_DEFINITION}")
IF(CAB_ADDTIONAL_COMPILER_FLAGS) status("additional linker flags: ${VF_LINK_OPTIONS}")
ADD_TARGET_PROPERTIES(${library_name} COMPILE_FLAGS ${CAB_ADDTIONAL_COMPILER_FLAGS})
ENDIF()
IF(CAB_ADDTIONAL_COMPILER_FLAGS_DEBUG)
MESSAGE(FATAL_ERROR "COMPILE_FLAGS_DEBUG_<CONFIG> not supported by cmake yet :-(")
ADD_TARGET_PROPERTIES(${library_name} COMPILE_FLAGS_DEBUG ${CAB_ADDTIONAL_COMPILER_FLAGS_DEBUG})
ENDIF()
IF(CAB_ADDTIONAL_COMPILER_FLAGS_RELEASE)
MESSAGE(FATAL_ERROR "COMPILE_FLAGS_<CONFIG> not supported by cmake yet :-(")
ADD_TARGET_PROPERTIES(${library_name} COMPILE_FLAGS_RELEASE ${CAB_ADDTIONAL_COMPILER_FLAGS_RELEASE})
ENDIF()
################################################################# foreach(flag IN LISTS VF_COMPILER_DEFINITION)
### ADDITIONAL LINK PROPERTIES ### target_compile_definitions(${library_name} PRIVATE ${flag})
################################################################# endforeach()
status("additional linker flags: ${CAB_ADDITIONAL_LINK_FLAGS}")
IF(CAB_ADDITIONAL_LINK_FLAGS) foreach(flag IN LISTS VF_LINK_OPTIONS) #TODO: check what happens when lib is static
ADD_TARGET_PROPERTIES(${library_name} LINK_FLAGS ${CAB_ADDITIONAL_LINK_FLAGS}) target_link_options(${library_name} PRIVATE ${flag})
ENDIF() endforeach()
IF(CAB_ADDITIONAL_LINK_FLAGS_DEBUG)
ADD_TARGET_PROPERTIES(${library_name} LINK_FLAGS_DEBUG ${CAB_ADDITIONAL_LINK_FLAGS_DEBUG})
ENDIF()
IF(CAB_ADDITIONAL_LINK_FLAGS_RELEASE)
ADD_TARGET_PROPERTIES(${library_name} LINK_FLAGS_RELEASE ${CAB_ADDITIONAL_LINK_FLAGS_RELEASE})
ENDIF()
if (NOT ${ARG_BUILDTYPE} MATCHES binary) if (NOT ${ARG_BUILDTYPE} MATCHES binary)
......
...@@ -4,10 +4,6 @@ ...@@ -4,10 +4,6 @@
# OS: MacOS X # OS: MacOS X
################################################################################# #################################################################################
LIST(APPEND CAB_ADDTIONAL_COMPILER_FLAGS -D__unix__)
LIST(APPEND CAB_ADDTIONAL_COMPILER_FLAGS -D__UNIX__)
LIST(APPEND CAB_ADDTIONAL_COMPILER_FLAGS -D__APPLE__)
################################################################################# #################################################################################
# METIS # METIS
################################################################################# #################################################################################
......
...@@ -4,14 +4,6 @@ ...@@ -4,14 +4,6 @@
# OS: Windows 10 # OS: Windows 10
################################################################################# #################################################################################
#LIST(APPEND CAB_ADDTIONAL_COMPILER_FLAGS -D__unix__)
#LIST(APPEND CAB_ADDTIONAL_COMPILER_FLAGS -D__UNIX__)
#LIST(APPEND CAB_ADDTIONAL_COMPILER_FLAGS -D__APPLE__)
IF(NOT CMAKE_CXX_COMPILER)
MESSAGE(FATAL_ERROR "before cmake-config-file can be included -> project must be extecuted")
ENDIF()
################################################################################# #################################################################################
# MPI # MPI
################################################################################# #################################################################################
...@@ -33,14 +25,6 @@ SET(BOOST_LIBRARYDIR ${BOOST_ROOT}"/stageMSVC64/lib") ...@@ -33,14 +25,6 @@ SET(BOOST_LIBRARYDIR ${BOOST_ROOT}"/stageMSVC64/lib")
# VTK # VTK
################################################################################# #################################################################################
set(VTK_DIR "d:/Tools/VTK/build/VTK-8.0.0") set(VTK_DIR "d:/Tools/VTK/build/VTK-8.0.0")
#################################################################################
# ZOLTAN
#################################################################################
IF(${USE_ZOLTAN})
SET(ZOLTAN_INCLUDEDIR "d:/Tools/zoltan/include")
SET(ZOLTAN_DEBUG_LIBRARY "d:/Tools/zoltan/lib/Debug/zoltan.lib")
SET(ZOLTAN_RELEASE_LIBRARY "d:/Tools/zoltan/lib/Release/zoltan.lib")
ENDIF()
################################################################################# #################################################################################
# METIS # METIS
......
...@@ -4,9 +4,6 @@ ...@@ -4,9 +4,6 @@
# OS: Ubuntu 20.04 # OS: Ubuntu 20.04
################################################################################# #################################################################################
LIST(APPEND CAB_ADDTIONAL_COMPILER_FLAGS -D__unix__)
LIST(APPEND CAB_ADDTIONAL_COMPILER_FLAGS -D__UNIX__)
set(NVCUDASAMPLES_ROOT "~/cuda-samples/Common") set(NVCUDASAMPLES_ROOT "~/cuda-samples/Common")
################################################################################# #################################################################################
# METIS # METIS
......
...@@ -4,9 +4,6 @@ ...@@ -4,9 +4,6 @@
# OS: CentOS 7.3 # OS: CentOS 7.3
################################################################################# #################################################################################
LIST(APPEND CAB_ADDTIONAL_COMPILER_FLAGS -D__unix__)
LIST(APPEND CAB_ADDTIONAL_COMPILER_FLAGS -D__UNIX__)
SET(BOOST_VERSION "1.63.0" CACHE STRING "std: 1.63.0") SET(BOOST_VERSION "1.63.0" CACHE STRING "std: 1.63.0")
################################################################################# #################################################################################
......
...@@ -9,20 +9,20 @@ ...@@ -9,20 +9,20 @@
############################################################################################################# #############################################################################################################
LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-O3;-fomit-frame-pointer;-finline-functions;-fPIC;-Wbackslash-newline-escape") LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-O3;-fomit-frame-pointer;-finline-functions;-fPIC;-Wbackslash-newline-escape")
LIST(APPEND CAB_COMPILER_ADDTIONAL_C_COMPILER_FLAGS "-O3;-fomit-frame-pointer;-finline-functions;-fPIC")
############################################################################################################# #############################################################################################################
# mt support # mt support
############################################################################################################# #############################################################################################################
LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-pthread") LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-pthread")
LIST(APPEND CAB_COMPILER_ADDTIONAL_C_COMPILER_FLAGS "-pthread")
############################################################################################################# #############################################################################################################
# c++ 11 support # c++ 11 support
############################################################################################################# #############################################################################################################
LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-std=c++11") LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-std=c++11")
LIST(APPEND CAB_COMPILER_ADDTIONAL_C_COMPILER_FLAGS "-std=c++11")
# test
#LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS_RELEASE "-Wall")
#LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS_DEBUG "-Werror")
############################################################################################################# #############################################################################################################
# disable warning # disable warning
...@@ -31,8 +31,6 @@ LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-Wno-deprecated") #deprec ...@@ -31,8 +31,6 @@ LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-Wno-deprecated") #deprec
#LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-Wbackslash-newline-escape") #backslash and newline separated by space #LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-Wbackslash-newline-escape") #backslash and newline separated by space
LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-Wcomment") #'/*' within block comment LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-Wcomment") #'/*' within block comment
LIST(APPEND CAB_COMPILER_ADDTIONAL_C_COMPILER_FLAGS "-Wbackslash-newline-escape") #backslash and newline separated by space
############################################################################################################# #############################################################################################################
# c++ 17 support # c++ 17 support
############################################################################################################# #############################################################################################################
......
...@@ -9,20 +9,15 @@ ...@@ -9,20 +9,15 @@
############################################################################################################# #############################################################################################################
LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-O3;-fomit-frame-pointer;-finline-functions;-fPIC;-Wbackslash-newline-escape") LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-O3;-fomit-frame-pointer;-finline-functions;-fPIC;-Wbackslash-newline-escape")
LIST(APPEND CAB_COMPILER_ADDTIONAL_C_COMPILER_FLAGS "-O3;-fomit-frame-pointer;-finline-functions;-fPIC")
############################################################################################################# #############################################################################################################
# mt support # mt support
############################################################################################################# #############################################################################################################
LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-pthread") LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-pthread")
LIST(APPEND CAB_COMPILER_ADDTIONAL_C_COMPILER_FLAGS "-pthread")
############################################################################################################# #############################################################################################################
# c++ 11 support # c++ 11 support
############################################################################################################# #############################################################################################################
LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-std=c++11") LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-std=c++11")
LIST(APPEND CAB_COMPILER_ADDTIONAL_C_COMPILER_FLAGS "-std=c++11")
############################################################################################################# #############################################################################################################
# disable warning # disable warning
...@@ -31,8 +26,6 @@ LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-Wno-deprecated") #deprec ...@@ -31,8 +26,6 @@ LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-Wno-deprecated") #deprec
#LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-Wbackslash-newline-escape") #backslash and newline separated by space #LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-Wbackslash-newline-escape") #backslash and newline separated by space
LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-Wcomment") #'/*' within block comment LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-Wcomment") #'/*' within block comment
LIST(APPEND CAB_COMPILER_ADDTIONAL_C_COMPILER_FLAGS "-Wbackslash-newline-escape") #backslash and newline separated by space
############################################################################################################# #############################################################################################################
# c++ 17 support # c++ 17 support
############################################################################################################# #############################################################################################################
......
...@@ -2,30 +2,25 @@ ...@@ -2,30 +2,25 @@
############################################################################################################# #############################################################################################################
# Flags # Flags
############################################################################################################# #############################################################################################################
LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-O3 -fomit-frame-pointer -finline-functions -funroll-all-loops -fPIC") LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-O3;-fomit-frame-pointer;-finline-functions;-funroll-all-loops;-fPIC")
LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-Wno-deprecated") #deprecated header warning (jarl benutzt sstream weil schneller und so) LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-Wno-deprecated") #deprecated header warning (jarl benutzt sstream weil schneller und so)
LIST(APPEND CAB_COMPILER_ADDTIONAL_C_COMPILER_FLAGS "-O3 -fomit-frame-pointer -finline-functions -funroll-all-loops -fPIC")
############################################################################################################# #############################################################################################################
# OpenMP support # OpenMP support
############################################################################################################# #############################################################################################################
IF(USE_OPENMP) IF(USE_OPENMP)
LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-fopenmp") LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-fopenmp")
LIST(APPEND CAB_COMPILER_ADDTIONAL_C_COMPILER_FLAGS "-fopenmp")
ENDIF() ENDIF()
############################################################################################################# #############################################################################################################
# mt support # mt support
############################################################################################################# #############################################################################################################
LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-pthread") LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-pthread")
LIST(APPEND CAB_COMPILER_ADDTIONAL_C_COMPILER_FLAGS "-pthread")
############################################################################################################# #############################################################################################################
# c++ 11 support # c++ 11 support
############################################################################################################# #############################################################################################################
LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-std=c++11") LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-std=c++11")
LIST(APPEND CAB_COMPILER_ADDTIONAL_C_COMPILER_FLAGS "-std=c++11")
############################################################################################################# #############################################################################################################
# c++ 17 support # c++ 17 support
......
...@@ -14,8 +14,7 @@ ...@@ -14,8 +14,7 @@
#LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-xHOST -O3 -ip -ipo -fno-alias -mcmodel=medium -qopt-streaming-stores=always") #LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-xHOST -O3 -ip -ipo -fno-alias -mcmodel=medium -qopt-streaming-stores=always")
LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-wd1478") #auto_ptr warning from mu::Parser LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-wd1478") #auto_ptr warning from mu::Parser
#LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-xHOST -O3 -ip -fno-alias -mcmodel=medium -qopt-streaming-stores=always -xCORE-AVX512 -qopt-zmm-usage=high") LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-xHOST;-O3;-ip;-fno-alias;-mcmodel=medium;-qopt-streaming-stores=always;-xCORE-AVX512;-qopt-zmm-usage=high")
LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-xHOST -O3 -ip -fno-alias -mcmodel=medium -qopt-streaming-stores=always -xCORE-AVX512 -qopt-zmm-usage=high")
#Debug #Debug
#LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-g -traceback") #LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-g -traceback")
...@@ -31,10 +30,8 @@ ENDIF() ...@@ -31,10 +30,8 @@ ENDIF()
## mt support ## mt support
############################################################################################################### ###############################################################################################################
#LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-pthread") #LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-pthread")
#LIST(APPEND CAB_COMPILER_ADDTIONAL_C_COMPILER_FLAGS "-pthread")
############################################################################################################# #############################################################################################################
# c++ 11 support # c++ 11 support
############################################################################################################# #############################################################################################################
LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-std=c++11") LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-std=c++11")
LIST(APPEND CAB_COMPILER_ADDTIONAL_C_COMPILER_FLAGS "-std=c++11")
...@@ -8,14 +8,17 @@ ...@@ -8,14 +8,17 @@
OPTION(USE_UNSECURE_STL_VECTORS_RELEASE "_SECURE_SCL=0" OFF) OPTION(USE_UNSECURE_STL_VECTORS_RELEASE "_SECURE_SCL=0" OFF)
IF(USE_UNSECURE_STL_VECTORS_RELEASE) IF(USE_UNSECURE_STL_VECTORS_RELEASE)
# More MSVC specific compilation flags # More MSVC specific compilation flags
LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-D_SECURE_SCL=0") LIST(APPEND VF_COMPILER_DEFINITION _SECURE_SCL=0)
LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-D_SCL_SECURE_NO_WARNINGS") LIST(APPEND VF_COMPILER_DEFINITION _SCL_SECURE_NO_WARNINGS)
ENDIF() ENDIF()
#LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS_RELEASE "/W1")
#LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS_DEBUG "/Wall")
############################################################################################################### ###############################################################################################################
## Flags ## Flags
############################################################################################################### ###############################################################################################################
LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-D_CRT_SECURE_NO_DEPRECATE") LIST(APPEND VF_COMPILER_DEFINITION _CRT_SECURE_NO_DEPRECATE)
LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "/wd4996") #deprecated strcpy... LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "/wd4996") #deprecated strcpy...
LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "/wd4800") #forcing value to bool 'true' or 'false' (performance warning) LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "/wd4800") #forcing value to bool 'true' or 'false' (performance warning)
LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "/bigobj") #ansonsten funzt mit boost das compilieren unter windows nimmer LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "/bigobj") #ansonsten funzt mit boost das compilieren unter windows nimmer
......
...@@ -52,9 +52,6 @@ endif() ...@@ -52,9 +52,6 @@ endif()
################################################################################# #################################################################################
include(CMakePrintHelpers) include(CMakePrintHelpers)
include(${VF_CMAKE_DIR}/VirtualFluidsMacros.cmake) include(${VF_CMAKE_DIR}/VirtualFluidsMacros.cmake)
include(${VF_CMAKE_DIR}/CMakeCABMacros.cmake)
include(${VF_CMAKE_DIR}/FileUtilities.cmake)
include(${VF_CMAKE_DIR}/3rd.cmake)
include(${VF_CMAKE_DIR}/CMakeMacros_old/general/FindCompiler.cmake) include(${VF_CMAKE_DIR}/CMakeMacros_old/general/FindCompiler.cmake)
configure_file(src/basics/VirtualFluidsDefinitions.in.h ${CMAKE_BINARY_DIR}/VirtualFluidsDefinitions.h) configure_file(src/basics/VirtualFluidsDefinitions.in.h ${CMAKE_BINARY_DIR}/VirtualFluidsDefinitions.h)
......
...@@ -64,7 +64,6 @@ IF(${USE_VTK}) ...@@ -64,7 +64,6 @@ IF(${USE_VTK})
#find_package(VTK 6.1 NO_MODULE) #find_package(VTK 6.1 NO_MODULE)
FIND_PACKAGE(VTK REQUIRED) FIND_PACKAGE(VTK REQUIRED)
INCLUDE_DIRECTORIES(${VTK_INCLUDE_DIRS}) INCLUDE_DIRECTORIES(${VTK_INCLUDE_DIRS})
MESSAGE("VTK_INCLUDE_DIRS = " ${VTK_INCLUDE_DIRS})
ENDIF() ENDIF()
IF(${USE_CATALYST}) IF(${USE_CATALYST})
...@@ -72,41 +71,35 @@ IF(${USE_CATALYST}) ...@@ -72,41 +71,35 @@ IF(${USE_CATALYST})
include("${PARAVIEW_USE_FILE}") include("${PARAVIEW_USE_FILE}")
ENDIF() ENDIF()
#LIST(APPEND CAB_ADDTIONAL_COMPILER_FLAGS -DCAB_BOOST)
LIST(APPEND CAB_ADDTIONAL_COMPILER_FLAGS -DNOMINMAX)
#LIST(APPEND CAB_ADDTIONAL_COMPILER_FLAGS -DBOOST_SIGNALS_NO_DEPRECATION_WARNING)
#LIST(APPEND CAB_ADDTIONAL_COMPILER_FLAGS -DCAB_RUBY)
#LIST(APPEND CAB_ADDTIONAL_COMPILER_FLAGS -mpe=mpilog)
#LIST(APPEND CAB_ADDTIONAL_COMPILER_FLAGS -noshlib)
#LIST(APPEND CAB_ADDTIONAL_COMPILER_FLAGS -DSINGLEPRECISION)
IF(${USE_METIS}) IF(${USE_METIS})
LIST(APPEND CAB_ADDTIONAL_COMPILER_FLAGS -DVF_METIS) list(APPEND VF_COMPILER_DEFINITION VF_METIS)
ENDIF() ENDIF()
IF(${USE_MPI}) IF(${USE_MPI})
LIST(APPEND CAB_ADDTIONAL_COMPILER_FLAGS -DVF_MPI) list(APPEND VF_COMPILER_DEFINITION VF_MPI)
ENDIF() ENDIF()
IF(${USE_VTK}) IF(${USE_VTK})
LIST(APPEND CAB_ADDTIONAL_COMPILER_FLAGS -DVF_VTK) list(APPEND VF_COMPILER_DEFINITION VF_VTK)
ENDIF() ENDIF()
IF(${USE_CATALYST}) IF(${USE_CATALYST})
LIST(APPEND CAB_ADDTIONAL_COMPILER_FLAGS -DVF_CATALYST) list(APPEND VF_COMPILER_DEFINITION VF_CATALYST)
ENDIF() ENDIF()
IF(${USE_BOOST}) IF(${USE_BOOST})
LIST(APPEND CAB_ADDTIONAL_COMPILER_FLAGS -DVF_BOOST) list(APPEND VF_COMPILER_DEFINITION VF_BOOST)
ENDIF() ENDIF()
IF(${USE_HLRN_LUSTRE}) IF(${USE_HLRN_LUSTRE})
LIST(APPEND CAB_ADDTIONAL_COMPILER_FLAGS -DHLRN_LUSTRE) list(APPEND VF_COMPILER_DEFINITION HLRN_LUSTRE)
ENDIF() ENDIF()
IF(${CMAKE_CXX_COMPILER_ID} STREQUAL "Intel") IF(${CMAKE_CXX_COMPILER_ID} STREQUAL "Intel")
SET(CAB_ADDITIONAL_LINK_FLAGS ${CAB_ADDITIONAL_LINK_FLAGS} -parallel) list(APPEND VF_LINK_OPTIONS -parallel)
list(APPEND VF_LINK_OPTIONS -irc)
ENDIF() ENDIF()
IF(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU") IF(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
SET(CAB_ADDITIONAL_LINK_FLAGS ${CAB_ADDITIONAL_LINK_FLAGS} -lgomp) list(APPEND VF_LINK_OPTIONS -lgomp)
list(APPEND VF_LINK_OPTIONS -lrt)
ENDIF() ENDIF()
...@@ -114,21 +107,17 @@ ENDIF() ...@@ -114,21 +107,17 @@ ENDIF()
# IF(${USE_PYTHON}) # IF(${USE_PYTHON})
# FIND_PACKAGE(PythonLibs) # FIND_PACKAGE(PythonLibs)
# INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_DIR}) # INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_DIR})
# LIST(APPEND CAB_ADDTIONAL_COMPILER_FLAGS -DVF_PYTHON) # LIST(APPEND VF_COMPILER_DEFINITION VF_PYTHON)
# LIST(APPEND CAB_ADDTIONAL_COMPILER_FLAGS -DBOOST_PYTHON_STATIC_LIB) # LIST(APPEND VF_COMPILER_DEFINITION BOOST_PYTHON_STATIC_LIB)
# add_subdirectory(python) # add_subdirectory(python)
# ENDIF() # ENDIF()
# IF(${CMAKE_CXX_COMPILER_ID} STREQUAL "Intel") # IF(${CMAKE_CXX_COMPILER_ID} STREQUAL "Intel")
# LIST(APPEND CAB_ADDTIONAL_COMPILER_FLAGS -DMPICH_IGNORE_CXX_SEEK) # LIST(APPEND VF_COMPILER_DEFINITION MPICH_IGNORE_CXX_SEEK)
# LIST(APPEND CAB_ADDTIONAL_COMPILER_FLAGS -DMPICH_SKIP_MPICXX) # LIST(APPEND VF_COMPILER_DEFINITION MPICH_SKIP_MPICXX)
# ENDIF() # ENDIF()
#IF(${USE_DEM_COUPLING})
# add_subdirectory(Plugins/dem_coupling)
#ENDIF()
add_subdirectory(${VF_THIRD_DIR}/MuParser) add_subdirectory(${VF_THIRD_DIR}/MuParser)
add_subdirectory(src/cpu/VirtualFluidsCore) add_subdirectory(src/cpu/VirtualFluidsCore)
......
# Old VF basics defines. TODO: might be deleted in future.
#LIST(APPEND VF_COMPILER_DEFINITION CAB_BOOST)
#LIST(APPEND VF_COMPILER_DEFINITION BOOST_SIGNALS_NO_DEPRECATION_WARNING)
#LIST(APPEND VF_COMPILER_DEFINITION CAB_RUBY)
#LIST(APPEND VF_COMPILER_DEFINITION mpe=mpilog)
#LIST(APPEND VF_COMPILER_DEFINITION noshlib)
#LIST(APPEND VF_COMPILER_DEFINITION SINGLEPRECISION)
include(Core/buildInfo.cmake) include(Core/buildInfo.cmake)
......
IF(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
SET(CAB_ADDITIONAL_LINK_LIBRARIES ${CAB_ADDITIONAL_LINK_LIBRARIES} rt)
SET(CAB_ADDITIONAL_LINK_LIBRARIES ${CAB_ADDITIONAL_LINK_LIBRARIES} gomp)
ENDIF()
IF(${CMAKE_CXX_COMPILER_ID} STREQUAL "Intel")
SET(CAB_ADDITIONAL_LINK_LIBRARIES ${CAB_ADDITIONAL_LINK_LIBRARIES} irc)
SET(CAB_ADDITIONAL_LINK_FLAGS ${CAB_ADDITIONAL_LINK_FLAGS} parallel)
ENDIF()
IF(${USE_METIS}) IF(${USE_METIS})
SET(LINK_LIBRARY optimized ${METIS_RELEASE_LIBRARY} debug ${METIS_DEBUG_LIBRARY}) SET(LINK_LIBRARY optimized ${METIS_RELEASE_LIBRARY} debug ${METIS_DEBUG_LIBRARY})
SET(CAB_ADDITIONAL_LINK_LIBRARIES ${CAB_ADDITIONAL_LINK_LIBRARIES} ${LINK_LIBRARY}) SET(CAB_ADDITIONAL_LINK_LIBRARIES ${CAB_ADDITIONAL_LINK_LIBRARIES} ${LINK_LIBRARY})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment