wiki:Compile and Install

If all libraries, their header files, and mpif90 on the path to compile and install DOUG run

./autogen # only in case of Git fresh checkout
./configure
make
make install

Git checkout

DOUG is now in  GIT repository. To clone the master branch type

git clone git://dougdevel.org:6894/doug.git

If you have write access to the repository use instead

git clone ssh://git@dougdevel.org/doug.git

Autotools

Run ./autogen.sh in the doug directory. You sometimes need to rerun it only if you develop DOUG code.

Configure

Configuration step detects Fortran compiler, MPI library and other tools. If everything is in standard locations (/usr/lib, /usr/local/include, ...), just run

./configure

or better create new directory doug-bin outside and from that directory run

../doug/configure

This will allow to compile DOUG for different Fortran compilers or with different configuration, like debugging and profiling.

Troubleshooting

config.log is the first and very detailed source of information, e.g. if configure fails to find some library it contains command line used to run the compiler, the source code that failed and the error message from the compiler:

  • As this file is quite long, error can be usually found on 3. or 4. page from the end.
  • Sometimes configure gives wrong hints, e.g. it says to miss library, but it actually cannot run MPI wrapper, so config.log is very helpful in such situations.
  • This file also contains full command line with all parameters that configure script was run with. You may need to add quotes, because those are removed.

Configuration parameters

Most helpful configure parameters are

  • --with-mpi=<MPI installation directory> - root directory that contains bin, lib and include subdirectories with MPI files. It is not needed if MPI was installed to standard /usr or /usr/local directories or mpif90 is on the PATH.
  • --with-umfpack=<UMF build directory> - root directory for UMFPACK tools that contains UFConfig, AMD and UMFPACK subdirectories. It is not needed if all UMFPACK files were installed to standard /usr or /usr/local directories.
  • --disable-shared - building shared libraries fails on some architectures.
  • CPPFLAGS="<C preprocessor flags>" - like -I<mod/h include dir>
  • FCFLAGS="<fortran compiler flags>" - like optimization flags
  • LDFLAGS="<linker flags>" - like -L<library directory>

All parameters can be seen by running ./configure --help.

Examples:

./configure --with-mpi=/usr/local/lam --disable-shared
./configure --with-umfpack=/tmp/olegus/doug LDFLAGS=-L/tmp/olegus/doug/lib 
     --enable-fxdr CPPFLAGS=-I/tmp/olegus/doug/include FCFLAGS="-frecord-marker=4"

Compile

Just run make. :)

The executables are doug_geom and doug_aggr

  • can be found in <builddir>/src/main.
  • If building of shared libraries was not disabled then actual binaries are placed to .libs subdirectories (this is libtool behaviour)
    • The purpose is to be able running application without installing the DOUG library. It is achieved by placing wrapper scripts instead of actual binaries with changed LD_LIBRARY_PATH variable and other tricks.

Issues

Possible problems.

32 vs 64 bit

Input format

  • Integers in data files are 32 bits and default platform integer may be 64 bit. This breaks the formatted reading of input files.

GFortran

GFortran wrong record marker length breaks the formatted reading of input files.

  • add -frecord-marker=4 to FCFLAGS

G95

optional arguments

Must specify FCFLAGS=-fshort-circuit to configure, otherwise fails

Install

Run make install. The files will be installed in /usr/local/lib and /usr/local/bin unless --prefix=<> is specified to configure.

Run make uninstall to remove files.