Skip to content

Commit

Permalink
Update to Kassiopeia 3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
zykure committed May 1, 2020
1 parent f05ccd6 commit 53e039d
Show file tree
Hide file tree
Showing 2,921 changed files with 293,076 additions and 238,379 deletions.
64 changes: 64 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
BasedOnStyle: LLVM
# This style configuration is based on the LLVM style. Only non-default values are listed below.
# To see all the default values of the base style, run: clang-format --style=LLVM --dump-config

Language: Cpp
Standard: Cpp11
ColumnLimit: 120
IndentWidth: 4

AccessModifierOffset: -2
AlignConsecutiveMacros: true
AllowAllArgumentsOnNextLine: false
AllowAllConstructorInitializersOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: true
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Empty
AllowShortLambdasOnASingleLine: Inline
AlwaysBreakTemplateDeclarations: MultiLine
BinPackArguments: false
BraceWrapping:
AfterCaseLabel: false
AfterClass: true
AfterControlStatement: false
AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterObjCDeclaration: false
AfterStruct: true
AfterUnion: true
AfterExternBlock: false
BeforeCatch: true
BeforeElse: true
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyRecord: false
SplitEmptyNamespace: false
#BreakBeforeBraces: Stroustrup
BreakBeforeBraces: Custom
BreakConstructorInitializers: AfterColon
BreakInheritanceList: AfterColon
BreakStringLiterals: false
ConstructorInitializerAllOnOneLineOrOnePerLine: true
IncludeBlocks: Regroup
IncludeCategories:
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 2
SortPriority: 2
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
Priority: 3
- Regex: '<[[:alnum:].]+>'
Priority: 4
- Regex: '.*'
Priority: 1
SortPriority: 0
IndentCaseLabels: true
MaxEmptyLinesToKeep: 2
PointerAlignment: Left
SpaceAfterCStyleCast: true
SpaceAfterTemplateKeyword: false
SpacesBeforeTrailingComments: 2
ReflowComments: false
...
13 changes: 11 additions & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,16 @@
.project
.settings
.cproject
build
install
Dockerfile
.dockerignore

[Bb]uild*
[Ii]nstall*
CMakeCache.txt
CMakeLists.txt.user*

