Skip to content

CI: update which releases to test against #1242

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

Merged
merged 13 commits into from
Apr 18, 2024
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
4 changes: 3 additions & 1 deletion .github/workflows/clang-tidy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ jobs:
with:
release-platform: ${{ matrix.LCG }}
run: |
# clang-tidy does not work with the clang-wrapper, we setup the direct clang here
source /cvmfs/sft.cern.ch/lcg/contrib/clang/16/x86_64-el9/setup.sh
mkdir build
cd build
unset CPATH
Expand All @@ -34,7 +36,7 @@ jobs:
-DDD4HEP_USE_XERCESC=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_FLAGS="-fdiagnostics-color=always" \
-DCMAKE_CXX_STANDARD=17 ..
-DCMAKE_CXX_STANDARD=20 ..
echo "::group::Tidy"
cd ..
HEADER_FILES=$(find */include/* -name "*.h" | grep -v "/detail/\|/src/\|DDGear.h")
Expand Down
80 changes: 55 additions & 25 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,39 +9,62 @@ jobs:
strategy:
fail-fast: false
matrix:
LCG: ["LCG_100/x86_64-centos7-gcc10-opt", # g4 10.7
"LCG_101/x86_64-centos7-gcc11-opt", # g4 10.7
LCG: ["LCG_101/x86_64-centos7-gcc11-opt", # g4 10.7
"LCG_102/x86_64-centos9-gcc11-opt", # g4 11
"LCG_102/x86_64-centos7-clang12-opt", # g4 11
"LCG_102/x86_64-ubuntu2004-gcc9-opt", # g4 11
"dev3/x86_64-centos7-gcc11-opt",
"dev4/x86_64-centos7-gcc11-opt"]
"LCG_104/x86_64-el9-gcc13-opt", # g4 11
"LCG_105/x86_64-ubuntu2204-gcc11-opt", # g4 11
"dev3/x86_64-el9-gcc13-opt",
"dev3/x86_64-el9-clang16-opt", # g4 11
"dev4/x86_64-el9-gcc13-opt"]
steps:
- uses: actions/checkout@v4
- uses: cvmfs-contrib/github-action-cvmfs@v4
- uses: aidasoft/run-lcg-view@v3
with:
release-platform: ${{ matrix.LCG }}
run: |
if [[ ${{ matrix.LCG }} =~ clang16 ]]; then
source /cvmfs/sft.cern.ch/lcg/contrib/clang/16/x86_64-el9/setup-wrapper.sh
fi
mkdir build
cd build
unset CPATH
echo "::group::CMakeConfig"
cmake -GNinja \
-DDD4HEP_USE_GEANT4=ON \
-DBoost_NO_BOOST_CMAKE=ON \
-DDD4HEP_USE_LCIO=ON \
-DDD4HEP_USE_EDM4HEP=OFF \
-DDD4HEP_USE_TBB=ON \
-DDD4HEP_USE_HEPMC3=ON \
-DDD4HEP_BUILD_DEBUG=OFF \
-DBUILD_TESTING=ON \
-DDD4HEP_DEBUG_CMAKE=ON \
-DDD4HEP_USE_XERCESC=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_FLAGS="-fdiagnostics-color=always" \
-DCMAKE_CXX_STANDARD=17 ..
if [ "${{ matrix.LCG }}" = "dev3/x86_64-centos7-gcc11-opt" ]; then
if [[ ${{ matrix.LCG }} =~ gcc13|clang16 ]]; then
echo "::group::CMakeConfig C++20"
cmake -GNinja \
-DDD4HEP_USE_GEANT4=ON \
-DBoost_NO_BOOST_CMAKE=ON \
-DDD4HEP_USE_LCIO=ON \
-DDD4HEP_USE_EDM4HEP=OFF \
-DDD4HEP_USE_TBB=ON \
-DDD4HEP_USE_HEPMC3=ON \
-DDD4HEP_BUILD_DEBUG=OFF \
-DBUILD_TESTING=ON \
-DDD4HEP_DEBUG_CMAKE=ON \
-DDD4HEP_USE_XERCESC=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_FLAGS="-fdiagnostics-color=always" \
-DCMAKE_CXX_STANDARD=20 ..
else
echo "::group::CMakeConfig C++17"
cmake -GNinja \
-DDD4HEP_USE_GEANT4=ON \
-DBoost_NO_BOOST_CMAKE=ON \
-DDD4HEP_USE_LCIO=ON \
-DDD4HEP_USE_EDM4HEP=OFF \
-DDD4HEP_USE_TBB=ON \
-DDD4HEP_USE_HEPMC3=ON \
-DDD4HEP_BUILD_DEBUG=OFF \
-DBUILD_TESTING=ON \
-DDD4HEP_DEBUG_CMAKE=ON \
-DDD4HEP_USE_XERCESC=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_FLAGS="-fdiagnostics-color=always" \
-DCMAKE_CXX_STANDARD=17 ..
fi
if [[ ${{ matrix.LCG }} =~ dev3 ]]; then
echo "::group::CMakeConfig 2"
cmake -DDD4HEP_HEPMC3_COMPRESSION_SUPPORT=ON ..
fi
echo "::group::Compile"
Expand All @@ -53,10 +76,17 @@ jobs:
cd ../examples/
mkdir build
cd build
if [[ ${{ matrix.LCG }} =~ gcc13|clang16 ]]; then
cmake -GNinja \
-DBoost_NO_BOOST_CMAKE=ON \
-DDD4HEP_USE_XERCESC=ON \
-DCMAKE_CXX_STANDARD=20 ..
else
cmake -GNinja \
-DBoost_NO_BOOST_CMAKE=ON \
-DDD4HEP_USE_XERCESC=ON \
-DCMAKE_CXX_STANDARD=17 ..
fi
echo "::group::CompileExamples"
ninja install
echo "::group::TestExamples"
Expand Down Expand Up @@ -146,7 +176,7 @@ jobs:
strategy:
fail-fast: false
matrix:
LCG: ["LCG_102/x86_64-centos7-gcc11-opt"]
LCG: ["LCG_105/x86_64-centos7-gcc11-opt"]
steps:
- uses: actions/checkout@v4
- uses: cvmfs-contrib/github-action-cvmfs@v4
Expand Down Expand Up @@ -181,7 +211,7 @@ jobs:
strategy:
fail-fast: false
matrix:
LCG: ["dev3/x86_64-centos7-gcc11-opt"]
LCG: ["dev3/x86_64-el9-gcc13-opt"]
steps:
- uses: actions/checkout@v4
- uses: cvmfs-contrib/github-action-cvmfs@v4
Expand All @@ -207,7 +237,7 @@ jobs:
-DDD4HEP_USE_XERCESC=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_FLAGS="-fdiagnostics-color=always" \
-DCMAKE_CXX_STANDARD=17 ..
-DCMAKE_CXX_STANDARD=20 ..
echo "::group::Compile"
ninja install
. ../bin/thisdd4hep.sh
Expand All @@ -220,7 +250,7 @@ jobs:
cmake -GNinja \
-DBoost_NO_BOOST_CMAKE=ON \
-DDD4HEP_USE_XERCESC=ON \
-DCMAKE_CXX_STANDARD=17 ..
-DCMAKE_CXX_STANDARD=20 ..
echo "::group::CompileExamples"
ninja install
echo "::group::TestExamples"
Expand Down
2 changes: 2 additions & 0 deletions DDCore/python/dd4hep_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ def unicode_2_string(value):
value = value
elif isinstance(value, six.string_types):
value = str(value)
elif isinstance(value, bytes):
value = value.decode()
elif isinstance(value, (list, set, tuple)):
value = [unicode_2_string(x) for x in value]
elif isinstance(value, dict):
Expand Down
8 changes: 5 additions & 3 deletions DDDigi/include/DDDigi/DigiAction.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,20 @@ namespace dd4hep {
* \version 1.0
* \ingroup DD4HEP_DIGITIZATION
*/
class TypeName : public std::pair<std::string, std::string> {
class TypeName {
public:
std::string first;
std::string second;
/// Default constructor
TypeName() = default;
/// Copy constructor
TypeName(const TypeName& copy) = default;
/// Copy constructor from pair
TypeName(const std::pair<std::string, std::string>& c)
: std::pair<std::string, std::string>(c) { }
: first(c.first), second(c.second) { }
/// Initializing constructor
TypeName(const std::string& typ, const std::string& nam)
: std::pair<std::string, std::string>(typ, nam) { }
: first(typ), second(nam) { }
/// Assignment operator
TypeName& operator=(const TypeName& copy) = default;
/// Split string pair according to default delimiter ('/')
Expand Down
9 changes: 6 additions & 3 deletions DDDigi/python/dddigi.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#
# ==========================================================================
from __future__ import absolute_import, unicode_literals
import cppyy
from dd4hep_base import * # noqa: F401, F403

logger = None
Expand Down Expand Up @@ -105,9 +106,9 @@ def importConstants(description, namespace=None, debug=False):
strings = {}
for c in description.constants():
if c.second.dataType == 'string':
strings[c.first] = c.second.GetTitle()
strings[str(c.first)] = c.second.GetTitle()
else:
todo[c.first] = c.second.GetTitle().replace('(int)', '')
todo[str(c.first)] = c.second.GetTitle().replace('(int)', '')
while len(todo) and cnt < 100:
cnt = cnt + 1
if cnt == 100:
Expand All @@ -121,7 +122,7 @@ def importConstants(description, namespace=None, debug=False):
logger.info('+++ FAILED to import: "' + k + '" = "' + str(v) + '"')
logger.info('+++ %s' % (100 * '=',))

for k, v in todo.items():
for k, v in list(todo.items()):
if not hasattr(ns, k):
val = evaluator.evaluate(v)
status = evaluator.status()
Expand Down Expand Up @@ -276,6 +277,8 @@ def _set(self, name, value):
import dd4hep as dd4hep
act = _get_action(self)
nam = dd4hep.unicode_2_string(name)
if isinstance(value, (list,)): # cppyy.gbl.string showing up for some reason
value = [x.decode('utf-8') if isinstance(x, cppyy.gbl.std.string) else x for x in value]
if isinstance(value, str):
val = dd4hep.unicode_2_string(value)
else:
Expand Down
8 changes: 5 additions & 3 deletions DDG4/include/DDG4/Geant4Action.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,18 +79,20 @@ namespace dd4hep {
* \version 1.0
* \ingroup DD4HEP_SIMULATION
*/
class TypeName : public std::pair<std::string, std::string> {
class TypeName {
public:
std::string first;
std::string second;
/// Default constructor
TypeName() = default;
/// Copy constructor
TypeName(const TypeName& copy) = default;
/// Copy constructor from pair
TypeName(const std::pair<std::string, std::string>& c)
: std::pair<std::string, std::string>(c) { }
: first(c.first), second(c.second) { }
/// Initializing constructor
TypeName(const std::string& typ, const std::string& nam)
: std::pair<std::string, std::string>(typ, nam) { }
: first(typ), second(nam) { }
/// Assignment operator
TypeName& operator=(const TypeName& copy) = default;
/// Split string pair according to default delimiter ('/')
Expand Down
9 changes: 6 additions & 3 deletions DDG4/python/DDG4.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# ==========================================================================
from __future__ import absolute_import, unicode_literals
import logging
import cppyy
from dd4hep_base import * # noqa: F403
import ddsix as six

Expand Down Expand Up @@ -93,9 +94,9 @@ def importConstants(description, namespace=None, debug=False):
strings = {}
for c in description.constants():
if c.second.dataType == 'string':
strings[c.first] = c.second.GetTitle()
strings[str(c.first)] = c.second.GetTitle()
else:
todo[c.first] = c.second.GetTitle().replace('(int)', '')
todo[str(c.first)] = c.second.GetTitle().replace('(int)', '')
while len(todo) and cnt < 100:
cnt = cnt + 1
if cnt == 100:
Expand Down Expand Up @@ -134,9 +135,11 @@ def _registerGlobalFilter(self, filter): # noqa: A002
def _evalProperty(data):
"""
Function necessary to extract real strings from the property value.
Strings may be embraced by quotes: '<value>'
Strings may be embraced by quotes: '<value>', or could be cppyy.gbl.std.string with extra "b''"
"""
try:
if isinstance(data, (cppyy.gbl.std.string, )):
return _evalProperty(data.decode('utf-8'))
if isinstance(data, str):
import ast
return ast.literal_eval(data)
Expand Down
2 changes: 1 addition & 1 deletion DDG4/python/DDSim/Helper/ParticleHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def setupUserParticleHandler(self, part, kernel, DDG4):
except AttributeError as e:
logger.debug("Attribute tracker_region_zmin for asymmetric tracker region missing %s", e)
logger.debug(" will use symmetric region defined by tracker_region_zmax")
user.TrackingVolume_Zmin = str(-float(user.TrackingVolume_Zmax))
user.TrackingVolume_Zmin = str(-float(DDG4.tracker_region_zmax))

logger.info(" *** definition of tracker region *** ")
logger.info(" tracker_region_zmin = %s", user.TrackingVolume_Zmin)
Expand Down
Loading