Tuesday, January 17, 2012

Compiling CMake 2.8.7 on Solaris 10

Building CMake might fail due to incorrect environment variables.

If you already attempted to compile CMake, delete the directory and start again. It caches its variables for its own build all over the place.

A full Solaris 10 install has everything you need to compile CMake.

I bootstrapped it using as much system libraries as possible and assumed 4 CPUs / cores and set it to install to /usr.

Set up envirnment:
$ PATH=/usr/sfw/bin:/usr/ccs/bin:/usr/bin; export PATH
$ CC=gcc;export CC

Bootstrap:
$ ./bootstrap --parallel=4 --system-libs --no-system-curl --no-system-libarchive --no-system-expat --prefix=/usr

Compile according to Readme.txt:
$ gmake -j4
To install:
Change to root
# gmake install

To package:
$ bin/cpack
The generated package can the be installed as per the instructions on the download page.
The package will only work on other Solaris 10 (and possible newer) system running the same CPU architecture. Solaris 9 misses some of the libraries that it expects to find.

These instructions do not work on Solaris 9, due to the lack of a compiler in the default install. Installing Solaris Studio might work, but was not tested.

Update: I have a prebuilt version available here.

1 comment:

Rafał Wojdyła said...

Thank you very much, you saved some time for me :)