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

Millepede integration #24

Merged
merged 1 commit into from
Feb 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/actions/ctest-cdash/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ runs:
- name: running ctest
run: |
source $GITHUB_WORKSPACE/util/generate_geo_test.sh
export PEDEDIR="~"
ctest -S cmake/CI_CD/CDash.cmake -DBUILD_J=${NUM_THREADS}\
-DTEST_MODEL=${TEST_MODEL}\
-DTEST_NAME=${{ env.TEST_NAME }}\
Expand Down
4 changes: 0 additions & 4 deletions .github/actions/r3bbuild-steps/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ runs:
git submodule update --init --recursive
git clone https://github.com/R3BRootGroup/macros.git
conan remote update conancenter --url="https://center2.conan.io"
echo ""
echo "path environment variable: $PATH\n"
echo ""
export PEDEDIR="~"
cmake --preset ${{ matrix.preset }} . -C "$GITHUB_WORKSPACE/cmake/CI_CD/configure_options.cmake"
shell: bash

Expand Down
116 changes: 58 additions & 58 deletions .github/workflows/static_analysis.yml
Original file line number Diff line number Diff line change
@@ -1,66 +1,66 @@
#
# SPDX-License-Identifier: LGPL-3.0-or-later
# #
# # SPDX-License-Identifier: LGPL-3.0-or-later

name: static analysis
on:
push:
branches: [dev, edwin_dev]
pull_request:
branches: [dev, edwin_dev]
# name: static analysis
# on:
# push:
# branches: [dev, edwin_dev]
# pull_request:
# branches: [dev, edwin_dev]

workflow_dispatch:
# workflow_dispatch:

permissions:
pull-requests: write
contents: write
# permissions:
# pull-requests: write
# contents: write

jobs:
clang-lint:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
strategy:
matrix:
preset: [default]
os: [ubuntu-latest]
container:
image: yanzhaowang/fairroot:${{ matrix.os }}
options: --user root --privileged
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
# jobs:
# clang-lint:
# runs-on: ubuntu-latest
# defaults:
# run:
# shell: bash
# strategy:
# matrix:
# preset: [default]
# os: [ubuntu-latest]
# container:
# image: yanzhaowang/fairroot:${{ matrix.os }}
# options: --user root --privileged
# steps:
# - uses: actions/checkout@v4
# with:
# submodules: 'true'

- name: install sudo
run: |
apt-get install -y sudo
sudo -H python3 -m pip install conan
# - name: install sudo
# run: |
# apt-get install -y sudo
# sudo -H python3 -m pip install conan

- name: configure r3broot
uses: './.github/actions/r3bbuild-steps'
with:
build-needed: 'false'
# - name: configure r3broot
# uses: './.github/actions/r3bbuild-steps'
# with:
# build-needed: 'false'

- name: Run clang-format style check for C/C++/Protobuf programs.
uses: cpp-linter/cpp-linter-action@v2
id: linter
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
style: 'file'
tidy-checks: ''
version: 18
lines-changed-only: true
database: build
thread-comments: update
tidy-review: true
file-annotations: true
format-review: true
passive-reviews: true
extensions: 'h,cxx'
ignore: '*|!neuland|!r3bbase|!r3bdata|!r3bsource|ext_h101*'
# - name: Run clang-format style check for C/C++/Protobuf programs.
# uses: cpp-linter/cpp-linter-action@v2
# id: linter
# env:
# GITHUB_TOKEN: ${{ secrets.CPPLINTER_TOKEN }}
# with:
# style: 'file'
# tidy-checks: ''
# version: 18
# lines-changed-only: true
# database: '${{ github.workspace }}/build'
# thread-comments: update
# tidy-review: true
# file-annotations: true
# format-review: true
# passive-reviews: true
# extensions: 'h,cxx'
# ignore: '*|!neuland|!r3bbase|!r3bdata|!r3bsource|ext_h101*'

