HOWTO cmake compatiblity?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

HOWTO cmake compatiblity?

Steffen Dettmer
Hi,

I like to learn how you use cmake in environments were
reproducibility is an issue.



Background:

We are used to simply install cmake in default $PATH, but I
noticed cmake is not backward-compatible. Of course this is not
surprising, it is really complex with many nice features and of
course things evolve, so this is fine.

As we are supposed to be reproducible (i.e. reproduce old
versions in future), we need a way to maintain compatiblity. So
far we use defined virtual machines, which have to be archived by
each change, and inside install our compiler toolchains in
versionized directories. So far this was simple because we just
put the needed paths into the TOOLCHAINFILE.cmake files (cmake
-DTOOLCHAIN=v1.0.0/target1.cmake -- which internally sets CC to
v1.0.0/gcc-1.2.3/bin/a-b-c-gcc etc). This only works if the
correct cmake version is called of course. To avoid depending on
users PATH (we made bad experiences in the past with that), we
like to have a dedicated way to call cmake.



First thoughs:

So far I think we need to install cmake into a versionized
directory and invoke it:

  v1.0.0/bin/cmake -DTOOLCHAIN=v1.0.0/target1.cmake

and maybe remove cmake from PATH to ensure a failure if
accidentally calling "cmake".

What do you think?

From autotools I know that via alternatives there are things like
"autoconf-1.4" pointing to the appropriate autoconf version. This
seems to be more comfortable to use. Is something like this
possible with cmake?

At least we could install cmake in a versionized directory and
add an appropriate symbolic link into $PATH. What do you think?

cmake internally has mechanisms to find the correct "Modules"
etc, so multiple versions can be installed at the same time
easily. Is there some standard way to select between these multiple
versions?

Any thoughts appreciated,

Steffen
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: HOWTO cmake compatiblity?

Rolf Eike Beer
Steffen Dettmer wrote:

[…]

> So far I think we need to install cmake into a versionized
> directory and invoke it:
>
>   v1.0.0/bin/cmake -DTOOLCHAIN=v1.0.0/target1.cmake
>
> and maybe remove cmake from PATH to ensure a failure if
> accidentally calling "cmake".
>
> What do you think?

Having multiple parallel versions of CMake in different directories
works.

Greetings,

Eike
--
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: HOWTO cmake compatiblity?

Steffen Dettmer
On Mon, Aug 7, 2017 at 3:44 PM, Rolf Eike Beer <[hidden email]> wrote:

> Steffen Dettmer wrote:
>> So far I think we need to install cmake into a versionized
>> directory and invoke it:
>>
>>   v1.0.0/bin/cmake -DTOOLCHAIN=v1.0.0/target1.cmake
>>
>> and maybe remove cmake from PATH to ensure a failure if
>> accidentally calling "cmake".
>>
>> What do you think?
>
> Having multiple parallel versions of CMake in different directories works.

Yes, it definetly works, I tested with 3.0.2 and 3.6.2.

My question is how it is intended to be used, what works best.

Steffen
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: HOWTO cmake compatiblity?

Steffen Dettmer
Hi,

> > > So far I think we need to install cmake into a versionized
> > > directory and invoke it:

I tested with versionized directory and it works really well. For
example when having a symlink

  /opt/toolchain/1.0.0/bin/cmake -> /opt/cmake/3.6.2/bin/cmake

it can be used as:

  $ export PATH=/opt/toolchain/1.0.0/bin/:$PATH
  $ cmake -DCMAKE_TOOLCHAIN_FILE=/opt/toolchain/1.0.0/targets/t1.cmake

Very nice is that then generated files do not depend on PATH,
i.e. when make calls cmake, it calls the initially used cmake by
using the (resolved) full path, in the example /opt/cmake/3.6.2/bin/cmake.

When calling with full path:

  $ /opt/toolchain/1.0.0/bin/cmake \
    -DCMAKE_TOOLCHAIN_FILE=/opt/toolchain/1.0.0/targets/t2.cmake

this full path is used (as it is). Also the correct ctest is
executed by make test.

This is just great, exactly what we need.

Steffen
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Loading...