Problem 1925

Summary: Build failure in macOS Sierra (v. 10.12.1) with option multithreading on
Product: Geant4 Reporter: Dan Ciubotaru <dan.andrei.ciubotaru>
Component: cmakeAssignee: Ben Morgan <Ben.Morgan>
Status: CLOSED FIXED    
Severity: minor    
Priority: P4    
Version: other   
Hardware: All   
OS: All   
Attachments: a screenshot of the cmake options selected on my build using ccmake

Description Dan Ciubotaru 2016-12-08 09:50:55 CET
Created attachment 433 [details]
a screenshot of the cmake options selected on my build using ccmake

Hello everybody,

I'm trying to build Geant4.10.3.0.beta with the cmake option -DGEANT4_BUILD_MULTITHREADED=ON and I receive the following compiling error:

make VERBOSE=1
=================================================================================
[ 23%] Linking CXX shared library ../../BuildProducts/lib/libG4track.dylib
cd /Users/danciubotaru/software/geant4/build/source/track && /usr/local/Cellar/cmake/3.7.1/bin/cmake -E cmake_link_script CMakeFiles/G4track.dir/link.txt --verbose=1
/usr/bin/g++  -W -Wall -pedantic -Wno-non-virtual-dtor -Wno-long-long -Wwrite-strings -Wpointer-arith -Woverloaded-virtual -Wno-variadic-macros -Wshadow -pipe -Qunused-arguments -stdlib=libc++ -DG4USE_STD11 -pthread -ftls-model=initial-exec -O2 -g -dynamiclib -Wl,-headerpad_max_install_names  -o ../../BuildProducts/lib/libG4track.dylib -install_name @rpath/libG4track.dylib CMakeFiles/G4track.dir/src/G4FieldTrackUpdator.cc.o CMakeFiles/G4track.dir/src/G4ParticleChange.cc.o CMakeFiles/G4track.dir/src/G4ParticleChangeForDecay.cc.o CMakeFiles/G4track.dir/src/G4ParticleChangeForGamma.cc.o CMakeFiles/G4track.dir/src/G4ParticleChangeForLoss.cc.o CMakeFiles/G4track.dir/src/G4ParticleChangeForMSC.cc.o CMakeFiles/G4track.dir/src/G4ParticleChangeForTransport.cc.o CMakeFiles/G4track.dir/src/G4Step.cc.o CMakeFiles/G4track.dir/src/G4StepPoint.cc.o CMakeFiles/G4track.dir/src/G4Track.cc.o CMakeFiles/G4track.dir/src/G4VParticleChange.cc.o CMakeFiles/G4track.dir/src/G4VelocityTable.cc.o CMakeFiles/G4track.dir/src/G4VAuxiliaryTrackInformation.cc.o CMakeFiles/G4track.dir/src/G4VUserTrackInformation.cc.o -Wl,-rpath,/Users/danciubotaru/software/geant4/build/BuildProducts/lib ../../BuildProducts/lib/libG4particles.dylib ../../BuildProducts/lib/libG4geometry.dylib ../../BuildProducts/lib/libG4graphics_reps.dylib ../../BuildProducts/lib/libG4materials.dylib ../../BuildProducts/lib/libG4intercoms.dylib ../../BuildProducts/lib/libG4global.dylib ../../BuildProducts/lib/libG4clhep.dylib
Undefined symbols for architecture x86_64:
  "__ZTWN14G4GeomSplitterI8G4LVDataE6offsetE", referenced from:
      G4Track::CalculateVelocityForOpticalPhoton() const in G4Track.cc.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [BuildProducts/lib/libG4track.dylib] Error 1
make[1]: *** [source/track/CMakeFiles/G4track.dir/all] Error 2
make: *** [all] Error 2
=================================================================================

I'm compiling this in MacOS Sierra ver.10.12.1 with clang, but I get the same result if  use g++.
This error appear only if I use the -DGEANT4_BUILD_MULTITHREADED=ON. If this option is OFF, Geant4 is compiled successfully.
I previously compiled this successfully in Ubuntu 16.04 with the same parameters.

I found a similar error message here http://hypernews.slac.stanford.edu/HyperNews/geant4/get/installconfig/1835.html

Thank you very much!
Comment 1 Ben Morgan 2016-12-08 14:03:54 CET
This is a known error with multithreading on macOS 10.12/Xcode 8, and is fixed in the upcoming 10.3 release. That's scheduled for release tomorrow, so marking this as resolved.
Comment 2 Dan Ciubotaru 2016-12-09 09:48:32 CET
Thank you for this.
I looking forward to testing the new release.

Will it be published on https://gitlab.cern.ch/geant4/geant4.git?
Comment 3 Ben Morgan 2016-12-09 13:26:06 CET
(In reply to Dan Ciubotaru from comment #2)
> Thank you for this.
> I looking forward to testing the new release.
> 
> Will it be published on https://gitlab.cern.ch/geant4/geant4.git?

Yes, the import and tag was done this morning.