Message: CMAKE_INSTALL_LIBDIR & proper way for side-by-side installation of multiple Geant4 versions Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question CMAKE_INSTALL_LIBDIR & proper way for side-by-side installation of multiple Geant4 versions 

Forum: Installation and Configuration
Date: 03 Jul, 2013
From: Mojca Miklavec <Mojca Miklavec>

I would like to support side-by-side installation of multiple Geant4 versions in MacPorts on Mac OS X (I'm writing a new package), to allow simultaneous installation of, say, Geant4 9.5.p02, Geant4 9.6.p02 and Geant4 10.0.b01.

I need to change CMAKE_INSTALL_LIBDIR, for example to CMAKE_INSTALL_LIBDIR=lib/Geant4/Geant4.9.6, else the files like libG4run.dylib from different versions would clash with each other.

But that creates another "problem". Changing this option also puts the cmake modules to a weird location: they end up in $prefix/lib/Geant4/Geant4.9.6/Geant4-9.6.2/*.cmake when they should actually go to $prefix/lib/Geant4-9.6.2/*.cmake.

Less important, but related:

I would also like to use $prefix/include/Geant4/Geant4.9.6 for included files (CMAKE_INSTALL_INCLUDEDIR=include/Geant4/Geant4.9.6), but Geant4 would automatically add Geant4 to the end, so I end up with $prefix/include/Geant4/Geant4.9.6/Geant4/include/G4Something.hh.

DATAROOTDIR is also automatically suffixed with Geant4-9.6.2 (I don't know if there is any way to control that).

Related, more important, but a completely different issue:

I also had to set CMAKE_INSTALL_BINDIR=libexec/Geant4/Geant4.9.6 to be able to avoid clashes, but since all the paths in geant4-config for example are written in a relative way, I cannot simply make a symlink like

    ln -s $prefix/libexec/Geant4/Geant4.9.6/geant-config $prefix/bin/

Of course I can patch geant-config, but it would be a lot better to have some option to hardcode paths automatically. The installation (even though default one, with some path changes) is not really rellocatable anyway. If nothing else, all the libraries are linked in an absolute way. I'm not sure how that is on Linux, but on Mac I get the following:

	> otool -L /opt/local/lib/Geant4/Geant4.9.6/libG4run.dylib 
	/opt/local/lib/Geant4/Geant4.9.6/libG4run.dylib:
		/opt/local/lib/Geant4/Geant4.9.6/libG4run.dylib (compatibility version 0.0.0, current version 0.0.0)
		/opt/local/lib/Geant4/Geant4.9.6/libG4digits_hits.dylib (compatibility version 0.0.0, current version 0.0.0)
		...
		/opt/local/lib/libexpat.1.dylib (compatibility version 8.0.0, current version 8.0.0)
		/opt/local/lib/libCLHEP-2.1.3.1.dylib (compatibility version 0.0.0, current version 0.0.0)
		/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 52.0.0)
		/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0)

with hardcoded absolute paths. Therefore the libraries would stop working if I would move them around.

I would be grateful for any hints about how to best approach this.

Thank you, Mojca

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 Warning: Re: CMAKE_INSTALL_LIBDIR & proper way for side-by-side installation of multiple Geant4 versions   (Ben Morgan - 04 Jul, 2013)
(_ None: Re: CMAKE_INSTALL_LIBDIR & proper way for side-by-side installation of multiple Geant4 versions   (Mojca Miklavec - 04 Jul, 2013)
(_ None: Re: CMAKE_INSTALL_LIBDIR & proper way for side-by-side installation of multiple Geant4 versions   (Ben Morgan - 04 Jul, 2013)
(_ None: Re: CMAKE_INSTALL_LIBDIR & proper way for side-by-side installation of multiple Geant4 versions   (Mojca Miklavec - 04 Jul, 2013)
(_ Question: Re: CMAKE_INSTALL_LIBDIR & proper way for side-by-side installation of multiple Geant4 versions   (Mojca Miklavec - 25 Jul, 2013)
 Add Message Add Message
to: "CMAKE_INSTALL_LIBDIR & proper way for side-by-side installation of multiple Geant4 versions"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]