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

Problems with ddsim on macs #425

Closed
andresailer opened this issue Aug 1, 2018 · 22 comments
Closed

Problems with ddsim on macs #425

andresailer opened this issue Aug 1, 2018 · 22 comments

Comments

@andresailer
Copy link
Member

From @peterkostka in #420 #420 (comment)

Compile and install on  MacOS - 10.13.6, 
using:
GEANT4 - 4.10.04.p02, 
ROOT - 6.14.00, 
boost - 1.67.0, 
xerces - 3.2.0,
lcio - 02-10-01,
gear - 01-06-01,
clhep - 2.4.0.1

**Compile and install - no problem**;

Excerpt from     Testing/Temporary/LastTest.log:
::::::::
12/12 Test: test_ddsim
Command: "/opt/DD4hep/install/bin/run_test.sh" "ddsim" "--compactFile=/opt/DD4hep/install/DDDetectors/compact/SiD.xml" "--runType=batch" "-G" "-N=2" "--outputFile=testSid.root" "--part.userParticleHandler="
Directory: /opt/DD4hep/build/DDTest
"test_ddsim" start time: Aug 01 08:52 CEST
Output:
----------------------------------------------------------
---running test :  ' ddsim --compactFile=/opt/DD4hep/install/DDDetectors/compact/SiD.xml --runType=batch -G -N=2 --outputFile=testSid.root --part.userParticleHandler= '
cling::DynamicLibraryManager::loadLibrary(): dlopen(/opt/aidasoft/DD4hep/install/lib/libDDCore.1.8.dylib, 9): Library not loaded: /opt/DD4hep/install/libDDParsers.1.8.dylib
  Referenced from: /opt/aidasoft/DD4hep/install/lib/libDDCore.1.8.dylib
  Reason: image not found
INFO: +--------------------------------------------------------------------------------------------------------+
INFO: |  Failed to load dd4hep base library:                                                                   |
INFO: |  dd4hep.py: Failed to load the dd4hep library libDDCore: No such file or directory                     |
INFO: +--------------------------------------------------------------------------------------------------------+

===================================
Fast fix in $DD4hepINSTALL - set symbolic links:
===================================
libDD4hepGaudiPluginMgr.1.8.dylib -> lib/libDD4hepGaudiPluginMgr.1.8.dylib*
libDDCore.1.8.dylib -> lib/libDDCore.1.8.dylib*
libDDG4.1.8.dylib -> lib/libDDG4.1.8.dylib*
libDDParsers.1.8.dylib -> lib/libDDParsers.1.8.dylib*
libDDRec.1.8.dylib -> lib/libDDRec.1.8.dylib*
@andresailer
Copy link
Member Author

@peterkostka
can you please post the cmake command and the output of

otool -L libDDCore.1.8.dylib
otool -l libDDCore.1.8.dylib

@andresailer
Copy link
Member Author

#420 (comment)

> otool -L libDDCore.1.8.dylib
[snip]
/opt/DD4hep/install/libDDParsers.1.8.dylib (compatibility version 1.8.0, current version 1.8.0)
/opt/DD4hep/install/libDD4hepGaudiPluginMgr.1.8.dylib (compatibility version 1.8.0, current version 1.8.0)

Also it seems to me that you should not turn off the CMAKE_MACOSX_RPATH

set(CMAKE_MACOSX_RPATH 1)

Is there a reason you turn it off?

@peterkostka
Copy link
Contributor

Starting from scratch -
removing build and install folders and
removing -D CMAKE_MACOSX_RPATH:BOOL=OFF from cmake command
ends up with the same error -
12/12 Test #12: test_ddsim .......................***Failed

-D CMAKE_MACOSX_RPATH:BOOL=OFF is a leftover .....

@andresailer
Copy link
Member Author

What do you get for

otool -L libDDCore.1.8.dylib

Now?
And is the output for

ctest -V -R test_ddsim

the same as before?

@peterkostka
Copy link
Contributor

