Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor cmake #3

Closed
wants to merge 61 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
a8234a8
first commit after separation from dycore, needs cleanup
havogt Dec 1, 2016
2b15677
Squashed 'libs/googletest/' content from commit a3ac2d7
havogt Dec 2, 2016
9269b2a
Merge commit '2b15677ce8810b733837ed205930e022674e7fad' as 'libs/goog…
havogt Dec 2, 2016
30faa0b
fix cmake to build libs/googletest
havogt Dec 2, 2016
591d5d8
Squashed 'libs/serialbox/' content from commit 9a5be99
havogt Dec 2, 2016
4ca5b76
Merge commit '591d5d8cb3a5ae0cf94f1094c48b1c355473b6a3' as 'libs/seri…
havogt Dec 2, 2016
366627e
Merge pull request #1 from GridTools/add_gtest_as_subtree
havogt Dec 2, 2016
99c0c11
fix cmake for serialbox
havogt Dec 2, 2016
43204b0
Merge pull request #2 from GridTools/add_serialbox_as_subtree
havogt Dec 2, 2016
94e6738
add install target
havogt Dec 2, 2016
46bb2af
add install target
havogt Dec 5, 2016
5764aa6
make include path relative
havogt Dec 5, 2016
e42b8cb
export gridtools_verification lib target
havogt Dec 5, 2016
e41a598
fix library name
havogt Dec 5, 2016
bdea30d
fix include path
havogt Dec 5, 2016
5246e5f
apply gridtools naming scheme
havogt Dec 5, 2016
7946192
change gtest libs
havogt Dec 5, 2016
15ade54
fix include
havogt Dec 5, 2016
2e86090
Merge pull request #3 from GridTools/apply_gridtools_coding_style
havogt Dec 5, 2016
d2a6e01
error_metric as template (+drop default values)
havogt Dec 5, 2016
ca7f4b5
make verification, verification_reporter & field_collection templates
havogt Dec 6, 2016
f446366
make type_erased_field template for Real type
havogt Dec 6, 2016
00acc1d
fix field_initializer
havogt Dec 6, 2016
0c48353
remove dependency on DYCORE_USE_GPU
havogt Dec 6, 2016
f0cf79e
remove timer (currently not used from within the verification)
havogt Dec 6, 2016
431b539
fix field helper
havogt Dec 6, 2016
df62adb
Merge pull request #4 from GridTools/template_real_type
havogt Dec 6, 2016
3662afd
move a base unittest_environment from dycore to verification
havogt Dec 6, 2016
bb43852
test main file
havogt Dec 6, 2016
d803e7c
add the singleton to unittest_environment
havogt Dec 6, 2016
8724fdc
fix main
havogt Dec 6, 2016
6ce042a
parameter for name of serialized data
havogt Dec 7, 2016
da0bf32
Implement "also_previous" (#8)
havogt Jan 5, 2017
b5d216b
remove hack for a gridtools bug which is now resolved (#9)
havogt Jan 5, 2017
3038d5e
If input field was on device than copy it again after loading (#11)
havogt Jan 9, 2017
d77fdc3
Recover unit tests (#12)
havogt Jul 20, 2017
f21e430
New GridTools Storage (#13)
havogt Oct 11, 2017
7d38b91
Integrate the CMake configuration from Serialbox (#17)
pspoerri Oct 19, 2017
337927d
Patch to support other archive formats (#18)
adamryczkowski Dec 4, 2017
4a70be9
Adapt to new serialbox2 convention (Serialbox v2.2.1) (#20)
havogt Dec 15, 2017
a152251
Flexible error metric (#21)
havogt Feb 23, 2018
ee17e1f
Recovering proper error message with field size (#23)
havogt Apr 4, 2018
de2b42d
Fieldview by value (#24)
havogt Apr 4, 2018
7427814
Field by value: missing fix (#25)
havogt Apr 6, 2018
b9a7c8d
New gridtools include structure (#26)
havogt Apr 12, 2018
da9fbba
implement alsoPrevious parameter for read (#27)
lukasm91 Apr 25, 2018
9816063
Sync before registering a field (#29)
havogt May 15, 2018
6472116
Update to gridtools 1.07.00 (#28)
havogt May 18, 2018
dd666bf
Fix unittest after renaming enum constants (#30)
lukasm91 Aug 13, 2018
d7b396e
update gtest to 1.8.1 (support for target export)
havogt Sep 25, 2018
f6044de
refactor cmake
havogt Sep 25, 2018
c8b8b79
use boost from target
havogt Sep 25, 2018
676fc7e
find_dependency->find_package
havogt Sep 25, 2018
67fe491
use proper versioning
havogt Sep 25, 2018
0eac78d
install for development
havogt Oct 2, 2018
46bb440
remove pthread dependency
havogt Oct 3, 2018
ab77d76
add missing includes
havogt Oct 3, 2018
a9d5591
remove stupid file
havogt Oct 4, 2018
0cb5bad
Use new FindBoost.cmake (#31)
lukasm91 Oct 4, 2018
53115ea
Merge branch 'master' into refactor_cmake
havogt Oct 4, 2018
fc34344
missing boost libraries in CMake
havogt Oct 4, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
60 changes: 60 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
---
Language: Cpp
# BasedOnStyle: LLVM
AccessModifierOffset: -2
ConstructorInitializerIndentWidth: 4
#AlignEscapedNewlinesLeft: false
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AlwaysBreakTemplateDeclarations: true
AlwaysBreakBeforeMultilineStrings: false
BreakBeforeBinaryOperators: false
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BinPackParameters: false
BinPackArguments: false
ColumnLimit: 120
ConstructorInitializerAllOnOneLineOrOnePerLine: false
DerivePointerAlignment: false
ExperimentalAutoDetectBinPacking: false
IndentCaseLabels: false
IndentWrappedFunctionNames: false
IndentFunctionDeclarationAfterType: false
MaxEmptyLinesToKeep: 1
KeepEmptyLinesAtTheStartOfBlocks: true
NamespaceIndentation: All
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakString: 1000
PenaltyBreakFirstLessLess: 120
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Right
SpacesBeforeTrailingComments: 1
Cpp11BracedListStyle: true
Standard: Cpp11
IndentWidth: 4
TabWidth: 8
UseTab: Never
BreakBeforeBraces: Attach
SpacesInParentheses: false
SpacesInAngles: true
SpaceInEmptyParentheses: false
SpacesInCStyleCastParentheses: false
SpacesInContainerLiterals: true
SpaceBeforeAssignmentOperators: true
ContinuationIndentWidth: 4
CommentPragmas: '*'
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
SpaceBeforeParens: ControlStatements
DisableFormat: false
AlignAfterOpenBracket: false
AlignEscapedNewlinesLeft: true
...

9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/build*
/install*/
/*.user
/.project
/.cproject
/serialbox
/external
/.settings

75 changes: 75 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
cmake_minimum_required(VERSION 3.9.0)
# set the installation prefix
# Note: setting this *before* the project imposes a default that the user is
# able to change.
SET(CMAKE_INSTALL_PREFIX "${CMAKE_SOURCE_DIR}/install/" CACHE PATH "installation prefix")

project(gridtools-verification VERSION 0.10.0 LANGUAGES CXX C)

set(gridtools-verification_VERSION_STRING
"${gridtools-verification_VERSION_MAJOR}.${gridtools-verification_VERSION_MINOR}.${gridtools-verification_VERSION_PATCH}")
set(SERIALBOX_VERSION_REQUIRED "2.5.0")

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")

#----------------- CMake options
# C++11 compiler support
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# Do we use terminal colors?
set(GT_VERIFICATION_USE_COLOR "ON" CACHE BOOL "Enable colored terminal output")
if(NOT(GT_VERIFICATION_USE_COLOR))
add_definitions(-DDYCORE_NO_COLOR)
endif()

# Set build type to Release if nothing was specified
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING
"Choose the type of build, options are: Debug Release" FORCE)
message(STATUS "Setting build type to 'Release' as none was specified")
endif(NOT CMAKE_BUILD_TYPE)

#----------------- find Serialbox2
find_package( Serialbox "${SERIALBOX_VERSION_REQUIRED}" REQUIRED HINTS
"${CMAKE_CURRENT_LIST_DIR}/../serialbox2/install/cmake"
"${SERIALBOX_ROOT}/cmake"
"${SERIALBOX_DIR}/cmake"
"$ENV{SERIALBOX_ROOT}/cmake")

#----------------- find boost
set( Boost_NO_SYSTEM_PATHS ON )
set( BOOST_INCLUDEDIR "${SERIALBOX_BOOST_INCLUDE_DIRS}" )
set( REQUIRED_BOOST_COMPONENTS ${SERIALBOX_REQUIRED_BOOST_COMPONENTS} program_options system)
find_package( Boost ${SERIALBOX_BOOST_VERSION} REQUIRED ${REQUIRED_BOOST_COMPONENTS})

#----------------- build Google Test
# Since CMake has a problem with pthread when passed to nvcc.
# (https://gitlab.kitware.com/cmake/cmake/issues/18008)
set(gtest_disable_pthreads ON CACHE BOOL "" FORCE)
add_subdirectory(libs/googletest)

#----------------- build verification framework
add_subdirectory(src)

#----------------- install verification framework
# building for development
option(GT_VERIFICATION_DEVELOPMENT "If enabled, headers will be installed as symlinks to the src directory, to allow IDEs to jump between files" OFF)

if(NOT GT_VERIFICATION_DEVELOPMENT)
install( DIRECTORY src/ DESTINATION "include/gridtools_verification" FILES_MATCHING PATTERN "*.h" )
else()
file(GLOB_RECURSE header_files RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/src" "src/*.h")
foreach(file ${header_files})
get_filename_component(directory ${file} DIRECTORY)
install(DIRECTORY DESTINATION include/gridtools_verification/${directory})
install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_CURRENT_SOURCE_DIR}/src/${file} ${CMAKE_INSTALL_PREFIX}/include/gridtools_verification/${file})")
endforeach()
endif()

install(EXPORT gridtools_verificationTargets DESTINATION cmake NAMESPACE gridtools_verification::)

#----------------- packaging
include(cmake/Packaging.cmake)

add_subdirectory(unittest)
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
# gridtools_verification

## Installation instructions
- Install serialbox2 with gridtools support: cmake .. -DCMAKE_INSTALL_PREFIX=../install -DGRIDTOOLS_ROOT=<PATH_TO_GRIDTOOLS> -DSERIALBOX_TESTING_GRIDTOOLS=ON
- Install gridtools_verificaiton: cmake .. -DGRIDTOOLS_ROOT=<PATH_TO_GRIDTOOLS> -DSERIALBOX_ROOT=<PATH_TO_SERIALBOX_INSTALLED_ROOT>
Loading