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

ci: Enable tests for ROOT5 GCC11 environment #370

Merged
merged 5 commits into from
Jul 9, 2022

Conversation

plexoos
Copy link
Member

@plexoos plexoos commented Jun 23, 2022

This PR branch is based on and includes changes from currently unmerged #366

Copy link
Contributor

@jml985 jml985 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed these changes are fine with me and do not cause issues.

Copy link
Contributor

@klendathu2k klendathu2k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have any issues with the changes, save for one. Add the line using std::abs in AgMath.h. This will ensure that a floating point version of the abs function is used, rather than rely on whatever version gets included through TMath.h. (Worst case, it uses the cstdlib version, which will happily cast to integer and break geometries.)

StRoot/StarRoot/StBiTree.cxx Outdated Show resolved Hide resolved
StarVMC/StarAgmlLib/AgMath.h Outdated Show resolved Hide resolved
StarVMC/StarAgmlLib/AgMath.h Outdated Show resolved Hide resolved
plexoos added a commit to plexoos/star-sw that referenced this pull request Jun 24, 2022
Copy link
Contributor

@klendathu2k klendathu2k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good...

@plexoos
Copy link
Member Author

plexoos commented Jun 29, 2022

Have you considered the macros that don't use BFC?

Sure, let's consider other macros. Do you have anything specific in mind?

@genevb
Copy link
Contributor

genevb commented Jun 29, 2022 via email

@genevb
Copy link
Contributor

genevb commented Jun 29, 2022

Gotta love github's automatic formatting. Trying again from the gui:

grep StEventUtilities $STAR/StRoot/macros/.C $STAR/StRoot/macros//*.C
/afs/rhic.bnl.gov/star/packages/SL21a/StRoot/macros/Load.C:void Load(Char_t *loadList="St_base,St_Tables,StChain,StDetectorDbMaker,StBichsel,StEvent,StTpcDb,StUtilities,StDbLib,StDbBroker,St_db_Maker,StTriggerDataMaker,StEventUtilities,StBFChain"){
/afs/rhic.bnl.gov/star/packages/SL21a/StRoot/macros/loadMuDst.C: gSystem->Load("StEventUtilities");
/afs/rhic.bnl.gov/star/packages/SL21a/StRoot/macros/makePicoDst.C: gSystem->Load("StEventUtilities");
/afs/rhic.bnl.gov/star/packages/SL21a/StRoot/macros/RedoSpaceCharge.C: gSystem->Load("StEventUtilities");
/afs/rhic.bnl.gov/star/packages/SL21a/StRoot/macros/StMuDstMakerYear1.C: gSystem->Load("StEventUtilities");
/afs/rhic.bnl.gov/star/packages/SL21a/StRoot/macros/analysis/doEvents.C: gSystem->Load("StEventUtilities");
/afs/rhic.bnl.gov/star/packages/SL21a/StRoot/macros/analysis/doEvents.C:// Load StEventUtilities
/afs/rhic.bnl.gov/star/packages/SL21a/StRoot/macros/analysis/find_vertex.C: gSystem->Load("StEventUtilities");
/afs/rhic.bnl.gov/star/packages/SL21a/StRoot/macros/graphics/Draw3DDoc.C: doc.SetSourceDir(".:src:inc:StRoot:StRoot/StarRoot:StRoot/StEventUtilitie");
/afs/rhic.bnl.gov/star/packages/SL21a/StRoot/macros/graphics/GeomBrowse.C: gSystem->Load("StEventUtilities");

@plexoos
Copy link
Member Author

plexoos commented Jun 29, 2022

Have you considered all of them when you removed the dependency on Stu?

@genevb
Copy link
Contributor

genevb commented Jun 30, 2022 via email

@plexoos
Copy link
Member Author

plexoos commented Jun 30, 2022

Did you run all of these macros with default parameters?
And how did you define the criteria to pass/fail the tests?

@genevb
Copy link
Contributor

genevb commented Jun 30, 2022 via email

@plexoos
Copy link
Member Author

plexoos commented Jun 30, 2022

Would you then care to share how you run the tests?

@genevb
Copy link
Contributor

genevb commented Jun 30, 2022 via email

@plexoos
Copy link
Member Author

plexoos commented Jul 3, 2022

I see the following files modified in 79e3801 "Remove StTpcDb dependence for StEventUtilities"

 StRoot/StBFChain/BigFullChain.h                         |  2 +-
 StRoot/StEventUtilities/StEbyET0.cxx                    | 25 +++++++++++++++----------
 StRoot/StMuDSTMaker/COMMON/macros/loadSharedLibraries.C |  1 -
 StRoot/macros/analysis/doEvents.C                       |  7 +++++--
 StRoot/macros/analysis/find_vertex.C                    |  6 ++++--
 StRoot/macros/graphics/GeomBrowse.C                     |  3 +--
 StRoot/macros/loadMuDst.C                               |  1 -
 7 files changed, 26 insertions(+), 19 deletions(-)
  • StRoot/StBFChain/BigFullChain.h is what I propose to revert
  • Not sure how StRoot/StEventUtilities/StEbyET0.cxx is relevant, it is not a macro
  • Interpreting StRoot/StMuDSTMaker/COMMON/macros/loadSharedLibraries.C and StRoot/macros/loadMuDst.C in root won't reveal any problems with undefined symbols because the loader (unlike the linker) would not try to resolve them. If there is a problem it needs to be seen in runtime.
  • Running StRoot/macros/analysis/doEvents.C on a .event.root file works fine in ROOT5 gcc4.8.5 environment and with gcc11 it does require a revert due to the missing symbols from libStTpcDb
  • When I run StRoot/macros/analysis/find_vertex.C I see errors not related to StTpcDb even in ROOT5/gcc4.8.5 environment

UPDATE. The error from find_vertex.C (see test job log file https://github.com/star-bnl/star-sw/runs/7171131802)

  env:
    STARENV: root5-gcc485
 *** Start at Date : Sun Jul  3 20:13:49 2022
Processing StRoot/macros/analysis/find_vertex.C("/star/rcf/test/daq/2020/351/st_physics_20351078_raw_5000001.event.root")...
Error: Syntax error StRoot/macros/analysis/find_vertex.C:31:
Error: Missing one of ',;' expected at or after line 31.
Error: Unexpected end of file (G__fignorestream():3) StRoot/macros/analysis/find_vertex.C:261:
*** Interpreter error recovered ***
This is the end of STAR ROOT -- Goodbye

@plexoos
Copy link
Member Author

plexoos commented Jul 5, 2022

In my previous comment I forgot to mention that running root4star -l -q 'StRoot/macros/graphics/GeomBrowse.C("y2022a") also gives me an error:

Error in <TUnixSystem::DynamicPathName>: St_geom_Maker[.so | .dll | .dylib | .sl | .dl | .a] does not exist in ...

St_geom_Maker does not exist since 2019: 173d6b4 - (3 years, 3 months ago) Moved to the attic - Jerome Lauret

doEvents.C can be used as a test perhaps. find_vertex.C and GeomBrowse.C do not seem to be maintained. What's the point of changing them?

So, Gene, I am not sure where we want to go from here. Revert the entire 79e3801 "Remove StTpcDb dependence for StEventUtilities" ?

@genevb
Copy link
Contributor

genevb commented Jul 5, 2022

If a macro requires retired code, I would consider the macro retired and remove it.
-Gene

plexoos added a commit to plexoos/star-sw that referenced this pull request Jul 8, 2022
The compiler errors are:

```
g++ -fPIC -pipe -Wall -Woverloaded-virtual -std=c++0x -Wno-long-long -pthread -Wno-deprecated-declarations -m64 -O2 -g -falign-loops -falign-jumps -falign-functions -Dsl79_gcc11 -D__ROOT__ -DNEW_DAQ_READER -I. -IStRoot -I.sl79_gcc11/include -I/opt/software/linux-scientific7-x86_64/gcc-11.2.1/root-5.34.38-p7sjrh5whm6m2ao3zxkaoaqomiscvw52/include -c .sl79_gcc11/OBJ/StarVMC/StarAgmlLib/AgAttribute.cxx -o .sl79_gcc11/OBJ/StarVMC/StarAgmlLib/AgAttribute.o
In file included from .sl79_gcc11/OBJ/StarVMC/StarAgmlLib/AgBlock.h:17,
                 from .sl79_gcc11/OBJ/StarVMC/StarAgmlLib/AgAttribute.cxx:2:
.sl79_gcc11/OBJ/StarVMC/StarAgmlLib/AgMath.h:57:28: error: 'double abs(double)' conflicts with a previous declaration
   57 | inline double abs (double x) {return fabs(x);}
      |                            ^
In file included from /opt/rh/devtoolset-11/root/usr/include/c++/11/cstdlib:77,
                 from /opt/rh/devtoolset-11/root/usr/include/c++/11/ext/string_conversions.h:41,
                 from /opt/rh/devtoolset-11/root/usr/include/c++/11/bits/basic_string.h:6607,
                 from /opt/rh/devtoolset-11/root/usr/include/c++/11/string:55,
                 from /opt/software/linux-scientific7-x86_64/gcc-11.2.1/root-5.34.38-p7sjrh5whm6m2ao3zxkaoaqomiscvw52/include/TSchemaHelper.h:25,
                 from /opt/software/linux-scientific7-x86_64/gcc-11.2.1/root-5.34.38-p7sjrh5whm6m2ao3zxkaoaqomiscvw52/include/TGenericClassInfo.h:17,
                 from /opt/software/linux-scientific7-x86_64/gcc-11.2.1/root-5.34.38-p7sjrh5whm6m2ao3zxkaoaqomiscvw52/include/Rtypes.h:270,
                 from /opt/software/linux-scientific7-x86_64/gcc-11.2.1/root-5.34.38-p7sjrh5whm6m2ao3zxkaoaqomiscvw52/include/TObject.h:31,
                 from /opt/software/linux-scientific7-x86_64/gcc-11.2.1/root-5.34.38-p7sjrh5whm6m2ao3zxkaoaqomiscvw52/include/TNamed.h:26,
                 from .sl79_gcc11/OBJ/StarVMC/StarAgmlLib/AgAttribute.h:4,
                 from .sl79_gcc11/OBJ/StarVMC/StarAgmlLib/AgAttribute.cxx:1:
/opt/rh/devtoolset-11/root/usr/include/c++/11/bits/std_abs.h:71:3: note: previous declaration 'constexpr double std::abs(double)'
   71 |   abs(double __x)
      |   ^~~
In file included from .sl79_gcc11/OBJ/StarVMC/StarAgmlLib/AgBlock.h:17,
                 from .sl79_gcc11/OBJ/StarVMC/StarAgmlLib/AgAttribute.cxx:2:
.sl79_gcc11/OBJ/StarVMC/StarAgmlLib/AgMath.h:42:14: error: '_fpos_' was not declared in this scope; did you mean 'fpos_t'?
   42 | #define fpos _fpos_
      |              ^~~~~~
In file included from /opt/software/linux-scientific7-x86_64/gcc-11.2.1/root-5.34.38-p7sjrh5whm6m2ao3zxkaoaqomiscvw52/include/Riostream.h:31,
                 from .sl79_gcc11/include/Stiostream.h:36,
                 from .sl79_gcc11/include/StMessMgr.h:106,
                 from .sl79_gcc11/OBJ/StarVMC/StarAgmlLib/AgAttribute.cxx:3:
/opt/rh/devtoolset-11/root/usr/include/c++/11/fstream:98:52: error: template argument 2 is invalid
   98 |                             fpos<typename _Traits::state_type>>::value,
      |                                                    ^~~~~~~~~~
/opt/rh/devtoolset-11/root/usr/include/c++/11/fstream:98:66: error: '::value' has not been declared
   98 |                             fpos<typename _Traits::state_type>>::value,
      |                                                                  ^~~~~
cons: *** [.sl79_gcc11/OBJ/StarVMC/StarAgmlLib/AgAttribute.o] Error 1
cons: errors constructing .sl79_gcc11/OBJ/StarVMC/StarAgmlLib/AgAttribute.o
```

As suggested by @klendathu2k in star-bnl#370 (comment)
we expose std::abs in StarVMC/StarAgmlLib/AgMath.h
@plexoos plexoos added the tests Changes affecting our automatic tests label Jul 8, 2022
plexoos added a commit that referenced this pull request Jul 8, 2022
The compiler errors are:

```
g++ -fPIC -pipe -Wall -Woverloaded-virtual -std=c++0x -Wno-long-long -pthread -Wno-deprecated-declarations -m64 -O2 -g -falign-loops -falign-jumps -falign-functions -Dsl79_gcc11 -D__ROOT__ -DNEW_DAQ_READER -I. -IStRoot -I.sl79_gcc11/include -I/opt/software/linux-scientific7-x86_64/gcc-11.2.1/root-5.34.38-p7sjrh5whm6m2ao3zxkaoaqomiscvw52/include -c .sl79_gcc11/OBJ/StarVMC/StarAgmlLib/AgAttribute.cxx -o .sl79_gcc11/OBJ/StarVMC/StarAgmlLib/AgAttribute.o
In file included from .sl79_gcc11/OBJ/StarVMC/StarAgmlLib/AgBlock.h:17,
                 from .sl79_gcc11/OBJ/StarVMC/StarAgmlLib/AgAttribute.cxx:2:
.sl79_gcc11/OBJ/StarVMC/StarAgmlLib/AgMath.h:57:28: error: 'double abs(double)' conflicts with a previous declaration
   57 | inline double abs (double x) {return fabs(x);}
      |                            ^
In file included from /opt/rh/devtoolset-11/root/usr/include/c++/11/cstdlib:77,
                 from /opt/rh/devtoolset-11/root/usr/include/c++/11/ext/string_conversions.h:41,
                 from /opt/rh/devtoolset-11/root/usr/include/c++/11/bits/basic_string.h:6607,
                 from /opt/rh/devtoolset-11/root/usr/include/c++/11/string:55,
                 from /opt/software/linux-scientific7-x86_64/gcc-11.2.1/root-5.34.38-p7sjrh5whm6m2ao3zxkaoaqomiscvw52/include/TSchemaHelper.h:25,
                 from /opt/software/linux-scientific7-x86_64/gcc-11.2.1/root-5.34.38-p7sjrh5whm6m2ao3zxkaoaqomiscvw52/include/TGenericClassInfo.h:17,
                 from /opt/software/linux-scientific7-x86_64/gcc-11.2.1/root-5.34.38-p7sjrh5whm6m2ao3zxkaoaqomiscvw52/include/Rtypes.h:270,
                 from /opt/software/linux-scientific7-x86_64/gcc-11.2.1/root-5.34.38-p7sjrh5whm6m2ao3zxkaoaqomiscvw52/include/TObject.h:31,
                 from /opt/software/linux-scientific7-x86_64/gcc-11.2.1/root-5.34.38-p7sjrh5whm6m2ao3zxkaoaqomiscvw52/include/TNamed.h:26,
                 from .sl79_gcc11/OBJ/StarVMC/StarAgmlLib/AgAttribute.h:4,
                 from .sl79_gcc11/OBJ/StarVMC/StarAgmlLib/AgAttribute.cxx:1:
/opt/rh/devtoolset-11/root/usr/include/c++/11/bits/std_abs.h:71:3: note: previous declaration 'constexpr double std::abs(double)'
   71 |   abs(double __x)
      |   ^~~
In file included from .sl79_gcc11/OBJ/StarVMC/StarAgmlLib/AgBlock.h:17,
                 from .sl79_gcc11/OBJ/StarVMC/StarAgmlLib/AgAttribute.cxx:2:
.sl79_gcc11/OBJ/StarVMC/StarAgmlLib/AgMath.h:42:14: error: '_fpos_' was not declared in this scope; did you mean 'fpos_t'?
   42 | #define fpos _fpos_
      |              ^~~~~~
In file included from /opt/software/linux-scientific7-x86_64/gcc-11.2.1/root-5.34.38-p7sjrh5whm6m2ao3zxkaoaqomiscvw52/include/Riostream.h:31,
                 from .sl79_gcc11/include/Stiostream.h:36,
                 from .sl79_gcc11/include/StMessMgr.h:106,
                 from .sl79_gcc11/OBJ/StarVMC/StarAgmlLib/AgAttribute.cxx:3:
/opt/rh/devtoolset-11/root/usr/include/c++/11/fstream:98:52: error: template argument 2 is invalid
   98 |                             fpos<typename _Traits::state_type>>::value,
      |                                                    ^~~~~~~~~~
/opt/rh/devtoolset-11/root/usr/include/c++/11/fstream:98:66: error: '::value' has not been declared
   98 |                             fpos<typename _Traits::state_type>>::value,
      |                                                                  ^~~~~
cons: *** [.sl79_gcc11/OBJ/StarVMC/StarAgmlLib/AgAttribute.o] Error 1
cons: errors constructing .sl79_gcc11/OBJ/StarVMC/StarAgmlLib/AgAttribute.o
```

As suggested by @klendathu2k in #370 (comment)
we expose std::abs in StarVMC/StarAgmlLib/AgMath.h
cernlib was not built with GCC 11 due to wrong compiler version in the
path. This is fixed in v0.1.7 of star-spack
-fno-common is the default starting gcc 10

From https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html

> The -fcommon places uninitialized global variables in a common block.
> This allows the linker to resolve all tentative definitions of the same
> variable in different compilation units to the same object, or to
> a non-tentative definition. This behavior is inconsistent with C++, and
> on many targets implies a speed and code size penalty on global variable
> references. It is mainly useful to enable legacy code to link without
> errors.

Many thanks to @veprbl for the helpful suggestion:

star-bnl#366 (comment)
Inspired by the following error reported while running bfc.C:

```
...
QA :INFO  - Library libStEEmcUtil          [       EEmcUtil] (/star-sw/.sl79_gcc11/LIB/libStEEmcUtil.so)	is loaded
QA :INFO  - Library libStPmdUtil           [        PmdUtil] (/star-sw/.sl79_gcc11/LIB/libStPmdUtil.so)	is loaded
dlopen error: /star-sw/.sl79_gcc11/LIB/libStEventUtilities.so: undefined symbol: gStTpcDb
Load Error: Failed to load Dynamic link library /star-sw/.sl79_gcc11/LIB/libStEventUtilities.so
BFC:FATAL - problem with loading of libStEventUtilities
BFC:FATAL - Stu is switched off 	!!!!
root4star: .sl79_gcc11/OBJ/StRoot/StBFChain/StBFChain.cxx:177: virtual Int_t StBFChain::Load(): Assertion `libraryload!=kStErr' failed.
Error: Process completed with exit code 1.
```

Checked with `nm` utility and confirmed that gcc 11 unlike gcc 4.8.5 indeed
inserts gStTpcDb into libStEventUtilities.so as undefined symbol.

We also fix other macros by partially reverting changes made in 79e3801

Also, see dede9fe and ee960af
@plexoos plexoos requested a review from jdbrice as a code owner July 8, 2022 20:37
@plexoos plexoos merged commit 990d1fb into star-bnl:main Jul 9, 2022
@plexoos plexoos deleted the pr/gcc11_tests branch July 11, 2022 04:02
@klendathu2k
Copy link
Contributor

klendathu2k commented Oct 11, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Changes affecting our automatic tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants