[cmake-developers] parallel install of different cmake versions

Alan W. Irwin irwin at beluga.phys.uvic.ca
Fri Dec 18 15:10:22 EST 2015


On 2015-12-17 20:16-0700 Orion Poplawski wrote:

> On 12/14/2015 08:56 AM, Eric Noulard wrote:
>> +1
>> Personnally when I installed several version of CMake I do install them
>> with a particular prefix and then I use update-alternatives(1) to install
>> proper symlinks to the specific location.
>> 
>> I switch from one version to another using update-alternatives(1).
>> 
>> This can certainly be used on Fedora/EPEL as well:
>> https://fedoraproject.org/wiki/Packaging:Alternatives
>

Hi Orion:

I don't have any Fedora or rpm expertise to add, but
like Brad I use multiple versions of cmake all the time without
cross-talk between them.  In my case I just install them with
a separate installation prefix, and put the cmake version that
I want on my PATH.  I have investigated further what is
installed in one of those prefixes.

For CMake-3.3.2, most files are installed under $PREFIX/doc/cmake-3.3
and $PREFIX/share/cmake-3.3 so (subject to potential renaming to new
locations by the cmake specfile) there is no chance of the
installation of these files to clash between cmake major versions.
That leaves a small number of additional files which are not
identified by "cmake-3.3" in their pathname which are installed with
the following names:

$PREFIX/share/applications/CMake.desktop
$PREFIX/share/icons/hicolor/32x32/apps/CMakeSetup.png
$PREFIX/share/icons/hicolor/128x128/apps/CMakeSetup.png
$PREFIX/share/mime/packages/cmakecache.xml
$PREFIX/share/aclocal/cmake.m4
$PREFIX/bin/ccmake
$PREFIX/bin/cmake
$PREFIX/bin/cpack
$PREFIX/bin/ctest
$PREFIX/bin/cmake-gui

So the cmake specfile would likely have to do something special with
the first 5 of these files to avoid clashes, and the final 5
executables would have to be handled using the alternatives mechanism
that is explained in the above URL given to you by Eric.

> Yes, but this cannot be done in rpm spec files for building other packages 
> (as would be done in EPEL).  Perhaps we could leverage environment-modules, 
> but this would be a bit of a departure.

I don't understand this remark. If Fedora has already packaged
multiple non-clashing versions of cmake as above, then surely all you
have to do as a specfile maintainer of a given package that uses a
specific major version of CMake to build the package is to have the
specfile run a script before the build that runs update-alternatives
(or whatever the equivalent name of that Debian application is on
Fedora) to select the major CMake version that is required for the
package build?

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state
implementation for stellar interiors (freeeos.sf.net); the Time
Ephemerides project (timeephem.sf.net); PLplot scientific plotting
software package (plplot.sf.net); the libLASi project
(unifont.org/lasi); the Loads of Linux Links project (loll.sf.net);
and the Linux Brochure Project (lbproject.sf.net).
__________________________

Linux-powered Science
__________________________


More information about the cmake-developers mailing list