*~
*.bak
*.tmp
*.old
*.srctrl*
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
home/
/*build*
/*Build*
/*install*
/*Install*
/IndependentKassiopeia/
/.settings
*~
*.tags
*.bak
*.tmp
*.log
*.user
*.autosave
*.project
*.plist
*.cbp
*.cproject
*.DS_store
Expand All @@ -34,6 +38,8 @@ cmake_install.cmake
*Config.cmake
*ConfigVersion.cmake
*ConfigInstalled.cmake
home/
*.ninja
.ninja_*
.clang_complete
.idea/
.ipynb_checkpoints/
123 changes: 87 additions & 36 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
set( CMAKE_MINIMUM_VERSION "2.8.6" )
set( CMAKE_MINIMUM_VERSION "3.13.0" )
cmake_minimum_required( VERSION ${CMAKE_MINIMUM_VERSION} )

# project version
set( KASPER_VERSION_MAJOR 3 )
set( KASPER_VERSION_MINOR 5 )
set( KASPER_VERSION_PATCH 0 )
set( KASPER_VERSION_PATCH 90 )
set( KASPER_VERSION "${KASPER_VERSION_MAJOR}.${KASPER_VERSION_MINOR}.${KASPER_VERSION_PATCH}" )

#project( Kasper VERSION ${KASPER_VERSION} )
project( Kasper )

set( CMAKE_CXX_STANDARD 14 )
set( CMAKE_CXX_STANDARD_REQUIRED ON )
set( CMAKE_CXX_EXTENSIONS OFF )

set( CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/Kommon/cmake )
include( KasperDefaults )

Expand All @@ -27,7 +31,11 @@ set( CMAKE_BUILD_WITH_INSTALL_RPATH FALSE )
# which point to directories outside the build tree to the install RPATH
set( CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE )

set( CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib" )
if( APPLE )
set(CMAKE_INSTALL_RPATH "@executable_path/../${CMAKE_INSTALL_LIBDIR};@loader_path")
elseif( UNIX )
set(CMAKE_INSTALL_RPATH "$ORIGIN/../${CMAKE_INSTALL_LIBDIR}")
endif( APPLE )

# the RPATH to be used when installing, but only if it's not a system directory
LIST( FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir )
Expand All @@ -50,48 +58,78 @@ option( BUILD_KEMFIELD ${BUILD_KEMFIELD_DESC} ON )
set( BUILD_KASSIOPEIA_DESC "Build Kassiopeia [particle tracking simulation system]" )
option( BUILD_KASSIOPEIA ${BUILD_KASSIOPEIA_DESC} ON )

set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Werror" )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror" )
#set( CMAKE_EXE_LINKER_FLAG "${CMAKE_EXE_LINKER_FLAGS}" )
set( BUILD_UNIT_TESTS_DESC "Build Unit Tests [automatic testing of core functionality using GoogleTest]" )
option( BUILD_UNIT_TESTS ${BUILD_UNIT_TESTS_DESC} OFF )


if (CMAKE_COMPILER_IS_GNUCXX)
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -faligned-new" )
# Set a default build type if none was specified
if( NOT CMAKE_BUILD_TYPE )
message(STATUS "Setting build type to 'RelWithDebInfo' as none was specified.")
set( CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "" FORCE )
endif()

if (CMAKE_BUILD_TYPE MATCHES Rel)
# We like the compiler to be more pedantic than usual :-P
add_compile_options( -Wall -Wextra -Werror )

# Enable some advanced options depending on build type
if ( CMAKE_BUILD_TYPE MATCHES Rel )
option( COMPILER_TUNE_OPTIONS "Enable additional tuning options [compiles for local CPU, use with care!]" OFF )
if( COMPILER_TUNE_OPTIONS )
# these are advanced options for GCC which might improve performance ... or break everything - use with care!
set( TUNING_OPTIONS "-march=native -mfpmath=sse -funroll-loops" )
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${TUNING_OPTIONS}" )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TUNING_OPTIONS}" )
endif()
# These are advanced options for GCC which might improve performance ... or break everything - use with care!
add_compile_options( -march=native -mfpmath=sse -funroll-loops )
endif( COMPILER_TUNE_OPTIONS )
endif()

#option( COMPILER_ENABLE_PROFILING "Enable profiling( gprof-based, adds -pg flag to GCC calls )" OFF )
#if( COMPILER_ENABLE_PROFILING )
# set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -pg" )
# set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -pg" )
# set( CMAKE_EXE_LINKER_FLAGS" ${CMAKE_EXE_LINKER_FLAGS} -g -pg" )
#endif()
if( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR CMAKE_COMPILER_IS_GNUCXX )
# Use -faligned-new flag to trick gcc into using aligned allocators CL types.
# This is only used by KEMField, but required here because of include files.
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-faligned-new>)

if (CMAKE_COMPILER_IS_GNUCXX)
# Enable some advanced options
option( GCC_FORCE_LINKING "Fix linker errors with some GCC versions by adding the --no-as-needed flag" ON )
if( GCC_FORCE_LINKING )
set( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--no-as-needed" )
endif( )
add_link_options( -Wl,--no-as-needed )
endif( GCC_FORCE_LINKING )

option( GCC_REDUCE_MEMORY "Significantly reduce GCC memory usage by setting ftrack-macro-expansion=1 (default: 2)" OFF )
option( GCC_REDUCE_MEMORY "Significantly reduce GCC memory usage by setting ftrack-macro-expansion=1 (default: 2)" ON )
if( GCC_REDUCE_MEMORY )
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ftrack-macro-expansion=1" )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftrack-macro-expansion=1" )
add_compile_options( -ftrack-macro-expansion=1 )
endif( GCC_REDUCE_MEMORY )

option( GCC_ENABLE_PIPES "Use pipes to speed up compiling with GCC by adding the -pipe flag" ON )
if( GCC_ENABLE_PIPES )
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pipe" )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pipe" )
add_compile_options( -pipe )
endif( GCC_ENABLE_PIPES )

else( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" )
# Suppress warnings about unknown warning options. See https://bugs.llvm.org/show_bug.cgi?id=24979
add_compile_options( -Wno-unknown-warning-option )

endif()

# Enable some advanced options (compiler-independent)
option( ENABLE_PROFILING "Enable profiling (gperftools-based, adds '-lprofile' flag to linker calls)" OFF )
if( ENABLE_PROFILING )
find_library( PROFILER_LIBRARY profiler )
if ( PROFILER_LIBRARY )
add_link_options( -lprofiler )
endif( PROFILER_LIBRARY )
endif( ENABLE_PROFILING )

# Force coloured compiler output (useful for Ninja builds)
if( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" )
option( FORCE_COLOURED_OUTPUT "Always produce ANSI-colored output (GNU/Clang only)." OFF )
if( NOT DEFINED FORCE_COLOURED_OUTPUT AND "${CMAKE_GENERATOR}" MATCHES "Ninja" )
message(STATUS "Building with Ninja - enabling coloured compiler output.")
set( FORCE_COLOURED_OUTPUT ON CACHE BOOL "" FORCE )
endif()
if( FORCE_COLOURED_OUTPUT )
if( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" )
add_compile_options( -fdiagnostics-color=always )
elseif( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" )
add_compile_options( -fcolor-diagnostics )
endif()
endif( FORCE_COLOURED_OUTPUT )
endif()

mark_as_advanced( CLEAR CMAKE_VERBOSE_MAKEFILE )
Expand All @@ -117,26 +155,36 @@ endif( KASPER_EXPERIMENTAL )
# direct dependencies.

if( BUILD_KASSIOPEIA )
set( BUILD_KOMMON ON CACHE BOOL "${BUILD_KOMMON_DESC} (Required)" FORCE )
set( BUILD_KGEOBAG ON CACHE BOOL "${BUILD_KGEOBAG_DESC} (Required)" FORCE )
set( BUILD_KEMFIELD ON CACHE BOOL "${BUILD_KEMFIELD_DESC} (Required)" FORCE )
set( BUILD_KGEOBAG ON CACHE BOOL "${BUILD_KGEOBAG_DESC} (Required)" FORCE )
set( BUILD_KOMMON ON CACHE BOOL "${BUILD_KOMMON_DESC} (Required)" FORCE )

if( NOT KASPER_USE_GSL )
message("Kassiopeia requires GSL to be enabled in Kasper (activated automatically)" )
endif()
set( KASPER_USE_GSL ON CACHE BOOL "(Required)" FORCE )
endif()
endif( BUILD_KASSIOPEIA )

if( BUILD_KEMFIELD )
set( BUILD_KGEOBAG ON CACHE BOOL "${BUILD_KGEOBAG_DESC} (Required)" FORCE )
set( BUILD_KOMMON ON CACHE BOOL "${BUILD_KOMMON_DESC} (Required)" FORCE )
endif( BUILD_KEMFIELD )

if( BUILD_KGEOBAG )
set( BUILD_KOMMON ON CACHE BOOL "${BUILD_KOMMON_DESC} (Required)" FORCE )

if( NOT KASPER_USE_GSL )
message("KGeoBag requires GSL to be enabled in Kasper (activated automatically)" )
endif()
set( KASPER_USE_GSL ON CACHE BOOL "(Required)" FORCE )
endif()
set( KASPER_USE_BOOST ON CACHE BOOL "(Required)" FORCE )
endif( BUILD_KGEOBAG )

# Build modules
# The order seems to matter! Please place dependent modules at the end.

if( BUILD_KOMMON )
add_subdirectory( Kommon )

set( KASPER_USE_BOOST ON CACHE BOOL "(Required)" FORCE )
endif()

if( BUILD_KGEOBAG )
Expand All @@ -151,11 +199,14 @@ if( BUILD_KASSIOPEIA )
add_subdirectory( Kassiopeia )
endif()

if( BUILD_UNIT_TESTS )
add_subdirectory( UnitTest )
endif()

#add_subdirectory( Documentation )

install( EXPORT KasperTargets DESTINATION ${CMAKE_INSTALL_DIR} )

configure_file( kasperenv.sh.in ${CMAKE_CURRENT_BINARY_DIR}/kasperenv.sh @ONLY )
configure_file( kasper-krypton.bash.in ${CMAKE_CURRENT_BINARY_DIR}/kasper-krypton.bash @ONLY )
configure_file( create_kasper_user_directory.sh.in ${CMAKE_CURRENT_BINARY_DIR}/create_kasper_user_directory.sh @ONLY )
install( PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/kasperenv.sh ${CMAKE_CURRENT_BINARY_DIR}/kasper-krypton.bash ${CMAKE_CURRENT_BINARY_DIR}/create_kasper_user_directory.sh DESTINATION ${BIN_INSTALL_DIR} )
install( PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/kasperenv.sh ${CMAKE_CURRENT_BINARY_DIR}/create_kasper_user_directory.sh DESTINATION ${BIN_INSTALL_DIR} )
6 changes: 1 addition & 5 deletions KEMField/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,14 @@ endif()

# KEMField version
set(MODULE_VERSION_MAJOR 3)
set(MODULE_VERSION_MINOR 6)
set(MODULE_VERSION_MINOR 7)
set(MODULE_VERSION_PATCH 0)
set(MODULE_VERSION "${MODULE_VERSION_MAJOR}.${MODULE_VERSION_MINOR}.${MODULE_VERSION_PATCH}")

project( KEMField )

include( KasperDefaults )

# require c++11
kasper_require_cpp11()

# module options

#option (${PROJECT_NAME}_USE_VTK "Enables the use of VTK for visualization" OFF)
Expand Down Expand Up @@ -48,7 +45,6 @@ add_cflag (KEMFIELD_USE_KOMMON)
kasper_find_module( KGeoBag )
add_cflag (KEMFIELD_USE_KGEOBAG)


# Input files
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/data)

Expand Down
Loading

0 comments on commit 53e039d

Please sign in to comment.