3.2 Compilation Procedure for CO5BOLD

The installation procedure has changed significantly since the last release:
now, there is a configure script (see Sect. 3.5)
that creates the complete (temporary) makefile which can be used to
compile CO5BOLD and produce
the executable rhd.exe.

Installation procedure:

Choose/create a proper base directory.
(This will usually be $HOME.
Then the master directory will typically be $HOME/for -
this is the default created by the tar file.
Some prefer to rename it to $HOME/HYDRO.)

Put all source files and the configure script there.
This will be done typically by expanding the gzipped tar file for.tar.gz
e.g. with

tar -zxvf for.tar.gz

(or by copying all files from an existing installation).
On a restricted UNIX you might be forced to use

gunzip for.tar.gz
tar -xvf for.tar

instead.
Unpacking the tar file creates a sub directory for in the local directory
(and possible overwrites existing files!).
You get sub sub directories as described in Sect. 3.3
and files as listed in Tables 2 and 3.
See the Readme file 'for/README'.

Change with

cd for/hd/rhd

into the main directory.

Look at the existing sub directories, e.g. with

ls -og | grep "^d"

to see if you find one that fits your machine. The directory

for/hd/rhd/conf

should not be used. It contains only the configure script. But any other
directory will do.
If you don't like any of the existing directories, create your own e.g. with

mkdir YOUR_MACHINE

Change into this directory with

cd YOUR_MACHINE

Check if there is a configure script or a link to it with

ls -og configure

which should give something like

lrwxrwxrwx 1 17 2002-12-04 17:39 configure -> ../conf/configure

If it is not there, create the link with

ln -s ../conf/configure .

Start the configure script to create the (first version of the) Makefile

Makefile already exists. It is appended to Makefile_old.
New Makefile written..........................................

A new 'Makefile' is produced. An existing one is appended to 'Makefile_old'.
Additionally, the file 'compiler_flags.info' is written which contains the
compiler call in Fortran format.

Check the output of the configure script and the header of the new Makefile.
You get an overview over the relevant environment variables that control the
configure script (see Sect. 3.5) with

env | grep F90_

Obs: at the beginning there might be none.

Look into the header (and if necessary the rest) of the configure script
or into Sect. 3.5 to
find out how to change the environment variables to control the script
properly. For instance, if you want to enable debugging options, type:

export F90_DEBUG=1

Restart the configure script after every change in the control variables!
With e.g.

If you want to compile in a directory in a completely different place
(not in a sub directory of for as described above),
you have to set the environment variable
F90_BASEPATH
(see Sect. 3.5)
to make the paths to the source files known to the configure script.
That might look like

The variable F90_BASEPATH also has to be set explicitely
if the main directory for should have another name.
Renaming the sub-directories with the source files is not
a good idea - it requires modifications of the configure script itself.