The same picture:
> otool -L libDDCore.1.8.dylib
libDDCore.1.8.dylib:
/opt/DD4hep/install/libDDCore.1.8.dylib (compatibility version 1.8.0, current version 1.8.0)
@rpath/libCore.so (compatibility version 0.0.0, current version 0.0.0)
@rpath/libImt.so (compatibility version 0.0.0, current version 0.0.0)
@rpath/libRIO.so (compatibility version 0.0.0, current version 0.0.0)
@rpath/libNet.so (compatibility version 0.0.0, current version 0.0.0)
@rpath/libHist.so (compatibility version 0.0.0, current version 0.0.0)
@rpath/libGraf.so (compatibility version 0.0.0, current version 0.0.0)
@rpath/libGraf3d.so (compatibility version 0.0.0, current version 0.0.0)
@rpath/libGpad.so (compatibility version 0.0.0, current version 0.0.0)
@rpath/libTree.so (compatibility version 0.0.0, current version 0.0.0)
@rpath/libTreePlayer.so (compatibility version 0.0.0, current version 0.0.0)
@rpath/libRint.so (compatibility version 0.0.0, current version 0.0.0)
@rpath/libPostscript.so (compatibility version 0.0.0, current version 0.0.0)
@rpath/libMatrix.so (compatibility version 0.0.0, current version 0.0.0)
@rpath/libPhysics.so (compatibility version 0.0.0, current version 0.0.0)
@rpath/libMathCore.so (compatibility version 0.0.0, current version 0.0.0)
@rpath/libThread.so (compatibility version 0.0.0, current version 0.0.0)
@rpath/libMultiProc.so (compatibility version 0.0.0, current version 0.0.0)
@rpath/libGeom.so (compatibility version 0.0.0, current version 0.0.0)
@rpath/libGenVector.so (compatibility version 0.0.0, current version 0.0.0)
/opt/xerces/install/lib/libxerces-c-3.2.dylib (compatibility version 0.0.0, current version 0.0.0)
/opt/DD4hep/install/libDDParsers.1.8.dylib (compatibility version 1.8.0, current version 1.8.0)
/opt/DD4hep/install/libDD4hepGaudiPluginMgr.1.8.dylib (compatibility version 1.8.0, current version 1.8.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 400.9.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.50.4)

Also the test output is unchanged:
> ctest -V -R test_ddsim
UpdateCTestConfiguration from :/opt/DD4hep/build/DartConfiguration.tcl
Parse Config file:/opt/DD4hep/build/DartConfiguration.tcl
UpdateCTestConfiguration from :/opt/DD4hep/build/DartConfiguration.tcl
Parse Config file:/opt/DD4hep/build/DartConfiguration.tcl
Test project /opt/DD4hep/build
Constructing a list of tests
Done constructing a list of tests
Updating test list for fixtures
Added 0 tests to meet fixture requirements
Checking test dependency graph...
Checking test dependency graph end
test 12
Start 12: test_ddsim
12: Test command: /opt/DD4hep/install/bin/run_test.sh "ddsim" "--compactFile=/opt/DD4hep/install/DDDetectors/compact/SiD.xml" "--runType=batch" "-G" "-N=2" "--outputFile=testSid.root" "--part.userParticleHandler="
12: Test timeout computed to be: 1500
12: ---running test : ' ddsim --compactFile=/opt/DD4hep/install/DDDetectors/compact/SiD.xml --runType=batch -G -N=2 --outputFile=testSid.root --part.userParticleHandler= '
12: cling::DynamicLibraryManager::loadLibrary(): dlopen(/opt/aidasoft/DD4hep/install/lib/libDDCore.1.8.dylib, 9): Library not loaded: /opt/DD4hep/install/libDDParsers.1.8.dylib
12: Referenced from: /opt/aidasoft/DD4hep/install/lib/libDDCore.1.8.dylib
12: Reason: image not found
12: INFO: +--------------------------------------------------------------------------------------------------------+
12: INFO: | Failed to load dd4hep base library: |
12: INFO: | dd4hep.py: Failed to load the dd4hep library libDDCore: No such file or directory |
12: INFO: +--------------------------------------------------------------------------------------------------------+
1/1 Test #12: test_ddsim .......................***Failed 1.60 sec

@andresailer
Copy link
Member Author

Seems like the RPATH didn't get set
what does

otool -l libDDCore.1.8.dylib

say?

it looks like this for me with RPATH

otool -L lib/libDDCore.dylib
lib/libDDCore.dylib:
        @rpath/libDDCore.1.8.dylib (compatibility version 1.8.0, current version 1.8.0)
        [snip root libraries]
        @rpath/libDDParsers.1.8.dylib (compatibility version 1.8.0, current version 1.8.0)
        @rpath/libDD4hepGaudiPluginMgr.1.8.dylib (compatibility version 1.8.0, current version 1.8.0)
        /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 400.9.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.0.0)

