From f3337a02c722d6c139845c1a1123047566cada42 Mon Sep 17 00:00:00 2001 From: Simon Spannagel Date: Mon, 10 Feb 2020 09:50:38 +0100 Subject: [PATCH 1/5] Start switching CI to SFT LCG --- .gitlab-ci.d/init_x86_64.sh | 86 ++++++++----------------------------- .gitlab-ci.d/load_deps.sh | 1 + .gitlab-ci.yml | 76 ++++++-------------------------- 3 files changed, 33 insertions(+), 130 deletions(-) diff --git a/.gitlab-ci.d/init_x86_64.sh b/.gitlab-ci.d/init_x86_64.sh index 03610def..780c6701 100644 --- a/.gitlab-ci.d/init_x86_64.sh +++ b/.gitlab-ci.d/init_x86_64.sh @@ -21,26 +21,34 @@ if [ ! -d "/cvmfs" ]; then exit 1 fi -if [ ! -d "/cvmfs/clicdp.cern.ch" ]; then - echo "No clicdp CVMFS repository detected, please add it." +if [ ! -d "/cvmfs/sft.cern.ch" ]; then + echo "No SFT CVMFS repository detected, please make sure it is available." exit 1 fi - -if [ ! -d "/cvmfs/sft.cern.ch" ]; then - echo "No sft CVMFS repository detected, please add it." +if [ ! -d "/cvmfs/geant4.cern.ch" ]; then + echo "No Geant4 CVMFS repository detected, please make sure it is available." exit 1 fi +# Determine which LCG version to use +if [ -z ${LCG_VERSION} ]; then + echo "No explicit LCG version set, using LCG_96b." + LCG_VERSION="LCG_96b" +fi + # Determine which compiler to use if [ -z ${COMPILER_TYPE} ]; then + echo "No compiler type set, falling back to GCC." COMPILER_TYPE="gcc" fi if [ ${COMPILER_TYPE} == "gcc" ]; then - COMPILER_VERSION="gcc7" + echo "Compiler type set to GCC." + COMPILER_VERSION="gcc8" fi if [ ${COMPILER_TYPE} == "llvm" ]; then - COMPILER_VERSION="llvm40" + echo "Compiler type set to LLVM." + COMPILER_VERSION="clang8" fi # Choose build type @@ -49,70 +57,14 @@ if [ -z ${BUILD_TYPE} ]; then fi # General variables -CLICREPO=/cvmfs/clicdp.cern.ch SFTREPO=/cvmfs/sft.cern.ch export BUILD_FLAVOUR=x86_64-${OS}-${COMPILER_VERSION}-${BUILD_TYPE} #-------------------------------------------------------------------------------- -# Compiler -#-------------------------------------------------------------------------------- - -if [ ${COMPILER_TYPE} == "gcc" ]; then - source ${CLICREPO}/compilers/gcc/7.1.0/x86_64-${OS}/setup.sh -fi -if [ ${COMPILER_TYPE} == "llvm" ]; then - source ${CLICREPO}/compilers/llvm/4.0.0/x86_64-${OS}/setup.sh -fi - -#-------------------------------------------------------------------------------- -# Python +# Source full LCG view #-------------------------------------------------------------------------------- -export PYTHONDIR=${CLICREPO}/software/Python/2.7.13/${BUILD_FLAVOUR} -export PATH=${PYTHONDIR}/bin:$PATH -export LD_LIBRARY_PATH=${PYTHONDIR}/lib:${LD_LIBRARY_PATH} -#-------------------------------------------------------------------------------- -# CMake -#-------------------------------------------------------------------------------- - -export CMAKE_HOME=${CLICREPO}/software/CMake/3.8.1/${BUILD_FLAVOUR} -export PATH=${CMAKE_HOME}/bin:$PATH - -#-------------------------------------------------------------------------------- -# ROOT -#-------------------------------------------------------------------------------- - -export ROOTSYS=${CLICREPO}/software/ROOT/6.08.06/${BUILD_FLAVOUR} -export PYTHONPATH="$ROOTSYS/lib:$PYTHONPATH" -export PATH="$ROOTSYS/bin:$PATH" -export LD_LIBRARY_PATH="$ROOTSYS/lib:$LD_LIBRARY_PATH" -export CMAKE_PREFIX_PATH="$ROOTSYS:$CMAKE_PREFIX_PATH" - -#-------------------------------------------------------------------------------- -# Ninja -#-------------------------------------------------------------------------------- - -export Ninja_HOME=${CLICREPO}/software/Ninja/1.7.2/${BUILD_FLAVOUR} -export PATH="$Ninja_HOME:$PATH" - -#-------------------------------------------------------------------------------- -# Eigen -#-------------------------------------------------------------------------------- - -export Eigen_HOME=${CLICREPO}/software/Eigen/3.3.3/${BUILD_FLAVOUR}/ -export Eigen3_DIR=${Eigen_HOME}/share/eigen3/cmake/ -export CMAKE_PREFIX_PATH="$Eigen3_DIR:$CMAKE_PREFIX_PATH" - -#-------------------------------------------------------------------------------- -# Doxygen -#-------------------------------------------------------------------------------- - -export Doxygen_HOME=${SFTREPO}/lcg/releases/doxygen/1.8.11-ae1d3/${BUILD_FLAVOUR}/bin/ -export PATH="$Doxygen_HOME:$PATH" - -#-------------------------------------------------------------------------------- -# Git -#-------------------------------------------------------------------------------- +source ${SFTREPO}/lcg/views/${LCG_VERSION}/${BUILD_FLAVOUR}/setup.sh -export Git_HOME=${CLICREPO}/software/git/2.13.2/${BUILD_FLAVOUR} -export PATH=${Git_HOME}/bin:${PATH} +# Fix LCIO path for LCG_96, cmake configs are not properly placed: +export LCIO_DIR=$(dirname $(dirname $(readlink $(which lcio_event_counter)))) diff --git a/.gitlab-ci.d/load_deps.sh b/.gitlab-ci.d/load_deps.sh index e42031d7..569659d2 100644 --- a/.gitlab-ci.d/load_deps.sh +++ b/.gitlab-ci.d/load_deps.sh @@ -1 +1,2 @@ source $ROOTSYS/bin/thisroot.sh +source $G4INSTALL/bin/geant4.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 52029cec..9ab903ce 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -18,34 +18,14 @@ cmp:slc6-gcc: stage: compilation tags: - docker - image: clicdp/slc6-base + image: gitlab-registry.cern.ch/sft/docker/slc6:latest script: - export COMPILER_TYPE="gcc" - source .gitlab-ci.d/init_x86_64.sh - source .gitlab-ci.d/load_deps.sh - mkdir build - cd build - - cmake -GNinja -DCMAKE_BUILD_TYPE=RELEASE -DROOT_DIR=$ROOTSYS -DEigen3_DIR=$Eigen3_DIR .. - - ninja - - ninja install - artifacts: - paths: - - build - - bin - - lib - expire_in: 3 hour - -cmp:slc6-llvm: - stage: compilation - tags: - - docker - image: clicdp/slc6-base - script: - - export COMPILER_TYPE="llvm" - - source .gitlab-ci.d/init_x86_64.sh - - mkdir build - - cd build - - cmake -GNinja -DCMAKE_BUILD_TYPE=RELEASE -DROOT_DIR=$ROOTSYS -DEigen3_DIR=$Eigen3_DIR .. + - cmake -GNinja -DCMAKE_CXX_FLAGS="-Werror" -DCMAKE_BUILD_TYPE=RELEASE -DROOT_DIR=$ROOTSYS -DEigen3_DIR=$Eigen3_DIR .. - ninja - ninja install artifacts: @@ -59,14 +39,14 @@ cmp:cc7-gcc: stage: compilation tags: - docker - image: clicdp/cc7-base + image: gitlab-registry.cern.ch/sft/docker/centos7:latest script: - export COMPILER_TYPE="gcc" - source .gitlab-ci.d/init_x86_64.sh - source .gitlab-ci.d/load_deps.sh - mkdir build - cd build - - cmake -GNinja -DCMAKE_BUILD_TYPE=RELEASE -DROOT_DIR=$ROOTSYS -DEigen3_DIR=$Eigen3_DIR .. + - cmake -GNinja -DCMAKE_CXX_FLAGS="-Werror" -DCMAKE_BUILD_TYPE=RELEASE -DROOT_DIR=$ROOTSYS -DEigen3_DIR=$Eigen3_DIR .. - ninja - ninja install artifacts: @@ -88,7 +68,7 @@ cmp:cc7-docker: script: - mkdir build - cd build - - cmake3 -DBUILD_EventLoaderEUDAQ2=ON -DCMAKE_BUILD_TYPE=RELEASE -DROOT_DIR=$ROOTSYS -DEigen3_DIR=$Eigen3_DIR .. + - cmake3 -DCMAKE_CXX_FLAGS="-Werror" -DBUILD_EventLoaderEUDAQ2=ON -DCMAKE_BUILD_TYPE=RELEASE -DROOT_DIR=$ROOTSYS -DEigen3_DIR=$Eigen3_DIR .. - make - make install artifacts: @@ -102,13 +82,13 @@ cmp:cc7-llvm: stage: compilation tags: - docker - image: clicdp/cc7-base + image: gitlab-registry.cern.ch/sft/docker/centos7:latest script: - export COMPILER_TYPE="llvm" - source .gitlab-ci.d/init_x86_64.sh - mkdir build - cd build - - cmake -GNinja -DCMAKE_BUILD_TYPE=RELEASE -DROOT_DIR=$ROOTSYS -DEigen3_DIR=$Eigen3_DIR .. + - cmake -GNinja -DCMAKE_CXX_FLAGS="-Werror" -DCMAKE_BUILD_TYPE=RELEASE -DROOT_DIR=$ROOTSYS -DEigen3_DIR=$Eigen3_DIR .. - ninja - ninja install artifacts: @@ -127,7 +107,7 @@ cmp:mac1014-clang: - source .gitlab-ci.d/load_deps.sh - mkdir build - cd build - - cmake -GNinja -DCMAKE_BUILD_TYPE=RELEASE -DROOT_DIR=$ROOTSYS -DCMAKE_USE_RELATIVE_PATHS=TRUE -DEigen3_DIR=$Eigen3_DIR .. + - cmake -GNinja -DCMAKE_CXX_FLAGS="-Werror" -DCMAKE_BUILD_TYPE=RELEASE -DROOT_DIR=$ROOTSYS -DCMAKE_USE_RELATIVE_PATHS=TRUE -DEigen3_DIR=$Eigen3_DIR .. - ninja - ninja install artifacts: @@ -164,43 +144,13 @@ tst:telescope: # Format and Lint Checking # ############################ -# SLC 6 - -fmt:slc6-llvm-format: - stage: formatting - tags: - - docker - dependencies: - - cmp:slc6-llvm - image: clicdp/slc6-base - script: - - export COMPILER_TYPE="llvm" - - source .gitlab-ci.d/init_x86_64.sh - - cd build/ - - ninja check-format - -fmt:slc6-llvm-lint: - stage: formatting - tags: - - docker - dependencies: - - cmp:slc6-llvm - image: clicdp/slc6-base - script: - - export COMPILER_TYPE="llvm" - - source .gitlab-ci.d/init_x86_64.sh - - cd build/ - - ninja check-lint - -# CentOS 7 - fmt:centos7-llvm-format: stage: formatting tags: - docker dependencies: - cmp:cc7-llvm - image: clicdp/cc7-base + image: gitlab-registry.cern.ch/sft/docker/centos7:latest script: - export COMPILER_TYPE="llvm" - source .gitlab-ci.d/init_x86_64.sh @@ -213,7 +163,7 @@ fmt:cc7-llvm-lint: - docker dependencies: - cmp:cc7-llvm - image: clicdp/cc7-base + image: gitlab-registry.cern.ch/sft/docker/centos7:latest script: - export COMPILER_TYPE="llvm" - source .gitlab-ci.d/init_x86_64.sh @@ -230,7 +180,7 @@ cmp:doxygen: stage: documentation tags: - docker - image: clicdp/cc7-base + image: gitlab-registry.cern.ch/sft/docker/centos7:latest dependencies: [] script: - source .gitlab-ci.d/init_x86_64.sh @@ -273,7 +223,7 @@ pkg:slc6-gcc: stage: packaging tags: - docker - image: clicdp/slc6-base + image: gitlab-registry.cern.ch/sft/docker/slc6:latest only: - tags - schedules @@ -297,7 +247,7 @@ pkg:cc7-gcc: stage: packaging tags: - docker - image: clicdp/cc7-base + image: gitlab-registry.cern.ch/sft/docker/centos7:latest only: - tags - schedules -- GitLab From d53c7104e3ec5df239a2da597f40ea1ffcb42e11 Mon Sep 17 00:00:00 2001 From: Simon Spannagel Date: Mon, 10 Feb 2020 09:59:03 +0100 Subject: [PATCH 2/5] CI: switch to clang-format-8 --- CMakeLists.txt | 3 + cmake/clang-cpp-checks.cmake | 67 +++++++++++++--------- doc/usermanual/chapters/installation.tex | 2 +- etc/git-hooks/pre-commit-clang-format-hook | 41 ++++++++----- 4 files changed, 70 insertions(+), 43 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index aca4d6a5..c4b50e7c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -160,6 +160,9 @@ ADD_RUNTIME_DEP(thisroot.sh) # Load cpp format and check tools # ################################### +# Set the clang-format version required by the CI for correct formatting: +SET(CLANG_FORMAT_VERSION "8") + # Set the source files to clang-format (FIXME: determine this better) FILE(GLOB_RECURSE CHECK_CXX_SOURCE_FILES diff --git a/cmake/clang-cpp-checks.cmake b/cmake/clang-cpp-checks.cmake index f71033ac..3da9fa64 100644 --- a/cmake/clang-cpp-checks.cmake +++ b/cmake/clang-cpp-checks.cmake @@ -21,34 +21,47 @@ IF(NOT CHECK_CXX_SOURCE_FILES) ENDIF() # Adding clang-format check and formatter if found -FIND_PROGRAM(CLANG_FORMAT NAMES "clang-format-6.0" "clang-format-5.0" "clang-format-4.0" "clang-format" "clang-format-7") +FIND_PROGRAM(CLANG_FORMAT NAMES "clang-format-8" "clang-format") IF(CLANG_FORMAT) - MESSAGE(STATUS "Found ${CLANG_FORMAT}, adding formatting targets") - ADD_CUSTOM_TARGET( - format - COMMAND - ${CLANG_FORMAT} - -i - -style=file - ${CHECK_CXX_SOURCE_FILES} - COMMENT "Auto formatting of all source files" - ) + EXEC_PROGRAM(${CLANG_FORMAT} ${CMAKE_CURRENT_SOURCE_DIR} ARGS --version OUTPUT_VARIABLE CLANG_VERSION) + STRING(REGEX REPLACE ".*([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" CLANG_MAJOR_VERSION ${CLANG_VERSION}) - ADD_CUSTOM_TARGET( - check-format - COMMAND - ${CLANG_FORMAT} - -style=file - -output-replacements-xml - ${CHECK_CXX_SOURCE_FILES} - # print output - | tee ${CMAKE_BINARY_DIR}/check_format_file.txt | grep -c "replacement " | - tr -d "[:cntrl:]" && echo " replacements necessary" - # WARNING: fix to stop with error if there are problems - COMMAND ! grep -c "replacement " - ${CMAKE_BINARY_DIR}/check_format_file.txt > /dev/null - COMMENT "Checking format compliance" - ) + # We currently require version 8 - which is not available on OSX... + IF(${CLANG_MAJOR_VERSION} EQUAL ${CLANG_FORMAT_VERSION} OR DEFINED ${APPLE}) + IF(DEFINED ${APPLE}) + MESSAGE(WARNING "Found ${CLANG_FORMAT} version ${CLANG_MAJOR_VERSION}, this might lead to incompatible formatting") + ELSE() + MESSAGE(STATUS "Found ${CLANG_FORMAT} version ${CLANG_FORMAT_VERSION}, adding formatting targets") + ENDIF() + + ADD_CUSTOM_TARGET( + format + COMMAND + ${CLANG_FORMAT} + -i + -style=file + ${CHECK_CXX_SOURCE_FILES} + COMMENT "Auto formatting of all source files" + ) + + ADD_CUSTOM_TARGET( + check-format + COMMAND + ${CLANG_FORMAT} + -style=file + -output-replacements-xml + ${CHECK_CXX_SOURCE_FILES} + # print output + | tee ${CMAKE_BINARY_DIR}/check_format_file.txt | grep -c "replacement " | + tr -d "[:cntrl:]" && echo " replacements necessary" + # WARNING: fix to stop with error if there are problems + COMMAND ! grep -c "replacement " + ${CMAKE_BINARY_DIR}/check_format_file.txt > /dev/null + COMMENT "Checking format compliance" + ) + ELSE() + MESSAGE(STATUS "Could only find version ${CLANG_MAJOR_VERSION} of clang-format, but version ${CLANG_FORMAT_VERSION} is required.") + ENDIF() ELSE() MESSAGE(STATUS "Could NOT find clang-format") ENDIF() @@ -59,7 +72,7 @@ IF(${CMAKE_CXX_STANDARD}) SET(CXX_STD ${CMAKE_CXX_STANDARD}) ENDIF() -FIND_PROGRAM(CLANG_TIDY NAMES "clang-tidy-6.0" "clang-tidy-5.0" "clang-tidy-4.0" "clang-tidy") +FIND_PROGRAM(CLANG_TIDY NAMES "clang-tidy-8" "clang-tidy") # Enable clang tidy only if using a clang compiler IF(CLANG_TIDY AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang") # If debug build enabled do automatic clang tidy diff --git a/doc/usermanual/chapters/installation.tex b/doc/usermanual/chapters/installation.tex index 2432b5a3..7a0b7378 100644 --- a/doc/usermanual/chapters/installation.tex +++ b/doc/usermanual/chapters/installation.tex @@ -9,7 +9,7 @@ This chapter contains details on the standard installation process and informati \section{Supported Operating Systems} \label{sec:os} \corry is designed to run without issues on either a recent Linux distribution or Mac OS\,X. -Furthermore, the continuous integration of the project ensures correct building and functioning of the software framework on CentOS\,7 (with GCC and LLVM), SLC\,6 (with GCC and LLVM) and Mac OS Mojave (OS X 10.14, with AppleClang). +Furthermore, the continuous integration of the project ensures correct building and functioning of the software framework on CentOS\,7 (with GCC and LLVM), SLC\,6 (with GCC only) and Mac OS Mojave (OS X 10.14, with AppleClang). \section{CMVFS} \label{sec:cvmfs_install} diff --git a/etc/git-hooks/pre-commit-clang-format-hook b/etc/git-hooks/pre-commit-clang-format-hook index 56038017..c13fe6f6 100755 --- a/etc/git-hooks/pre-commit-clang-format-hook +++ b/etc/git-hooks/pre-commit-clang-format-hook @@ -8,7 +8,7 @@ ################################################################## # SETTINGS # set path to clang-format binary -for bin in "clang-format-6.0" "clang-format-5.0" "clang-format-4.0" "clang-format-7" "clang-format"; +for bin in "clang-format-8" "clang-format"; do CLANG_FORMAT=$(which "$bin") [ -n "$CLANG_FORMAT" ] && break @@ -60,26 +60,37 @@ if [ ! -x "$CLANG_FORMAT" ] ; then exit 1 fi +if ! "$CLANG_FORMAT" --version | grep 'clang-format version 8\.0' >/dev/null 2>/dev/null; then + # Be indulgent with OSX users, no 4.0 seems to be available... + if [[ "$OSTYPE" != "darwin"* ]]; then + printf "Error: clang-format version 8.0 is required (exactly), cannot check format!\n" + exit 1 + else + printf "Warning: clang-format version 8.0 is required, formatting might be incompatible!\n" + fi +fi + + # create one patch containing all changes to the files -git diff-index --cached --diff-filter=ACMR --name-only $against -- src/ | while read file; +git diff-index --cached --diff-filter=ACMR --name-only $against -- | while read file; do # ignore file if we do check for file extensions and the file # does not match any of the extensions specified in $FILE_EXTS if ! matches_extension "$file"; then continue; fi - + # temporary save the staged file to work with this instead of the real file git show :$file > $staged_file - + # clang-format our sourcefile, create a patch and append it to our $patch cat "$staged_file" | "$CLANG_FORMAT" -assume-filename=$file -style=file | \ git diff --no-index -- "$staged_file" - | \ sed -e "s|--- a$staged_file|--- a/$file|" | \ - sed -e "s|+++ b/-|+++ b/$file|" >> "$patch" - - # also make a colored patch for displaying if needed - if [ "$VERBOSE" -ne 0 ] ; then + sed -e "s|+++ b/-|+++ b/$file|" >> "$patch" + + # also make a colored patch for displaying if needed + if [ "$VERBOSE" -ne 0 ] ; then cat "$staged_file" | "$CLANG_FORMAT" -assume-filename=$file -style=file | \ git diff --color --no-index -- "$staged_file" - | \ sed -e "s|--- a$staged_file|--- a/$file|" | \ @@ -89,7 +100,7 @@ done # if no patch has been generated all is ok, clean up the file stub and exit if [ ! -s "$patch" ] ; then - if [ "$VERBOSE" -ne 0 ] ; then + if [ "$VERBOSE" -ne 0 ] ; then printf "Changes in this commit comply with the clang-format rules.\n" fi rm -f "$patch" @@ -108,7 +119,7 @@ if [ $? -ne 0 ] ; then rm -f "$patch"; rm -f "$patch_color"; rm -f "$staged_file" - exit 1; + exit 1; fi # a patch has been created, let the user know about it @@ -118,24 +129,24 @@ if [ "$VERBOSE" -ne 0 ] ; then printf "The following differences were found between the code to commit " printf "and the clang-format rules:\n" cat "$patch_color" - printf "\n" + printf "\n" fi -# assign stdin back to keyboard +# assign stdin back to keyboard exec < /dev/tty # ask what we want to do with the patch while true; do read -p "Do you want to install the patch (yes - commit with patch, no - do not commit)? [y/n] " yn case $yn in - [Yy] ) - git apply --index $patch; + [Yy] ) + git apply --index $patch; rm -f "$patch"; rm -f "$patch_color"; rm -f "$staged_file" exit 0 ;; - [Nn] ) + [Nn] ) printf "Changes are not applied! You can apply these changes manually with:\n"; printf " git apply --index $patch\n"; printf " (needs to be called from the root directory of your repository)\n"; -- GitLab From 2674731aab4ce1a903c0ffe03c94d6b7e873f07e Mon Sep 17 00:00:00 2001 From: Simon Spannagel Date: Mon, 10 Feb 2020 10:00:09 +0100 Subject: [PATCH 3/5] Apply clang-format-8 formatting changes --- src/core/utils/file.h | 9 +++++---- src/objects/GblTrack.cpp | 3 +-- src/objects/Linkdef.h | 9 +++++---- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/core/utils/file.h b/src/core/utils/file.h index 36603fd1..c6c963be 100644 --- a/src/core/utils/file.h +++ b/src/core/utils/file.h @@ -158,10 +158,11 @@ namespace corryvreckan { * All the required directories are deleted recursively from the top-directory (use this with caution). */ inline void remove_path(const std::string& path) { - int status = nftw(path.c_str(), - [](const char* remove_path, const struct stat*, int, struct FTW*) { return remove(remove_path); }, - 64, - FTW_DEPTH); + int status = nftw( + path.c_str(), + [](const char* remove_path, const struct stat*, int, struct FTW*) { return remove(remove_path); }, + 64, + FTW_DEPTH); if(status != 0) { throw std::invalid_argument("path cannot be completely deleted"); diff --git a/src/objects/GblTrack.cpp b/src/objects/GblTrack.cpp index d9cf19e0..4c6c7c78 100644 --- a/src/objects/GblTrack.cpp +++ b/src/objects/GblTrack.cpp @@ -59,7 +59,6 @@ void GblTrack::fit() { scatterWidth(0) = 1 / (scatteringTheta(material, total_material) * scatteringTheta(material, total_material)); scatterWidth(1) = scatterWidth(0); point.addScatterer(Eigen::Vector2d::Zero(), scatterWidth); - }; auto JacToNext = [](double val) { Matrix5d Jac; @@ -81,7 +80,7 @@ void GblTrack::fit() { }; // lambda to add plane (not the first one) and air scatterers //FIXME: Where to put them? auto addPlane = [&JacToNext, &prevPos, &addMeasurementtoGblPoint, &addScattertoGblPoint, &points, this]( - std::vector::iterator& plane) { + std::vector::iterator& plane) { double dist = plane->postion() - prevPos; double frac1 = 0.21, frac2 = 0.58; // Current layout diff --git a/src/objects/Linkdef.h b/src/objects/Linkdef.h index 26912704..92d6edaa 100644 --- a/src/objects/Linkdef.h +++ b/src/objects/Linkdef.h @@ -8,9 +8,10 @@ #pragma link off all functions; // Missing ROOT objects -#pragma link C++ class ROOT::Math::Cartesian2D < unsigned int > +; -#pragma link C++ class ROOT::Math::DisplacementVector2D < ROOT::Math::Cartesian2D < unsigned int >, \ - ROOT::Math::DefaultCoordinateSystemTag > +; +#pragma link C++ class ROOT::Math::Cartesian2D < unsigned int> + ; +#pragma link C++ class ROOT::Math::DisplacementVector2D < ROOT::Math::Cartesian2D < unsigned int>, \ + ROOT::Math::DefaultCoordinateSystemTag> + \ + ; // Corryvreckan objects #pragma link C++ class corryvreckan::Object + ; @@ -26,4 +27,4 @@ #pragma link C++ class corryvreckan::Event + ; // Vector of Object for internal storage -#pragma link C++ class std::vector < corryvreckan::Object* > +; +#pragma link C++ class std::vector < corryvreckan::Object*> + ; -- GitLab From 60f2181cfb162f7f036b5f77c1a8cb2cd20349e2 Mon Sep 17 00:00:00 2001 From: Simon Spannagel Date: Mon, 10 Feb 2020 10:05:47 +0100 Subject: [PATCH 4/5] Remove "-Werror" for regular builds, keep in CI --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c4b50e7c..f515d69e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -84,7 +84,7 @@ INCLUDE("cmake/corryvreckan.cmake") ######################################### # Set standard build flags -SET(COMPILER_FLAGS -pedantic -Wall -Wextra -Wcast-align -Wcast-qual -Wconversion -Wuseless-cast -Wctor-dtor-privacy -Wzero-as-null-pointer-constant -Wdisabled-optimization -Wformat=2 -Winit-self -Wlogical-op -Wmissing-declarations -Wmissing-include-dirs -Wnoexcept -Wold-style-cast -Woverloaded-virtual -Wredundant-decls -Wsign-conversion -Wsign-promo -Wstrict-null-sentinel -Wswitch-default -Wundef -Werror -Wshadow -Wformat-security -Wdeprecated -fdiagnostics-color=auto -Wheader-hygiene) +SET(COMPILER_FLAGS -pedantic -Wall -Wextra -Wcast-align -Wcast-qual -Wconversion -Wuseless-cast -Wctor-dtor-privacy -Wzero-as-null-pointer-constant -Wdisabled-optimization -Wformat=2 -Winit-self -Wlogical-op -Wmissing-declarations -Wmissing-include-dirs -Wnoexcept -Wold-style-cast -Woverloaded-virtual -Wredundant-decls -Wsign-conversion -Wsign-promo -Wstrict-null-sentinel -Wswitch-default -Wundef -Wshadow -Wformat-security -Wdeprecated -fdiagnostics-color=auto -Wheader-hygiene) INCLUDE("cmake/compiler-flag-checks.cmake") -- GitLab From b60e8a89a000189bc947a75c66b70b776f5f30c6 Mon Sep 17 00:00:00 2001 From: Simon Spannagel Date: Mon, 10 Feb 2020 10:59:12 +0100 Subject: [PATCH 5/5] CI: remove unnecessarily loaded dep --- .gitlab-ci.d/load_deps.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitlab-ci.d/load_deps.sh b/.gitlab-ci.d/load_deps.sh index 569659d2..e42031d7 100644 --- a/.gitlab-ci.d/load_deps.sh +++ b/.gitlab-ci.d/load_deps.sh @@ -1,2 +1 @@ source $ROOTSYS/bin/thisroot.sh -source $G4INSTALL/bin/geant4.sh -- GitLab