Next: 3.3 Directory Structure
Up: 3 Program Files, Installation,
Previous: 3.1 Quickstart: How to
  Contents
  Index
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.6)
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 3 and 4.
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
./configure
This gives you a screen output like
Configuration script for CO5BOLD Makefile
=========================================
No parallelization requested, assume default: F90_PARALLEL=scalar
No debugging requested, assume default: F90_DEBUG=0
No LHDrad module requested, assume default: F90_LHDRAD=0
No MSrad module requested, assume default: F90_MSRAD=0
No SHORTrad module requested, assume default: F90_SHORTRAD=1
No dust module requested, assume default: F90_DUST=0
No MHD module requested, assume default: F90_MHD=0
No explicit machine requested, assume default: F90_MACHINE=local
List of control environment variables:
F90_COMPILER =
F90_PREFLAGS =
F90_POSTFLAGS=
F90_PARALLEL = scalar
F90_DEBUG = 0
F90_LHDRAD = 0
F90_MSRAD = 0
F90_SHORTRAD = 1
F90_DUST = 0
F90_MHD = 0
F90_MACHINE = local
-> MACHINE = i686
F90_BASEPATH = /home/bf/for
Linux system with i686 architecture
PGI compiler
version=3.3-2
pgf90 -byteswapio -fast -Mvect=sse -Mcache_align -Minfo=inline
Write compiler name and flags into file compiler_flags.info
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.6) 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.6 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.
export F90_MACHINE=dummy
export F90_PREFLAGS="-Oprettyfast +Qsomethingelse"
./configure
it is possible to specify all machine-dependent settings yourself
(see Sect. 3.6 and Sect. 3.6).
This is useful when dealing with a compiler hitherto unknown to the configure script.
- Start the compilation with
make
to produce the executable rhd.exe
.
A simple sample installation may look like the following
(the sub directory 'for
' is put into the home directory).
# -- Choose base directory --
cd $HOME
# -- Put the tar file there --
# ...
# -- Expand the tar file --
tar -zxvf for.tar.gz
# -- Go into (default) master directory --
cd for/hd/rhd/YOUR_MACHINE
# -- Activate OpenMP und MSrad radiation transport --
export F90_PARALLEL=openmp
export F90_MSRAD=1
# -- Start the configure script --
./configure
# -- Compile --
make
echo 'Voila!'
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.6)
to make the paths to the source files known to the configure script.
That might look like
mkdir SOME_WEIRD_PLACE
cd SOME_WEIRD_PLACE
export F90_BASEPATH=$HOME/for
ln -s $F90_BASEPATH/hd/rhd/conf/configure .
./configure
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.
Next: 3.3 Directory Structure
Up: 3 Program Files, Installation,
Previous: 3.1 Quickstart: How to
  Contents
  Index