and like this without RPATH

otool -L lib/libDDCore.dylib
lib/libDDCore.dylib:
        /Users/gitlab-runner/builds/98de57ac/0/sailer/DD4hep/build/lib/libDDCore.1.8.dylib (compatibility version 1.8.0, current version 1.8.0)
        [snip ROOT libraries]
        /Users/gitlab-runner/builds/98de57ac/0/sailer/DD4hep/build/lib/libDDParsers.1.8.dylib (compatibility version 1.8.0, current version 1.8.0)
        /Users/gitlab-runner/builds/98de57ac/0/sailer/DD4hep/build/lib/libDD4hepGaudiPluginMgr.1.8.dylib (compatibility version 1.8.0, current version 1.8.0)
        /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 400.9.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.0.0)

@peterkostka
Copy link
Contributor

Right RPATH does not get set;
explicitly setting -D CMAKE_MACOSX_RPATH:BOOL=OFF or
-D CMAKE_MACOSX_RPATH:BOOL=ON does not make any difference;

in both cases:
> otool -L lib/libDDCore.1.8.dylib
lib/libDDCore.1.8.dylib:
/opt/DD4hep/install/libDDCore.1.8.dylib (compatibility version 1.8.0, current version 1.8.0)
@rpath/libCore.so (compatibility version 0.0.0, current version 0.0.0)
@rpath/libImt.so (compatibility version 0.0.0, current version 0.0.0)
@rpath/libRIO.so (compatibility version 0.0.0, current version 0.0.0)
@rpath/libNet.so (compatibility version 0.0.0, current version 0.0.0)
@rpath/libHist.so (compatibility version 0.0.0, current version 0.0.0)
@rpath/libGraf.so (compatibility version 0.0.0, current version 0.0.0)
@rpath/libGraf3d.so (compatibility version 0.0.0, current version 0.0.0)
@rpath/libGpad.so (compatibility version 0.0.0, current version 0.0.0)
@rpath/libTree.so (compatibility version 0.0.0, current version 0.0.0)
@rpath/libTreePlayer.so (compatibility version 0.0.0, current version 0.0.0)
@rpath/libRint.so (compatibility version 0.0.0, current version 0.0.0)
@rpath/libPostscript.so (compatibility version 0.0.0, current version 0.0.0)
@rpath/libMatrix.so (compatibility version 0.0.0, current version 0.0.0)
@rpath/libPhysics.so (compatibility version 0.0.0, current version 0.0.0)
@rpath/libMathCore.so (compatibility version 0.0.0, current version 0.0.0)
@rpath/libThread.so (compatibility version 0.0.0, current version 0.0.0)
@rpath/libMultiProc.so (compatibility version 0.0.0, current version 0.0.0)
@rpath/libGeom.so (compatibility version 0.0.0, current version 0.0.0)
@rpath/libGenVector.so (compatibility version 0.0.0, current version 0.0.0)
/opt/xerces/install/lib/libxerces-c-3.2.dylib (compatibility version 0.0.0, current version 0.0.0)
/opt/DD4hep/install/libDDParsers.1.8.dylib (compatibility version 1.8.0, current version 1.8.0)
/opt/DD4hep/install/libDD4hepGaudiPluginMgr.1.8.dylib (compatibility version 1.8.0, current version 1.8.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 400.9.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.50.4)

for the ROOT libraries is works ! ... ?

@andresailer
Copy link
Member Author

Just to be sure, you are running make install after the cmake call?

@peterkostka
Copy link
Contributor

Correct!
make install; make test
(install, build directories deleted before cmake ....)

@peterkostka
Copy link
Contributor

Some more informations:
> grep -i rpath CMakeCache.txt
//Build with rpath on macos
CMAKE_MACOSX_RPATH:BOOL=ON
CMAKE_SKIP_INSTALL_RPATH:BOOL=NO
CMAKE_SKIP_RPATH:BOOL=NO
//ADVANCED property for variable: CMAKE_SKIP_INSTALL_RPATH
CMAKE_SKIP_INSTALL_RPATH-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_SKIP_RPATH
CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1

@andresailer
Copy link
Member Author

I get the same

