macOS installation issue: missing files, headers, bin

REST version : v2.3.15
REST commit : c4db1698

ROOT version: v6.26/06
Geant4 version: v11.0.3
Garfield version: 6
cmake version: 3.25.2

Systems: macOS Monterey v. 12.6.3 (Intel i5 chip), macOS Monterey v. 12.5 (Apple M1 Pro chip).

Dear all,

I have a problem with my REST installation on macOS and I could reproduce the problem on a second MacOS device.
In general the compilation and installation of full REST (packages, libraries, etc.) works well and does not show any errors or suspicious warnings on both devices. However, within my installation folder, all headers, bins, macros, examples, etc., which are not from the framework, are non existent.

Examples: During installation I get the following terminal print-outs:
– Installing: /User/admin/apps/rest/install/bin/restG4
– Installing: /User/admin/apps/rest/install/./macros/geant4/REST_Geant4_ViewEvent.C
– Installing: /User/admin/apps/rest/install/./examples/axion/full-ray-tracing/helioscope.rml
– Installing: /User/admin/apps/rest/install/include/TRestDetectorDriftVolume.h
.
.
.

But non of those are actually written into the corresponding folders. In the same folders everything from the REST framework is existent, like /User/admin/apps/rest/install/bin/restRoot (which works fine btw.).
Libraries seem to be fine: I got all ‘CINT_xxx.pcm’ files under /User/admin/apps/rest/install/lib/ and /User/admin/apps/rest/install/bin/ in addition to the ‘libxxx.dylib’ files.

Concerning the installation procedure I’m following Javiers instructions here REST in MacOs | REST-for-Physics with latest Xcode, brew, xerces-c, cmake, and the mentioned ROOT version installation via brew. After that Luis instruction here https://indico.capa.unizar.es/event/26/contributions/392/attachments/313/459/0.3%20REST-for-Physics%20compilation%20and%20installation.pdf for Geant4, Garfield and lastly REST with

python pull-submodules.py --latest

and

cmake .. -DCMAKE_INSTALL_PREFIX=/User/admin/apps/rest/install/ -DREST_ALL_LIBS=ON -DREST_G4=ON -DREST_GARFIELD=ON
make -j8 install

All compilations and installations work and look fine on my terminal print out. The files, macros, executables, etc. are just missing. I can reproduce the exact same behaviour/outcome on both MacOS devices. Do you have any idea? Maybe some cmake related issue for MacOS?

PS: I remember that it was working well on different MacBooks during the REST school @ Zaragoza…

1 Like

I confirm I can reproduce the problem on my MacOs

I really don’t know how to fixit.

You could still copy it manually, the binary can be found inside the build directory.

So, make sure you are at the build and just do:

cd build
cp source/packages/restG4/restG4 ../install/bin/

where ../install is your final installation location.

Ok, thanks for the confirmation of the problem for MacOS!
So at least I know, that it is not something dumb in my local environment.

For the moment the manual copy method of the binaries, headers, macros, etc. from the individual libraries and packages works and I will automatise this with a script in case of re-compilation.

Best,
Daniel

Hello,

We have the same issue here on elementary linux on a laptop but also at a computing centre on centos7.

We have used conda to install geant4 and root and other tools to get more recent gcc, cmake, python…

Everything is fine at compilation and the make install says he his installing the bin and other stuff but nothing happens.

Could you hep us here, please ?

Thanks
Mathieu

Hi Mathieu,

probably the solution is coming from the following PR pushed by @nkx

Will be merged to master soon.

Thanks a lot Javier, for you prompt reply.

It did help for the installation on the linux laptop, thank you !

It improved the installation on the computing center but I’m still missing few things, I need to check a bit more.

By the way, thanks for the excellent software.

Glad to hear that!

Let us know in case we can help with the missing things.

Cheers,
Javier

Hi all,

finally I can also validate that almost everything is working fine now with respect to this problem also on my local REST macOS installation: restG4 bin, all headers, macros, examples, etc. are now existent after the installation.

The only thing which is missing is the libRestRestG4.dylib in the binary folder of the installation (and therefore the correct GEANT *dylib paths.)

With simple copies of those to the bin folder of the installation I got (probably) full REST functionality on my MacOS:

cp -n $REST_INSTALLATION_PATH/lib/libRestRestG4.dylib $REST_INSTALLATION_PATH/bin/
cp -n $GEANT4_INSTALLATION_PATH/lib/*.dylib $REST_INSTALLATION_PATH/bin/

Cheers,
Daniel

Could you try if updating the following line 114 at source/packages/restG4/CMakeLists.txt

install(TARGETS ${LIBRARY} DESTINATION lib)

by

install(TARGETS ${LIBRARY} DESTINATION bin)

fixes the problem at some level?

I also opened a PR at framework to set the MacOs installation (Darwin) to install files at bin directory and not lib.

1 Like

Thanks for the fast reply and suggestions, Javier! Works fine for all REST related libraries on MacOS. Now just the GEANT4 libraries are missing in the same bin folder and currently have to be copied manually, see comment for PR on GitHub (CMakeLists.txt adding install expection for MacOs by jgalan · Pull Request #109 · rest-for-physics/restG4 · GitHub)

1 Like

I think the mystery is finally solved. I think we do not even need to add the exceptions for the MacOs installation.

We just need to tell MacOs where to find the library by adding the library path to a variable named DYLD_LIBRARY_PATH. In Linux this variable is named LD_LIBRARY_PATH.

So that’s why the system does not find the Geant4 libraries. Although it is strange that the geant4.sh does not do initialise that variable.

I believe the problem can be finally solved by editing the thisREST.sh loading script.

Hi all,

indeed the MacOS mystery seems to be finally solved.

I confirm: With the correct setting of DYLD_LIBRARY_PATH in thisREST.sh MacOS knows where to search for the respective libraries and everything works out of the box after a clean REST installation.

I guess, we can merge PR #419 in framework and close #64 in axionlib and #109 in restG4?

Thanks for your help, Javier and Luis!

1 Like