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

Edwin millepede #16

Closed
wants to merge 1 commit into from
Closed
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
3 changes: 3 additions & 0 deletions .github/actions/pre-build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ runs:
run: |
apt-get update
apt-get install --fix-missing -y ccache sudo
<<<<<<< HEAD
conda install -y conda-forge::ninja
=======
>>>>>>> d4adb981 (Find ROOT using config mode and cmake targets)
wget https://cernbox.cern.ch/remote.php/dav/public-files/RmnTeeOZpYjCJQb/masterkey.gsi.de.pub
mv masterkey.gsi.de.pub /etc/cvmfs/keys
cp .githubfiles/fairsoft.gsi.de.conf /etc/cvmfs/config.d
Expand Down
7 changes: 6 additions & 1 deletion .github/actions/r3bbuild-steps/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,16 @@ runs:
echo ""
echo "path environment variable: $PATH\n"
echo ""
<<<<<<< HEAD
cmake --preset ${{ matrix.preset }} . -C "$GITHUB_WORKSPACE/cmake/CI_CD/configure_options.cmake"
=======
./build.py -p -c --cmake-extra-args="-DBUILD_GEOMETRY=OFF;-C $GITHUB_WORKSPACE/cmake/CI_CD/configure_options.cmake"
>>>>>>> 3a7c47f7 (Conan package manager, build.py and Neuland calibration rewrite)
shell: bash

- name: build ${{ matrix.repos }}
if: inputs.build-needed == 'true'
run: |
cmake --build ./build -- -j ${NUM_THREADS}
./build.py -b -j ${NUM_THREADS}
# ./build_thisr3broot.sh -b build -j ${NUM_THREADS}
shell: bash
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ jobs:
# the speed of the run.
NUM_THREADS: 2
# Options for the Docker container to be run with cvmfs.
options: --user root --privileged --ulimit nofile=10000:10000 --cap-add SYS_ADMIN --device /dev/fuse
options: --user root --privileged --ulimit nofile=10000:10000 -it --cap-add SYS_ADMIN --device /dev/fuse

# Each job contains different steps that are executed sequentially. Each
# step could be multiple shell commands or a composite action either from
Expand Down
31 changes: 28 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ if(NOT DEFINED ENV{SIMPATH})
)
endif(NOT DEFINED ENV{SIMPATH})

# fairsoft lib path needed to be added for root dictionary detection:
set(LD_LIBRARY_PATH ${SIMPATH}/lib ${LD_LIBRARY_PATH})
set(GRAPHVIZ_EXTERNAL_LIBS FALSE)

