Message: Re: 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

Warning Re: CMAKE_INSTALL_LIBDIR & proper way for side-by-side installation of multiple Geant4 versions 

Forum: Installation and Configuration
Re: Question CMAKE_INSTALL_LIBDIR & proper way for side-by-side installation of multiple Geant4 versions (Mojca Miklavec)
Date: 04 Jul, 2013
From: Ben Morgan <Ben Morgan>

Hi Mojca,

On Wed, 03 Jul 2013 12:30:00 GMT, Mojca Miklavec wrote:
> 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.

We will certainly review the install paths and their configurability. However, what is the use case for simultaneous multiple versions? Macports provides the ability to activate/deactivate ports, and for a library like Geant4 this would seem to be a much easier solution. That's especially true since later on you talk about making symlinks - in essence you'll have to provide a whole "python_select" type layer to choose the correct version.

> 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.

Yes, you will always get "Geant4" appended to the include dir path. We install a lot of headers, so they need to be "namespaced". We won't change this, but you can patch if your use case requires.

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

As of 9.6, you should be able to set the CMake variable GEANT4_INSTALL_DATADIR variable to the path where data can be found. This is described in the Installation Guide.

> 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. 

The script will (or rather should) cope with symlinks. The script is intended to use relative paths from where it locates itself (physical location, not symlink) to the relevant directories. That should handle even highly customized paths - so please check what it actually outputs, as if it doesn't handle this, there's probably a bug.

> 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.

This is on the list of things to look at (use of rpath on mac) - but since (as far as I know) Macports installs are not intended to be relocatable, this shouldn't be an issue. In fact, you almost certainly want this as otherwise you have to fiddle with environment variables or fixup the library paths on the fly. You can also always patch the CMake scripts to change the INSTALL_NAME_DIR.

Nevertheless, I would not recommend trying to have concurrent installs of multiple versions of Geant4 in MacPorts...

Cheers,

Ben.

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

1 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: "Re: 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 ]