How to Configure COOLFluiD
Here we explain how to use a script to simplify the process of configuring COOLFluiD for compilation. COOLFluiD uses cmake to configure the build process. This would imply passing many parameters by hand to cmake. To automate this process we use a configuration file and the a script to do the job.
The script
The whole process is done with the script prepare.pl which comes with the COOLFluiD sources, so there is no need to get the script from anywhere (as opposed to previous versions).
Setting up your configuration
The compilation setup placed in a configuration file, usually named coolfluid.conf. (Can be named otherwise).
1. You should start by copying the file coolfluid.conf.example, which is also bundled with the sources, from the tools/conf directory to the directory from where you are going run the script. This directory can be any one, but we advise you to use the one holding the sources which you want to compile. It will allow you to keep track which configuration options goes with which sources.
cd $HOME/workspace/COOLFluiD cp tools/conf/coolfluid.conf.example coolfluid.conf
2. Edit coolfluid.conf and place there the settings correct for your compilation environment. These should be the correct locations for the library dependencies and compilation flags.
This file is a equal separated file, which should have the form VARIABLE = VALUE, and comments start with the character '#':
Example:
# this is a comment mpi_dir = /home/user/local/i686/ hdf5_dir = /home/user/local/i686/ trilinos_dir = /home/user/local/i686/local/trilinos
You can add several build profiles by prepending each variable with the name of the build you want.
# general purpose cc = mpicc cxx = mpic++ fc = gfortran cflags = -O2 cxxflags = -O2 fflags = -O2 # for optim build optim_cxxflags = -O3 # for mypentium build mypentium_cxxflags = -O3 --march=pentium4
Note 1: there is also a file coolfluid.conf.vki that can be used for the internal VKI machines without need for tuning.
Note 2: In your setup you can add the variables $HOME, $USER and $ARCH and the script will automatically substitute them for your home directory, your user name and the architecture of the computer.
Running the script
You may run the script from whatever place as long as there is one coolfluid.conf file in that directory.
We suggest you to place the coolfluid.conf file into the directory where you have the sources of COOLFluiD.
Then you may do:
$> cd $HOME/workspace/COOLFluiD $> ./prepare.pl --build=optim
Testing your configuration
If you want to test your configuration without actually running through the configuration process, you may add the dryrun option:
$> ./prepare.pl --build=optim --dryrun
