diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 321ce44f8e53fe9fd16f88cdddd38769986711c4..03aa53412ab3471d8a99e32caa988a81d5c97dec 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -14,115 +14,68 @@ stages: - package - deploy -docker: +al9-docker: stage: docker extends: .docker-builder rules: - if: $CI_PIPELINE_SOURCE == "schedule" - - changes: [ "Dockerfile-builder" ] + - changes: [ "Dockerfile-builder.al9" ] - when: manual allow_failure: true variables: - IMAGE: "$CI_REGISTRY_IMAGE/builder" - DOCKERFILE: "Dockerfile-builder" + IMAGE: "$CI_REGISTRY_IMAGE/builder:al9" + DOCKERFILE: "Dockerfile-builder.al9" -test: - stage: test +al9-test: + image: "$CI_REGISTRY_IMAGE/builder:al9" extends: .cxx-test - rules: - - allow_failure: false - before_script: - - source /opt/rh/devtoolset-7/enable - - g++ --version | grep -q '(GCC) 7' - image: "$CI_REGISTRY_IMAGE/builder" -nodriver: # Compile without any backend +al9-nodriver: # Compile without any backend stage: test - image: "$CI_REGISTRY_IMAGE/builder" + image: "$CI_REGISTRY_IMAGE/builder:al9" rules: - allow_failure: false script: - - source /opt/rh/devtoolset-7/enable - - g++ --version | grep -q '(GCC) 7' - - yum remove -y libadq0 - # Build - mkdir build && cd build - cmake3 .. -DSPDEVICES=OFF - make -j4 -sse2: # Compile with SSE enabled +al9-sse2: # Compile with SSE enabled stage: test - image: "$CI_REGISTRY_IMAGE/builder" + image: "$CI_REGISTRY_IMAGE/builder:al9" rules: - allow_failure: false script: - - source /opt/rh/devtoolset-7/enable - - g++ --version | grep -q '(GCC) 7' - # Build - mkdir build && cd build - cmake3 .. -DSSE=ON -DOPTIMIZE=ON - make -j4 -package: +al9-package: + image: gitlab-registry.cern.ch/linuxsupport/alma9-base stage: package - # Package from the basic reference image - rules: - - if: $CI_COMMIT_TAG =~ /^v(\d+)(\.\d+){2}\s*$/ - image: cern/cc7-base - script: - # Install deps - - yum install -y cmake3 make gcc-c++ git - - yum install -y freeipmi-devel numactl-devel readline-devel libblkid-devel pugixml-devel - - # Add ntof specific repo - - yum-config-manager --add-repo http://ntofci.web.cern.ch/ntofci/distfiles/ntof/cc7/nToF.repo - - yum install -y libadq0 ntof-boost - - yum install -y rpm-build - - # Install latest compiler and use it - - yum install -y centos-release-scl - - yum install -y devtoolset-7-gcc* - - source /opt/rh/devtoolset-7/enable - - g++ --version | grep -q '(GCC) 7' - - # Won't package on a shallow clone - - '[ ! -e .git/shallow ] || git fetch --unshallow' - - # rpm-build debuginfo workarround, srcdir must be longer than debuginfo path - - git clone . "rpmbuild_usr_src_debug_${PKGNAME}_${CI_COMMIT_TAG}_runtime_src" - - cd "rpmbuild_usr_src_debug_${PKGNAME}_${CI_COMMIT_TAG}_runtime_src" - - # Build - - mkdir build && cd build - - cmake3 .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -DOPTIMIZE=ON - - make -j4 - - make rpm-package - - - FILE=$(echo ${CI_COMMIT_TAG}-Linux.rpm| sed 's/^v/daqmanager-/') - - '[ -e "$FILE" ] || { echo "Tag mismatches CMakeLists.txt version"; exit 1; }' - - - echo "${CI_JOB_URL}/artifacts/download" > artifact_url.txt - - cd .. && mv build .. - artifacts: - paths: - - build/*.rpm - - build/artifact_url.txt + extends: .cxx-package-rpm + variables: + DEPENDENCIES: 'boost-devel freeipmi-devel numactl-devel readline-devel libblkid-devel pugixml-devel libadq0' + REPOSITORIES: http://ntofci.web.cern.ch/ntofci/distfiles/ntof/al9/nToF.repo + PKGNAME: 'daqmanager' + before_script: + - dnf install -y epel-release yum-utils # Deploy rpm package -ci-rpm: +al9-ci-rpm: extends: .ci-rpm rules: - if: $CI_COMMIT_TAG =~ /^v(\d+)(\.\d+){2}\s*$/ - dependencies: [ package ] + dependencies: [ al9-package ] variables: job: ntof/daq/distfiles # Deploy the pages generated to DFS -ci-artifacts: +al9-ci-artifacts: extends: .ci-artifacts rules: - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH - dependencies: [ test ] + dependencies: [ al9-test ] diff --git a/CMakeLists.txt b/CMakeLists.txt index 42b7d6fd8439053395c08ce272213ae24bf945ee..905061316ca281d41b716ed62bd0952832f6d7c7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,11 +25,11 @@ include(Lint) include(GitVersion) set(VERSION_MAJOR "7") set(VERSION_MINOR "1") -set(VERSION_PATCH "11") +set(VERSION_PATCH "12") include(Pack) -use_cxx(11) +use_cxx(14) if(CHARACTERIZATION) add_definitions(-DCHARACTERIZATION) @@ -51,6 +51,13 @@ if(NOT MSVC) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wnon-virtual-dtor -Woverloaded-virtual -Wunused-parameter -Wuninitialized") endif(NOT MSVC) +if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 11.3) + message("Using BOOST_LOG_DYN_LINK") + ADD_DEFINITIONS(-DBOOST_LOG_DYN_LINK) +endif() + +#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DBOOST_LOG_DYN_LINK") + if(NOT DEFINED BUILD_SHARED_LIBS) set(BUILD_SHARED_LIBS ON) endif() diff --git a/Dockerfile-builder b/Dockerfile-builder deleted file mode 100644 index 5225a047d586a03d9c8c44dffc6f100fe743f230..0000000000000000000000000000000000000000 --- a/Dockerfile-builder +++ /dev/null @@ -1,22 +0,0 @@ -FROM cern/cc7-base - -RUN yum install -y cmake3 make gcc-c++ git \ - freeipmi-devel numactl-devel readline-devel libblkid-devel pugixml-devel \ - clang-analyzer cppcheck cppunit-devel lcov && yum clean all && \ - git config --global user.email 'docker@builder' && \ - git config --global user.name 'docker' - -RUN yum-config-manager --add-repo http://ntofci.web.cern.ch/ntofci/distfiles/cc7/nToF-Common.repo && \ - yum install -y cquery && yum clean all - -RUN yum-config-manager --add-repo http://ntofci.web.cern.ch/ntofci/distfiles/ntof/cc7/nToF.repo && \ - yum install -y libadq0 ntof-boost && yum clean all - -RUN yum install -y centos-release-scl && \ - yum install -y devtoolset-7-gcc* && \ - (source /opt/rh/devtoolset-7/enable && (g++ --version | grep -q '(GCC) 7')) && \ - yum clean all - -# CI uses sh, and won't load profile unless provided in "ENV" -ENV ENV=/etc/profile -RUN echo ". /opt/rh/devtoolset-7/enable" > /etc/profile.d/ntof.sh diff --git a/Dockerfile-builder.al9 b/Dockerfile-builder.al9 new file mode 100644 index 0000000000000000000000000000000000000000..8be8b4942de5ebdf7b79a324161250f8ab19d1c9 --- /dev/null +++ b/Dockerfile-builder.al9 @@ -0,0 +1,6 @@ +FROM gitlab-registry.cern.ch/ntof/daq/builder:al9 + +RUN dnf install -y numactl-devel readline-devel libblkid-devel yum-utils && dnf clean all + +RUN yum-config-manager --add-repo http://ntofci.web.cern.ch/ntofci/distfiles/ntof/al9/nToF.repo && \ + yum install -y libadq0 && yum clean all diff --git a/cmake/Lint.cmake b/cmake/Lint.cmake index 2f2cb0bf2573b4dc574984afbcb4c677f66a871a..ce66669a64ff8dd9cfc317f64fc56411d3fd5a42 100644 --- a/cmake/Lint.cmake +++ b/cmake/Lint.cmake @@ -36,7 +36,7 @@ else(CLANG_FORMAT_EXE) endif(CLANG_FORMAT_EXE) # Clang configuration -find_program(CLANGPP_EXE NAMES clang++ +find_program(CLANGPP_EXE NAMES clang++ clang-tidy PATHS ${CLANGPP_EXE} ENV PATH $ENV{CLANGPP_PATH} CMAKE_FIND_ROOT_PATH_BOTH) if(CLANGPP_EXE) diff --git a/cmake/Pack.cmake b/cmake/Pack.cmake index 0429b8c574c8f2c8e60f51174e27b221724b0145..9ac57d05adcecf1afc63d0087219b013331a6385 100644 --- a/cmake/Pack.cmake +++ b/cmake/Pack.cmake @@ -9,6 +9,8 @@ set(CPACK_PACKAGE_VERSION_MINOR "${VERSION_MINOR}") set(CPACK_PACKAGE_VERSION_PATCH "${VERSION_PATCH}") set(CPACK_PACKAGE_CONTACT "Paul Peronnard ") +set(CPACK_RPM_PACKAGE_RELEASE_DIST ON) +set(CPACK_RPM_FILE_NAME "RPM-DEFAULT") # Generate debug package set(CPACK_RPM_DEBUGINFO_PACKAGE ON) diff --git a/include/CSystemInfo.h b/include/CSystemInfo.h index b51607103b7431883eb5fca46e02d9962032e96c..507b3b69137a0fbb1d305049a8b3fcea6279a822 100644 --- a/include/CSystemInfo.h +++ b/include/CSystemInfo.h @@ -17,7 +17,7 @@ #include "sys/sysinfo.h" #include "sys/times.h" #include "sys/types.h" -#include "sys/vtimes.h" +//#include "sys/vtimes.h" class CSystemInfo { diff --git a/src/spd/CCardSpd.cpp b/src/spd/CCardSpd.cpp index 2855e13d70dbe1cecbf1efe07fb9e79ee43f759c..79457cac54339abeb3b217b7eccf48e0003dfd7a 100644 --- a/src/spd/CCardSpd.cpp +++ b/src/spd/CCardSpd.cpp @@ -173,7 +173,7 @@ void CCardSpd::FindDevices() adqNumber_ = i + 1; LOG_INFO << "serial number: " + std::string(ADQ_GetBoardSerialNumber(driverInstance_, adqNumber_)); - int *fw_rev = ADQ_GetRevision(driverInstance_, adqNumber_); + uint32_t *fw_rev = ADQ_GetRevision(driverInstance_, adqNumber_); LOG_INFO << "Firmware revision: " + boost::lexical_cast(fw_rev[0]); LOG_INFO << "link rate: " << GetPCIeLinkRate()