if(NOT DEFINED ENV{FAIRROOTPATH})
message(
FATAL_ERROR
Expand Down Expand Up @@ -81,6 +85,7 @@ set(CheckSrcDir "${FAIRROOTPATH}/share/fairbase/cmake/checks")
# Set option(s)
option(BUILD_GEOMETRY "Build all ROOT geometries" ON)
option(USE_PATH_INFO "Information from PATH and LD_LIBRARY_PATH are used." OFF)
option(USE_LD_LIBRARY_PATH_INFO "Information from PATH and LD_LIBRARY_PATH are used." ON)
option(WITH_UCESB "Build UCESB" OFF)
option(WITH_EPICS "Build EPICS" OFF)
option(WITH_ACTAR "Build ACTAR" OFF)
Expand Down Expand Up @@ -116,9 +121,6 @@ else()
message(STATUS "You seem to be using FairRoot ${FairRoot_VERSION}.")
endif()

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

# Load some basic macros which are needed later on
include(FairMacros)

Expand Down Expand Up @@ -401,6 +403,7 @@ set(R3BROOT_MAJOR_VERSION 0)
set(R3BROOT_MINOR_VERSION 0)
set(R3BROOT_PATCH_VERSION 0)
set(R3BROOT_VERSION "${FairRoot_VERSION}")
set(R3BROOTPATH ${CMAKE_BINARY_DIR})

if(NOT DEFINED ROOT_FOUND_VERSION)
set(ROOT_FOUND_VERSION "${found_vers}")
Expand Down Expand Up @@ -529,6 +532,15 @@ set(ROOT_CINT_EXECUTABLE ${ROOT_rootcling_CMD})
include(CTest)
include(RootCTest)

find_program(
ROOT_CINT_EXECUTABLE
NAMES rootcint
PATHS ${ROOT_BINDIR}
NO_DEFAULT_PATH)

include(CTest)
include(RootCTest)

if(MODULE)
add_subdirectory(${MODULE})
endif(MODULE)
Expand Down Expand Up @@ -591,6 +603,19 @@ if(NOT MODULE)
if(WITH_SOFIA)
add_subdirectory(sofia)
endif(WITH_SOFIA)

#================================================================================
# TODO: Since other dependencies still use the old cmake configurations, include(ROOTMacros) has to be used. Please change them using CMake targets ASAP.
include(ROOTMacros)
if(WITH_EPICS)
add_subdirectory(epics)
endif(WITH_EPICS)
if(Atima_FOUND)
add_subdirectory(atima)
endif(Atima_FOUND)
if(WITH_ACTAR)
add_subdirectory(actar)
endif(WITH_ACTAR)
if(WITH_GTPC)
add_subdirectory(glad-tpc)
endif(WITH_GTPC)
Expand Down
1 change: 0 additions & 1 deletion CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
"cacheVariables": {
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
"BUILD_GEOMETRY": "OFF",
"USE_DIFFERENT_COMPILER": "ON",
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
"CMAKE_PROJECT_TOP_LEVEL_INCLUDES": "util/cmake-conan/conan_provider.cmake",
"CONAN_ENABLED": "ON"
Expand Down
4 changes: 2 additions & 2 deletions atima/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#set(GTEST_ROOT ${SIMPATH})
#find_package(GTest)

#if(GTEST_FOUND)
#if(GTest_FOUND)
#file(GLOB TEST_SRC_FILES ${PROJECT_SOURCE_DIR}/atima/test/*.cxx)

#include_directories(${GTEST_INCLUDE_DIRS}
Expand All @@ -39,4 +39,4 @@
#add_executable(${PROJECT_TEST_NAME} ${TEST_SRC_FILES})
#target_link_libraries(${PROJECT_TEST_NAME} ${TEST_DEPENDENCIES})
#add_test(${PROJECT_TEST_NAME} ${EXECUTABLE_OUTPUT_PATH}/${PROJECT_TEST_NAME})
#endif(GTEST_FOUND)
#endif()
133 changes: 133 additions & 0 deletions build.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
#! /usr/bin/env python3
import argparse
import os
import subprocess
import sys

# import sys


class Build:
def __init__(self):
self.source_dir = os.path.dirname(os.path.abspath(sys.argv[0]))
self.define_options()
self.args = self.parser.parse_args()

def launch(self):
if not os.path.isdir(self.args.build_dir):
os.mkdir(self.args.build_dir)
self.install_conan_packages()
self.cmake_configure()
self.build_source()

def define_options(self):
self.parser = argparse.ArgumentParser(
prog="R3BRoot builder",
description="Building R3BRoot source files with conan package manager",
epilog="If any issue occurs, please report it to the R3BRoot github webpage.",
)
self.parser.add_argument(
"-j",
type=int,
nargs="?",
default=1,
const=1,
dest="build_thread",
help="number of threads for the building (default: 1)",
)
self.parser.add_argument(
"--fresh",
dest="is_fresh_configure",
action="store_true",
help="fresh build for cmake",
)
self.parser.add_argument(
"-a",
"--all",
dest="is_all",
action="store_true",
help="run all processes specified with -p, -c, -b",
)
self.parser.add_argument(
"-p",
"--only-packages",
dest="is_only_package",
action="store_true",
help="only install all conan packages",
)
self.parser.add_argument(
"-c",
"--only-configure",
dest="is_only_configure",
action="store_true",
help="only run the cmake configuration",
)
self.parser.add_argument(
"-b",
"--only-build",
dest="is_only_build",
action="store_true",
help="only build the source files",
)
self.parser.add_argument(
"--build-dir",
default=f"{self.source_dir}/build",
help='specify the build folder (default: "./build")',
)
self.parser.add_argument(
"--build-type",
default="RelWithDebInfo",
help='specify the build type for cmake (default: "RelWithDebInfo")',
)
self.parser.add_argument(
"--cmake-extra-args",
default="-DBUILD_GEOMETRY=OFF",
dest="cmake_args",
help='extra colon separated arguments for cmake configurations (default: "-DBUILD_GEOMETRY=OFF")',
)
self.parser.add_argument(
"--conan-dir",
default="conan-packages",
help='specify the folder name for conan packages (default: "conan-packages")',
)

def install_conan_packages(self):
if self.args.is_only_package or self.args.is_all:
subprocess.run(["conan", "profile", "detect", "--force"], check=True)
subprocess.run(
[
"conan",
"install",
self.source_dir,
f"--output-folder={self.args.build_dir}/{self.args.conan_dir}",
"--build=missing",
f"--settings=build_type={self.args.build_type}",
],
check=True,
) # nosec

def cmake_configure(self):
if self.args.is_only_configure or self.args.is_all:
cmake_args = ["--fresh"] if self.args.is_fresh_configure else []
cmake_args.append(f"-S {self.source_dir}")
cmake_args.append(f"-B {self.args.build_dir}")
cmake_args.append("-DUSE_DIFFERENT_COMPILER=TRUE")
cmake_args.append(
f"-DCMAKE_TOOLCHAIN_FILE={self.args.build_dir}/{self.args.conan_dir}/conan_toolchain.cmake"
)
cmake_args.append(f"-DCMAKE_BUILD_TYPE={self.args.build_type}")
extra_args = self.args.cmake_args.split(";")
cmake_args.extend(extra_args)
print(f"build.py: cmake {cmake_args}")
subprocess.run(["cmake"] + cmake_args, check=True) # nosec

def build_source(self):
if self.args.is_only_build or self.args.is_all:
subprocess.run(
["cmake", "--build", self.args.build_dir, "--", "-j", str(self.args.build_thread)], check=True
) # nosec


if __name__ == "__main__":
builder = Build()
builder.launch()
10 changes: 10 additions & 0 deletions conanfile.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[requires]
ms-gsl/4.0.0
range-v3/0.12.0
gtest/cci.20210126
nlohmann_json/3.11.2
eigen/3.4.0

[generators]
CMakeDeps
CMakeToolchain
47 changes: 47 additions & 0 deletions neuland/.cmake-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# See https://github.com/cheshirekow/cmake_format

with section("format"):
# How wide to allow formatted cmake files
line_width = 100

# How many spaces to tab for indent
tab_size = 4

# If true, separate flow control names from their parentheses with a space
separate_ctrl_name_with_space = False

# If true, separate function names from parentheses with a space
separate_fn_name_with_space = False

# If a statement is wrapped to more than one line, than dangle the closing
# parenthesis on it's own line
dangle_parens = False

# What character to use for bulleted lists
bullet_char = u'*'

# What character to use as punctuation after numerals in an enumerated list
enum_char = u'.'

# What style line endings to use in the output.
line_ending = u'unix'

# Format command names consistently as 'lower' or 'upper' case
command_case = u'lower'

# Format keywords consistently as 'lower' or 'upper' case
keyword_case = u'unchanged'

# A list of command names which should always be wrapped
always_wrap = []

# Don't reformat comments
enable_markup = False

# If true, the argument lists which are known to be sortable will be sorted
# lexicographicall
enable_sort = True

autosort = True

max_pargs_hwrap = 3
3 changes: 2 additions & 1 deletion neuland/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# cmake-format: off
##############################################################################
# Copyright (C) 2019 GSI Helmholtzzentrum für Schwerionenforschung GmbH #
# Copyright (C) 2019-2024 Members of R3B Collaboration #
Expand All @@ -23,7 +24,7 @@ add_subdirectory(shared)
add_subdirectory(simulation)
add_subdirectory(test)
add_subdirectory(unpack)
add_subdirectory(executables)
if(BUILD_GEOMETRY)
add_subdirectory(geobase)
endif()
add_subdirectory(executables)
Loading
Loading