Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cbmroot
Manage
Activity
Members
Labels
Plan
Wiki
Redmine
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Computing
cbmroot
Commits
2615d550
Commit
2615d550
authored
1 month ago
by
Pierre-Alain Loizeau
Committed by
Florian Uhlig
3 weeks ago
Browse files
Options
Downloads
Patches
Plain Diff
[CI] Add parsing of library to lib loading test (using f1st class in lib from rootmap)
parent
29b3b2a8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!2064
Add check of installed libraries
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
scripts/checklibs.sh
+22
-5
22 additions, 5 deletions
scripts/checklibs.sh
scripts/loadlib.C
+14
-3
14 additions, 3 deletions
scripts/loadlib.C
with
36 additions
and
8 deletions
scripts/checklibs.sh
+
22
−
5
View file @
2615d550
...
...
@@ -15,16 +15,33 @@ LIBDIR=${2:-../lib}
# libraries are real files with the extensions .so and for macosx .dylib
all_libs
=
$(
find
$LIBDIR
-type
f
-o
-type
l |
grep
-e
\.
dylib
$
-e
\.
so
$)
# Token used to find the first line with a class definition in the .rootmap files
start_token_class
=
"class "
tmpfile
=
$(
mktemp
)
ok
=
true
ok
ay
=
true
for
lib
in
$all_libs
;
do
echo
"Loading the library
$lib
"
root
-l
-q
-b
$SCRIPTDIR
/loadlib.C
\(\"
$lib
\"\)
&>
$tmpfile
first_class
=
""
rootmap_file
=
"
${
lib
%%
".so"
}
"
.rootmap
if
[
-f
"
${
rootmap_file
}
"
]
;
then
rootmap_defs_token
=
"
\[
lib"
if
[[
${
rootmap_file
}
==
*
"libHal"
*
]]
;
then
# Commented out for now as lead to missing headers detection in 60% of HAL libraries (9/14)
# rootmap_defs_token="\[ Hal"
fi
first_class
=
$(
awk
-v
token
=
"
${
rootmap_defs_token
}
"
'$0 ~ token ,0'
${
rootmap_file
}
|
grep
-m1
"
${
start_token_class
}
"
|
tr
-d
';'
)
first_class
=
"
${
first_class
##
"
${
start_token_class
}
"
}
"
fi
# echo "Loading the library ${lib} and parsing it for class ${first_class}"
root
-l
-q
-b
"
${
SCRIPTDIR
}
/loadlib.C(
\"
${
lib
}
\"
,
\"
${
first_class
}
\"
)"
&>
${
tmpfile
}
retval
=
$?
if
[[
retval
-ne
0
]]
;
then
echo
""
echo
"Problem loading the library
$lib
"
echo
"Problem loading
or parsing
the library
$lib
:
${
retval
}
"
cat
$tmpfile
echo
""
okay
=
false
...
...
@@ -35,7 +52,7 @@ rm $tmpfile
if
[[
"
$okay
"
=
"false"
]]
;
then
echo
""
echo
"Not all libraries could be loaded"
echo
"Not all libraries could be loaded
and parsed
"
echo
"Test failed"
exit
1
else
...
...
This diff is collapsed.
Click to expand it.
scripts/loadlib.C
+
14
−
3
View file @
2615d550
/* Copyright (C) 2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
/* Copyright (C) 2020
-2025
GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
SPDX-License-Identifier: GPL-3.0-only
Authors: Florian Uhlig [committer] */
Authors: Florian Uhlig [committer]
, Pierre-Alain Loizeau
*/
Int_t
loadlib
(
TString
libname
)
Int_t
loadlib
(
TString
libname
,
TString
classname
=
""
)
{
// This method returns 0 if it succeed, 1 if already loaded, -1 if lib not found and -2 if failed
Int_t
retval
=
gSystem
->
Load
(
libname
);
if
(
0
==
retval
&&
""
!=
classname
)
{
// This one returns 1 in case of success and 0 in case of failure
// => Remap to next negative code after those used by the Load thod above
if
(
1
==
gInterpreter
->
AutoParse
(
classname
))
{
retval
=
0
;
}
else
{
retval
=
-
3
;
}
}
return
retval
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment