next up previous contents index
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:

  1. 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.)

  2. 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 Tab. 3. See the Readme file 'for/README'.

  3. Change with
      cd for/hd/rhd
    into the main directory.

  4. 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
    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

  5. 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 .

  6. Start the configure script to create the (first version of the) Makefile
    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_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

    pgf90 -byteswapio -fast -Mvect=sse -Mcache_align -Minfo=inline

    Write compiler name and flags into file

    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 '' is written which contains the compiler call in Fortran format.

  7. 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.

  8. 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!

  9. Start the compilation with
    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 --

# -- Compile --

echo 'Voila!'

next up previous contents index
Next: 3.3 Directory Structure Up: 3 Program Files, Installation, Previous: 3.1 Quickstart: How to   Contents   Index