Closed civanch closed 8 years ago
@iahmad-khan , please test this extra CMS patch
A new Pull Request was created by @civanch (Vladimir Ivantchenko) for branch cms/4.10.02.p02.
@cmsbuild, @smuzaffar, @degano, @iahmad-khan, @davidlange6 can you please review it and eventually sign? Thanks. You can sign-off by replying to this message having '+1' in the first line of your reply. You can reject by replying to this message having '-1' in the first line of your reply.
external issue cms-sw/cmsdist#2371
I was testing Clang pre-3.9 in DEVEL IBs and hit GEANT4 based issue if CMSSW is compiled with Clang.
Normal IBs use the following GEANT4:
/cvmfs/cms-ib.cern.ch/2016-28/slc6_amd64_gcc530/external/geant4/10.00.p03-giojec3/lib $ ls -1 *.so | xargs -n1 -I% sh -c "nm -a % | c++filt | grep G4MTHepRando && echo %"
U G4MTHepRandom::getTheEngine()
libG4event.so
U G4MTHepRandom::getTheEngine()
libG4geometry.so
0000000000000000 a G4MTHepRandom.cc
0000000000015630 t _GLOBAL__sub_I_G4MTHepRandom.cc
0000000000025a90 T operator<<(std::basic_ostream<char, std::char_traits<char> >&, G4MTHepRandom const&)
0000000000025e70 T G4MTHepRandom::getTheSeed()
0000000000025e00 T G4MTHepRandom::setTheSeed(long, int)
0000000000025ee0 T G4MTHepRandom::getTheSeeds()
0000000000025ea0 T G4MTHepRandom::setTheSeeds(long const*, int)
0000000000025ce0 T G4MTHepRandom::getTheEngine()
0000000000025af0 T G4MTHepRandom::setTheEngine(CLHEP::HepRandomEngine*)
0000000000000028 B G4MTHepRandom::theGenerator
0000000000025d20 T G4MTHepRandom::saveFullState(std::basic_ostream<char, std::char_traits<char> >&)
0000000000025d60 T G4MTHepRandom::createInstance()
0000000000025ca0 T G4MTHepRandom::getTheGenerator()
0000000000025d40 T G4MTHepRandom::restoreFullState(std::basic_istream<char, std::char_traits<char> >&)
0000000000025f10 T G4MTHepRandom::saveEngineStatus(char const*)
0000000000025f70 T G4MTHepRandom::showEngineStatus()
0000000000025b30 T G4MTHepRandom::createInstanceOnce()
0000000000025f40 T G4MTHepRandom::restoreEngineStatus(char const*)
0000000000025b10 T G4MTHepRandom::saveStaticRandomStates(std::basic_ostream<char, std::char_traits<char> >&)
0000000000025b20 T G4MTHepRandom::restoreStaticRandomStates(std::basic_istream<char, std::char_traits<char> >&)
0000000000025910 T G4MTHepRandom::get(std::basic_istream<char, std::char_traits<char> >&)
0000000000025910 t G4MTHepRandom::get(std::basic_istream<char, std::char_traits<char> >&) [clone .localalias.3]
0000000000025a10 T G4MTHepRandom::flat()
0000000000000020 B G4MTHepRandom::isActive
0000000000025a50 T G4MTHepRandom::flatArray(int, double*)
0000000000000030 B G4MTHepRandom::theEngine
0000000000025e40 T G4MTHepRandom::G4MTHepRandom(long)
0000000000025dd0 T G4MTHepRandom::G4MTHepRandom(CLHEP::HepRandomEngine*)
00000000000259a0 T G4MTHepRandom::G4MTHepRandom(CLHEP::HepRandomEngine&)
0000000000025db0 T G4MTHepRandom::G4MTHepRandom()
0000000000025e40 T G4MTHepRandom::G4MTHepRandom(long)
0000000000025dd0 T G4MTHepRandom::G4MTHepRandom(CLHEP::HepRandomEngine*)
00000000000259a0 T G4MTHepRandom::G4MTHepRandom(CLHEP::HepRandomEngine&)
0000000000025db0 T G4MTHepRandom::G4MTHepRandom()
0000000000025a40 T G4MTHepRandom::operator()()
0000000000025980 T G4MTHepRandom::~G4MTHepRandom()
0000000000025920 T G4MTHepRandom::~G4MTHepRandom()
0000000000025920 T G4MTHepRandom::~G4MTHepRandom()
0000000000025910 T G4MTHepRandom::put(std::basic_ostream<char, std::char_traits<char> >&) const
0000000000025ac0 T operator>>(std::basic_istream<char, std::char_traits<char> >&, G4MTHepRandom&)
0000000000053348 V typeinfo for G4MTHepRandom
0000000000046d50 V typeinfo name for G4MTHepRandom
0000000000053358 V vtable for G4MTHepRandom
0000000000000018 b G4MTHepRandom::createInstanceOnce()::defaultEngine
libG4global.so
U G4MTHepRandom::getTheEngine()
libG4parmodels.so
U G4MTHepRandom::getTheEngine()
libG4particles.so
U G4MTHepRandom::getTheEngine()
libG4processes.so
U G4MTHepRandom::setTheSeeds(long const*, int)
U G4MTHepRandom::getTheEngine()
U G4MTHepRandom::setTheEngine(CLHEP::HepRandomEngine*)
U G4MTHepRandom::saveFullState(std::basic_ostream<char, std::char_traits<char> >&)
U G4MTHepRandom::saveEngineStatus(char const*)
U G4MTHepRandom::showEngineStatus()
U G4MTHepRandom::restoreEngineStatus(char const*)
libG4run.so
While DEVEL IBs:
/cvmfs/cms-ib.cern.ch/2016-28/slc6_amd64_gcc530/external/geant4/10.02.p02/lib $ ls -1 *.so | xargs -n1 -I% sh -c "nm -a % | c++filt | grep G4MTHepRando && echo %"
0000000000000000 a G4MTHepRandom.cc
libG4global.so
In DEVEL IBs Clang 3.9 complained that:
[..]
/mnt/build/davidlt/CMSSW_8_1_DEVEL_X_2016-07-05-2300/src/SimG4CMS/Calo/src/HFGflash.cc:(.text+0x710): undefined reference to `G4MTRandGaussQ::transformQuick(double)'
/mnt/build/davidlt/CMSSW_8_1_DEVEL_X_2016-07-05-2300/src/SimG4CMS/Calo/src/HFGflash.cc:(.text+0x71b): undefined reference to `G4MTHepRandom::getTheEngine()'
/mnt/build/davidlt/CMSSW_8_1_DEVEL_X_2016-07-05-2300/src/SimG4CMS/Calo/src/HFGflash.cc:(.text+0x72c): undefined reference to `G4MTRandGaussQ::transformQuick(double)'
/mnt/build/davidlt/CMSSW_8_1_DEVEL_X_2016-07-05-2300/src/SimG4CMS/Calo/src/HFGflash.cc:(.text+0xf71): undefined reference to `G4MTHepRandom::getTheEngine()'
/mnt/build/davidlt/CMSSW_8_1_DEVEL_X_2016-07-05-2300/src/SimG4CMS/Calo/src/HFGflash.cc:(.text+0xf88): undefined reference to `G4MTHepRandom::getTheEngine()'
/mnt/build/davidlt/CMSSW_8_1_DEVEL_X_2016-07-05-2300/src/SimG4CMS/Calo/src/HFGflash.cc:(.text+0xfa6): undefined reference to `G4MTHepRandom::getTheEngine()'
/mnt/build/davidlt/CMSSW_8_1_DEVEL_X_2016-07-05-2300/src/SimG4CMS/Calo/src/HFGflash.cc:(.text+0x1383): undefined reference to `G4MTHepRandom::getTheEngine()'
[..]
So, where did G4MTHepRandom
and G4MTRandGaussQ
go?
Hi David,
I think we need to fix SimG4CMS/GFlash
Cheers, Vladimir
From: davidlt [mailto:notifications@github.com] Sent: 06 July 2016 18:05 To: cms-externals/geant4 geant4@noreply.github.com Cc: Vladimir Ivantchenko Vladimir.Ivantchenko@cern.ch; Mention mention@noreply.github.com Subject: Re: [cms-externals/geant4] CMS patch on top of Geant4 10.2p02 (#11)
I was testing Clang pre-3.9 in DEVEL IBs and hit GEANT4 based issue if CMSSW is compiled with Clang.
Normal IBs use the following GEANT4:
$ /cvmfs/cms-ib.cern.ch/2016-28/slc6_amd64_gcc530/external/geant4/10.00.p03-giojec3/lib% ls -1 *.so | xargs -n1 -I% sh -c "nm -a % | c++filt | grep G4MTHepRando && echo %"
U G4MTHepRandom::getTheEngine()
libG4event.so
U G4MTHepRandom::getTheEngine()
libG4geometry.so
0000000000000000 a G4MTHepRandom.cc
0000000000015630 t _GLOBAL__sub_I_G4MTHepRandom.cc
0000000000025a90 T operator<<(std::basic_ostream<char, std::char_traits
0000000000025e70 T G4MTHepRandom::getTheSeed()
0000000000025e00 T G4MTHepRandom::setTheSeed(long, int)
0000000000025ee0 T G4MTHepRandom::getTheSeeds()
0000000000025ea0 T G4MTHepRandom::setTheSeeds(long const*, int)
0000000000025ce0 T G4MTHepRandom::getTheEngine()
0000000000025af0 T G4MTHepRandom::setTheEngine(CLHEP::HepRandomEngine*)
0000000000000028 B G4MTHepRandom::theGenerator
0000000000025d20 T G4MTHepRandom::saveFullState(std::basic_ostream<char, std::char_traits
0000000000025d60 T G4MTHepRandom::createInstance()
0000000000025ca0 T G4MTHepRandom::getTheGenerator()
0000000000025d40 T G4MTHepRandom::restoreFullState(std::basic_istream<char, std::char_traits
0000000000025f10 T G4MTHepRandom::saveEngineStatus(char const*)
0000000000025f70 T G4MTHepRandom::showEngineStatus()
0000000000025b30 T G4MTHepRandom::createInstanceOnce()
0000000000025f40 T G4MTHepRandom::restoreEngineStatus(char const*)
0000000000025b10 T G4MTHepRandom::saveStaticRandomStates(std::basic_ostream<char, std::char_traits
0000000000025b20 T G4MTHepRandom::restoreStaticRandomStates(std::basic_istream<char, std::char_traits
0000000000025910 T G4MTHepRandom::get(std::basic_istream<char, std::char_traits
0000000000025910 t G4MTHepRandom::get(std::basic_istream<char, std::char_traits
0000000000025a10 T G4MTHepRandom::flat()
0000000000000020 B G4MTHepRandom::isActive
0000000000025a50 T G4MTHepRandom::flatArray(int, double*)
0000000000000030 B G4MTHepRandom::theEngine
0000000000025e40 T G4MTHepRandom::G4MTHepRandom(long)
0000000000025dd0 T G4MTHepRandom::G4MTHepRandom(CLHEP::HepRandomEngine*)
00000000000259a0 T G4MTHepRandom::G4MTHepRandom(CLHEP::HepRandomEngine&)
0000000000025db0 T G4MTHepRandom::G4MTHepRandom()
0000000000025e40 T G4MTHepRandom::G4MTHepRandom(long)
0000000000025dd0 T G4MTHepRandom::G4MTHepRandom(CLHEP::HepRandomEngine*)
00000000000259a0 T G4MTHepRandom::G4MTHepRandom(CLHEP::HepRandomEngine&)
0000000000025db0 T G4MTHepRandom::G4MTHepRandom()
0000000000025a40 T G4MTHepRandom::operator()()
0000000000025980 T G4MTHepRandom::~G4MTHepRandom()
0000000000025920 T G4MTHepRandom::~G4MTHepRandom()
0000000000025920 T G4MTHepRandom::~G4MTHepRandom()
0000000000025910 T G4MTHepRandom::put(std::basic_ostream<char, std::char_traits
0000000000025ac0 T operator>>(std::basic_istream<char, std::char_traits
0000000000053348 V typeinfo for G4MTHepRandom
0000000000046d50 V typeinfo name for G4MTHepRandom
0000000000053358 V vtable for G4MTHepRandom
0000000000000018 b G4MTHepRandom::createInstanceOnce()::defaultEngine
libG4global.so
U G4MTHepRandom::getTheEngine()
libG4parmodels.so
U G4MTHepRandom::getTheEngine()
libG4particles.so
U G4MTHepRandom::getTheEngine()
libG4processes.so
U G4MTHepRandom::setTheSeeds(long const*, int)
U G4MTHepRandom::getTheEngine()
U G4MTHepRandom::setTheEngine(CLHEP::HepRandomEngine*)
U G4MTHepRandom::saveFullState(std::basic_ostream<char, std::char_traits<char> >&)
U G4MTHepRandom::saveEngineStatus(char const*)
U G4MTHepRandom::showEngineStatus()
U G4MTHepRandom::restoreEngineStatus(char const*)
libG4run.so
While DEVEL IBs:
$ ls -1 *.so | xargs -n1 -I% sh -c "nm -a % | c++filt | grep G4MTHepRando && echo %"
0000000000000000 a G4MTHepRandom.cc
libG4global.so
In DEVEL IBs Clang 3.9 complained that:
[..]
/mnt/build/davidlt/CMSSW_8_1_DEVEL_X_2016-07-05-2300/src/SimG4CMS/Calo/src/HFGflash.cc:(.text+0x710): undefined reference to `G4MTRandGaussQ::transformQuick(double)'
/mnt/build/davidlt/CMSSW_8_1_DEVEL_X_2016-07-05-2300/src/SimG4CMS/Calo/src/HFGflash.cc:(.text+0x71b): undefined reference to `G4MTHepRandom::getTheEngine()'
/mnt/build/davidlt/CMSSW_8_1_DEVEL_X_2016-07-05-2300/src/SimG4CMS/Calo/src/HFGflash.cc:(.text+0x72c): undefined reference to `G4MTRandGaussQ::transformQuick(double)'
/mnt/build/davidlt/CMSSW_8_1_DEVEL_X_2016-07-05-2300/src/SimG4CMS/Calo/src/HFGflash.cc:(.text+0xf71): undefined reference to `G4MTHepRandom::getTheEngine()'
/mnt/build/davidlt/CMSSW_8_1_DEVEL_X_2016-07-05-2300/src/SimG4CMS/Calo/src/HFGflash.cc:(.text+0xf88): undefined reference to `G4MTHepRandom::getTheEngine()'
/mnt/build/davidlt/CMSSW_8_1_DEVEL_X_2016-07-05-2300/src/SimG4CMS/Calo/src/HFGflash.cc:(.text+0xfa6): undefined reference to `G4MTHepRandom::getTheEngine()'
/mnt/build/davidlt/CMSSW_8_1_DEVEL_X_2016-07-05-2300/src/SimG4CMS/Calo/src/HFGflash.cc:(.text+0x1383): undefined reference to `G4MTHepRandom::getTheEngine()'
[..]
So, where did G4MTHepRandom and G4MTRandGaussQ go?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/cms-externals/geant4/pull/11#issuecomment-230820171, or mute the threadhttps://github.com/notifications/unsubscribe/AEub7kHIJJzOF2ASBhkDHR1QHoL6nc37ks5qS9JFgaJpZM4JE8BX.
/cvmfs/cms-ib.cern.ch/2016-28/slc6_amd64_gcc530/external/geant4/10.02.p02/include/Geant4/Randomize.hh
32 #include <CLHEP/Random/Randomize.h>
33
34 #if __clang__
35 #if ((defined(G4MULTITHREADED) && !defined(G4USE_STD11)) || \
36 !__has_feature(cxx_thread_local)) || !__has_feature(c_atomic)
37 #define CLANG_NOSTDTLS
38 #endif
39 #endif
40
41 #if (defined(G4MULTITHREADED) && \
42 (!defined(G4USE_STD11) || (defined(CLANG_NOSTDTLS) || defined(__INTEL_COMPILER))))
With Clang the last if-statement is true, thus G4MT*
stuff is used by default, but no symbols are provided with new GEANT4 version.
#define G4MULTITHREADED 1
#define G4USE_STD11 1
#define CLANG_NOSTDTLS
The first if statement is bound to set CLANG_NOSTDTLS
, due to !__has_feature(cxx_thread_local)) || !__has_feature(c_atomic)
. cxx_thread_local
is C++11, while c_atomic
is C11, but C11 is not part of C++11 or C++14. So, !__has_feature(c_atomic)
will return true
in C++. Even in C++17 they still refer to C99 standard, not C11.
Thus the logic seems to be wrong.
The following cured the issue:
diff --git a/source/global/HEPRandom/include/Randomize.hh b/source/global/HEPRandom/include/Randomize.hh
index 0996071..5e52743 100644
--- a/source/global/HEPRandom/include/Randomize.hh
+++ b/source/global/HEPRandom/include/Randomize.hh
@@ -33,7 +33,7 @@
#if __clang__
#if ((defined(G4MULTITHREADED) && !defined(G4USE_STD11)) || \
- !__has_feature(cxx_thread_local)) || !__has_feature(c_atomic)
+ !__has_feature(cxx_thread_local))
#define CLANG_NOSTDTLS
#endif
#endif
diff --git a/source/global/HEPRandom/src/G4MTHepRandom.cc b/source/global/HEPRandom/src/G4MTHepRandom.cc
index 3b84d2c..99ecde0 100644
--- a/source/global/HEPRandom/src/G4MTHepRandom.cc
+++ b/source/global/HEPRandom/src/G4MTHepRandom.cc
@@ -28,7 +28,7 @@
//
#if __clang__
#if ((defined(G4MULTITHREADED) && !defined(G4USE_STD11)) || \
- !__has_feature(cxx_thread_local)) || !__has_feature(c_atomic)
+ !__has_feature(cxx_thread_local))
#define CLANG_NOSTDTLS
#endif
#endif
diff --git a/source/global/HEPRandom/src/G4MTRandBit.cc b/source/global/HEPRandom/src/G4MTRandBit.cc
index d2681e5..77e277c 100644
--- a/source/global/HEPRandom/src/G4MTRandBit.cc
+++ b/source/global/HEPRandom/src/G4MTRandBit.cc
@@ -28,7 +28,7 @@
//
#if __clang__
#if ((defined(G4MULTITHREADED) && !defined(G4USE_STD11)) || \
- !__has_feature(cxx_thread_local)) || !__has_feature(c_atomic)
+ !__has_feature(cxx_thread_local))
#define CLANG_NOSTDTLS
#endif
#endif
diff --git a/source/global/HEPRandom/src/G4MTRandExponential.cc b/source/global/HEPRandom/src/G4MTRandExponential.cc
index dc3b72a..9e9589d 100644
--- a/source/global/HEPRandom/src/G4MTRandExponential.cc
+++ b/source/global/HEPRandom/src/G4MTRandExponential.cc
@@ -28,7 +28,7 @@
//
#if __clang__
#if ((defined(G4MULTITHREADED) && !defined(G4USE_STD11)) || \
- !__has_feature(cxx_thread_local)) || !__has_feature(c_atomic)
+ !__has_feature(cxx_thread_local))
#define CLANG_NOSTDTLS
#endif
#endif
diff --git a/source/global/HEPRandom/src/G4MTRandFlat.cc b/source/global/HEPRandom/src/G4MTRandFlat.cc
index 07c82c1..e2ae9b0 100644
--- a/source/global/HEPRandom/src/G4MTRandFlat.cc
+++ b/source/global/HEPRandom/src/G4MTRandFlat.cc
@@ -28,7 +28,7 @@
//
#if __clang__
#if ((defined(G4MULTITHREADED) && !defined(G4USE_STD11)) || \
- !__has_feature(cxx_thread_local)) || !__has_feature(c_atomic)
+ !__has_feature(cxx_thread_local))
#define CLANG_NOSTDTLS
#endif
#endif
diff --git a/source/global/HEPRandom/src/G4MTRandGamma.cc b/source/global/HEPRandom/src/G4MTRandGamma.cc
index 7f6d84f..47e822d 100644
--- a/source/global/HEPRandom/src/G4MTRandGamma.cc
+++ b/source/global/HEPRandom/src/G4MTRandGamma.cc
@@ -28,7 +28,7 @@
//
#if __clang__
#if ((defined(G4MULTITHREADED) && !defined(G4USE_STD11)) || \
- !__has_feature(cxx_thread_local)) || !__has_feature(c_atomic)
+ !__has_feature(cxx_thread_local))
#define CLANG_NOSTDTLS
#endif
#endif
diff --git a/source/global/HEPRandom/src/G4MTRandGauss.cc b/source/global/HEPRandom/src/G4MTRandGauss.cc
index 607574d..5f2eb65 100644
--- a/source/global/HEPRandom/src/G4MTRandGauss.cc
+++ b/source/global/HEPRandom/src/G4MTRandGauss.cc
@@ -28,7 +28,7 @@
//
#if __clang__
#if ((defined(G4MULTITHREADED) && !defined(G4USE_STD11)) || \
- !__has_feature(cxx_thread_local)) || !__has_feature(c_atomic)
+ !__has_feature(cxx_thread_local))
#define CLANG_NOSTDTLS
#endif
#endif
diff --git a/source/global/HEPRandom/src/G4MTRandGaussQ.cc b/source/global/HEPRandom/src/G4MTRandGaussQ.cc
index 09c8694..f8535cd 100644
--- a/source/global/HEPRandom/src/G4MTRandGaussQ.cc
+++ b/source/global/HEPRandom/src/G4MTRandGaussQ.cc
@@ -28,7 +28,7 @@
//
#if __clang__
#if ((defined(G4MULTITHREADED) && !defined(G4USE_STD11)) || \
- !__has_feature(cxx_thread_local)) || !__has_feature(c_atomic)
+ !__has_feature(cxx_thread_local))
#define CLANG_NOSTDTLS
#endif
#endif
diff --git a/source/global/HEPRandom/src/G4MTRandGeneral.cc b/source/global/HEPRandom/src/G4MTRandGeneral.cc
index ad51b95..d93fa8c 100644
--- a/source/global/HEPRandom/src/G4MTRandGeneral.cc
+++ b/source/global/HEPRandom/src/G4MTRandGeneral.cc
@@ -28,7 +28,7 @@
//
#if __clang__
#if ((defined(G4MULTITHREADED) && !defined(G4USE_STD11)) || \
- !__has_feature(cxx_thread_local)) || !__has_feature(c_atomic)
+ !__has_feature(cxx_thread_local))
#define CLANG_NOSTDTLS
#endif
#endif
Added modifications in configuration of FTF model and de-excitation module, which should provide better agreement with TB and run-2 data.