Search code examples
makefilepython-module

g4py building errors with TLS reference


I'm trying to compile g4py. I have already used "./configure" and now I'm trying to run "make", but during compilation there appear a few errors, which all look similar to this first one:

Building a module G4event.so ...
/usr/bin/ld: anEventAllocator: TLS reference in /home/marcin/geant4/geant4.10.0-install/lib64/libG4persistency.so mismatches non-TLS reference in pyG4Event.o
/home/marcin/geant4/geant4.10.0-install/lib64/libG4persistency.so: error adding symbols: bad value
collect2: error: ld returned 1 exit status

Than after "make install" I get same erros and after that I can't import g4py, because of error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/marcin/geant4/geant4.10.0-install/g4py/lib/Geant4/__init__.py", line 17, in <module>
    from G4intercoms import *
ImportError: /home/marcin/geant4/geant4.10.0-install/g4py/lib/Geant4/G4intercoms.so: undefined symbol: G4cout

Does anyone know what it is going about??


Solution

  • Make sure to link against a non-multithreading build of Geant 4.10, since g4py does not have multithreading support, yet. You can build a non-multithreading version by specifying -DGEANT4_BUILD_MULTITHREADED=OFF when configuring your GEANT4 installation using cmake.