- name: Fail fast?!
if: steps.linter.outputs.checks-failed > 0
run: exit 1
# - name: Fail fast?!
# if: steps.linter.outputs.checks-failed > 0
# run: exit 1
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
path = util/cmake-conan
url = https://github.com/conan-io/cmake-conan.git
branch = develop2
[submodule "util/millepede2"]
path = util/millepede2
url = https://github.com/YanzhaoW/Millepede-II.git
18 changes: 14 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ option(WITH_SOFIA "Build SOFIA" OFF)
option(WITH_GTPC "Build GTPC" OFF)
option(WITH_FRS "Build FRS" OFF)
option(WITH_ASYEOS "Build ASYEOS" OFF)
option(WITH_MILLEPEDE "Build millepede" OFF)
option(BUILD_C3W "Build C3W" OFF)
option(CONAN_ENABLED "conan package is enabled. (Use CMakePreset to set it)" OFF)
option(FETCH_GTEST "Fetch GTest from CMake" OFF)
Expand Down Expand Up @@ -308,7 +309,7 @@ endif()

include(${CMAKE_SOURCE_DIR}/cmake/modules/FetchAllContents.cmake)

find_package2(PRIVATE GTest)
find_package(GTest)
find_package2(PUBLIC Pythia6)
find_package2(PUBLIC Pythia8)
find_package2(PUBLIC Protobuf)
Expand Down Expand Up @@ -355,6 +356,7 @@ set(CMAKE_CXX_FLAGS "-D_GLIBCXX_ASSERTIONS ${CMAKE_CXX_FLAGS}")
set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # used by clang-tidy

set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
set(R3B_PYTHON_LIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/r3b")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
set(VMCWORKDIR ${CMAKE_SOURCE_DIR})

Expand Down Expand Up @@ -439,9 +441,6 @@ set(R3BROOT_PATCH_VERSION 0)
set(R3BROOT_VERSION "${FairRoot_VERSION}")
set(R3BROOTPATH ${CMAKE_BINARY_DIR})

# added a variable to point to r3broot path in the system
set(R3BROOTPATH ${CMAKE_INSTALL_PREFIX})

if(NOT DEFINED ROOT_FOUND_VERSION)
set(ROOT_FOUND_VERSION "${found_vers}")
endif()
Expand Down Expand Up @@ -642,6 +641,17 @@ if(NOT MODULE)
if(WITH_ASYEOS)
add_subdirectory(asyeos)
endif(WITH_ASYEOS)
if(WITH_MILLEPEDE)
if(EXISTS "${CMAKE_SOURCE_DIR}/util/millepede2/CMakeLists.txt")
add_subdirectory(util/millepede2)
else()
message(
FATAL_ERROR
"WITH_MILLEPEDE is enabled but util/millepede2/CMakeLists.txt doens't exist!\n"
"If you forgot to init the git submodule, please do:\n"
"\tgit submodule update --init")
endif()
endif()

#================================================================================
# TODO: Since other dependencies still use the old cmake configurations, include(ROOTMacros) has to be used. Please change them using CMake targets ASAP.
Expand Down
1 change: 1 addition & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"BUILD_GEOMETRY": "OFF",
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
"CMAKE_PROJECT_TOP_LEVEL_INCLUDES": "util/cmake-conan/conan_provider.cmake",
"WITH_MILLEPEDE": "ON",
"CONAN_ENABLED": "ON",
"CONAN_INSTALL_ARGS": "--build=missing;--settings:build=compiler.cppstd=gnu17"
}
Expand Down
2 changes: 1 addition & 1 deletion cmake/modules/WriteConfigFile_r3b.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ macro(WRITE_CONFIG_FILE filename)

set(PYTHONPATH
${CMAKE_SOURCE_DIR}/python
${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
${R3B_PYTHON_LIB}
${SIMPATH}/lib
${SIMPATH}/lib/root
${SIMPATH}/lib/Geant4
Expand Down
Loading