bash-3.2$ cmake -D CMAKE_MACOSX_RPATH:BOOL=ON .. > /dev/null && grep -i RPATH CMakeCache.txt
//Build with rpath on macos
CMAKE_MACOSX_RPATH:BOOL=ON
CMAKE_SKIP_INSTALL_RPATH:BOOL=NO
CMAKE_SKIP_RPATH:BOOL=NO
//ADVANCED property for variable: CMAKE_SKIP_INSTALL_RPATH
CMAKE_SKIP_INSTALL_RPATH-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_SKIP_RPATH
CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1
bash-3.2$ cmake -D CMAKE_MACOSX_RPATH:BOOL=OFF .. > /dev/null && grep -i RPATH CMakeCache.txt
//Build with rpath on macos
CMAKE_MACOSX_RPATH:BOOL=OFF
CMAKE_SKIP_INSTALL_RPATH:BOOL=NO
CMAKE_SKIP_RPATH:BOOL=NO
//ADVANCED property for variable: CMAKE_SKIP_INSTALL_RPATH
CMAKE_SKIP_INSTALL_RPATH-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_SKIP_RPATH
CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1

@andresailer
Copy link
Member Author

The problem I saw was with the #!/usr/bin/env python in the ddsim executable script, if I replace that with hardcoding the proper python, or calling

python `which ddsim` ...

things are also working without the RPATH

@peterkostka
Copy link
Contributor

The same for me:
> python which ddsim "--compactFile=/opt/DD4hep/install/DDDetectors/compact/SiD.xml" "--runType=batch" "-G" "-N=2" "--outputFile=testSid.root" "--part.userParticleHandler="
DEBUG: Importing units into namespace units
DEBUG: Importing units into namespace dd4hep
PersistencyIO INFO +++ Set Streamer to dd4hep::OpaqueDataBlock
PersistencyIO INFO +++ Patching TGeoVolume.fUserExtension to persistent
PersistencyIO INFO +++ Patching TGeoNode.fUserExtension to persistent
:::: snip ::::

=======================================================================
====== Pre-compound/De-excitation Physics Parameters ========
=======================================================================

Type of pre-compound inverse x-section 3
Pre-compound model active 1
Pre-compound low energy (MeV) 0.1
Type of de-excitation inverse x-section 3
Type of de-excitation factory Evaporation
Number of de-excitation channels 8
Min excitation energy (keV) 0.01
Min energy per nucleon for multifragmentation (MeV) 1e+05
Level density (1/MeV) 0.1
Time limit for long lived isomeres (ns) 1e+12
Internal e- conversion flag 1
Store e- internal conversion data 0
Electron internal conversion ID 2
Correlated gamma emission flag 0
Max 2J for sampling of angular correlations 10
::: snip :::

CoulombScat: for pi-, integral: 1 SubType= 1 BuildTable= 1
Used Lambda table of pi+
ThetaMin(p) < Theta(degree) < 180; pLimit(GeV^1)= 0.139531
===== EM models for the G4Region DefaultRegionForTheWorld ======
eCoulombScattering : Emin= 0 eV Emax= 100 TeV

@petricm
Copy link

petricm commented Aug 6, 2018

Is this the system python or some other python?

@andresailer
Copy link
Member Author

@peterkostka what is your version of cmake?

@peterkostka
Copy link
Contributor

peterkostka commented Aug 6, 2018 via email

@andresailer
Copy link
Member Author

We will also try with cmake 3.11, see if this changes the rpath behaviour on macOS
Otherwise we can hardcode the python executable into ddsim for macOS, so that it doesn't go through /usr/bin/env

@petricm
Copy link

petricm commented Aug 9, 2018

In would be also helpfull is you could install cvmfs on your mac and try out our dependencies so we can easier exclude potential problems.

/etc/cvmfs/default.local

CVMFS_QUOTA_LIMIT='30000'
CVMFS_HTTP_PROXY='http://ca-proxy-meyrin.cern.ch:3128;http://ca-proxy.cern.ch:3128;http://ca01.cern.ch:3128|http://ca02.cern.ch:3128|http://ca03.cern.ch:3128|http://ca04.cern.ch:3128|http://ca05.cern.ch:3128|http://ca06.cern.ch:3128'
CVMFS_CACHE_BASE='/var/lib/cvmfs'
CVMFS_FORCE_SIGNING='yes'
CVMFS_REPOSITORIES='clicdp.cern.ch,alice-ocdb.cern.ch,alice.cern.ch,ams.cern.ch,atlas-condb.cern.ch,atlas-nightlies.cern.ch,atlas.cern.ch,cms-ib.cern.ch,cms.cern.ch,geant4.cern.ch,ilc.desy.de,lhcb.cern.ch,na61.cern.ch,sft.cern.ch,'

and the mount

sudo mount -t cvmfs clicdp.cern.ch /cvmfs/clicdp.cern.ch/

then you initialize a build by calling

export GEANT4_VERSION="10.03.p03"
./bootstrap.sh

@petricm
Copy link

petricm commented Aug 9, 2018

I can only reproduce the problem with CMAKE_MACOSX_RPATH=OFF, which is not recommended.

@peterkostka
Copy link
Contributor

peterkostka commented Aug 10, 2018

Using the cvmfs environment - all test's pass

**bootstrap_mod.sh:**
==> append : to filename to switch off syntax highlighting
#!/bin/bash

########################################################################################################################
#
# Assuming you have CVMFS and run SLC6, CERN Centos7 or macOS Sierra you can bootstrap dd4hep by executing this script
#
########################################################################################################################


source ./.dd4hep-ci.d/init_x86_64.sh

mkdir build
cd build
if [ "$(uname)" == "Darwin" ]; then
    cmake -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -DDD4HEP_USE_GEANT4=ON -DBoost_NO_BOOST_CMAKE=ON -DDD4HEP_USE_LCIO=ON -DBUILD_TESTING=ON -DGeant4_DIR=$G4INSTALL/lib/Geant4-10.3.3 -DDD4HEP_USE_CXX11=ON -DCMAKE_BUILD_TYPE=Release -DROOT_DIR=$ROOTSYS ../
else
    cmake -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -DDD4HEP_USE_GEANT4=ON -DBoost_NO_BOOST_CMAKE=ON -DDD4HEP_USE_LCIO=ON -DBUILD_TESTING=ON -DGeant4_DIR=$G4INSTALL/lib64/Geant4-10.3.3 -DDD4HEP_USE_CXX11=ON -DCMAKE_BUILD_TYPE=Release -DROOT_DIR=$ROOTSYS ../
fi
make -j2
make install
. ${CMAKE_INSTALL_PREFIX}/bin/thisdd4hep.sh
ctest --output-on-failure
cd ../examples
mkdir build
cd build
cmake  ..
make -j2
make install
ctest --output-on-failure
bootstrap_mod.sh (END)

see cvmfs_DD4hep_bootstrap_mod.log file attached
[cvmfs_DD4hep_bootstrap_mod.log](https://github.com/AIDASoft/DD4hep/files/2278503/cvmfs_DD4hep_bootstrap_mod.log)

@peterkostka
Copy link
Contributor

Modifying the (my) cmake command to:

=kostka@mbs-wlan:/opt/DD4hep/build 18:58> cmake
-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
-DBoost_NO_BOOST_CMAKE=ON
-DDD4HEP_USE_GEANT4=ON
-DDD4HEP_USE_LCIO=ON
-DBUILD_TESTING=ON
-DGeant4_DIR=$G4INSTALL/lib/Geant4-10.4.2
-DDD4HEP_USE_CXX11=ON
-DCMAKE_BUILD_TYPE=Debug
-DROOT_DIR=$ROOTSYS
-D DD4HEP_USE_BOOST:BOOL=ON
-D DD4HEP_USE_XERCESC:BOOL=ON
-D XERCESC_ROOT_DIR:STRING=$SWDIR/xerces/install
-D XERCESC_LIBRARY:FILEPATH=$SWDIR/xerces/install/lib/libxerces-c.dylib
-D DD4HEP_USE_LCIO:BOOL=ON
-D DD4HEP_USE_GEAR:BOOL=ON
-D GEAR_DIR=$GEAR_DIR
-D GEAR_GEARSURF_LIBRARY=$GEAR_DIR/lib/libgearsurf.dylib
-D GEAR_GEAR_LIBRARY=$GEAR_DIR/lib/libgear.dylib
-D GEAR_GEARXML_LIBRARY=$GEAR_DIR/lib/libgearxml.dylib
-D GEAR_GEARTGEO_LIBRARY=$GEAR_DIR/lib/libgeartgeo.dylib
-D CLHEP_ROOT_DIR:STRING=$SWDIR/clhep/install
-D CLHEP_LIBRARY:STRING=$SWDIR/clhep/install/lib/libCLHEP-2.4.0.1.dylib
-D CLHEP_INCLUDE_DIR:STRING=$SWDIR/clhep/install/include
../

solved the problem - all test's pass !!

@andresailer
Copy link
Member Author

Do you know which option specifically caused the problems?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants