[CMake] module and cmake

Paul Anton Letnes paul.anton.letnes at gmail.com
Sat May 19 08:32:12 EDT 2012


Hi all.

I am currently trying to create a more tidy CMakeLists.txt script for
a simulation code I'm working on. The target platforms are mac and
linux desktops (for development) and HPC [0] servers (all linux or, in
some hypothetical future, unix systems). On HPC servers, it is very
common to install software in "modules". I am not sure how well
aquainted the CMake crowd is with the module system [1] so I'll post a
brief explanation.

HPC servers often have a large amount of users with varying
requirements. Therefore, it is common to require, say, two different
versions of a library, or the same library for two different
compilers. As an example, a machine I'm currently using has several
modules for the FFTW library. Example:
paulanto at rocks:~/Rayleigh2D $ module avail fftw
fftw/2.1.5          fftw/3.2.2(default)
So, there's two different fftw versions available, and I'm currently
using the default one as such:
paulanto at rocks:~/Rayleigh2D $ module load fftw
paulanto at rocks:~/Rayleigh2D $ module list
Currently Loaded Modulefiles:
  1) fftw/3.2.2
There we go. Now what does it mean to load a module? Well, basically,
the "module" command works by adjusting environment variables:


[0] High Performance Computing
[1] http://modules.sourceforge.net/


More information about the CMake mailing list