How to compile MADCAP on an SGI Origin 200/2000

Before you read this page, see my main MADCAP page for prerequisites.

I have tested this setup on a 4-processor Origin 200. This should also work for an Origin 2000 which has the same type of architecture.

The machine I tested this on was running IRIX 6.5.13m. It also has:

MPT and SCSL can be downloaded from SGI free of charge. Before downloading them, check if they are installed with the commands:

> showprods mpi
> showprods scsl

Compiling MPIBLACS

Unpack mpiblacs.tgz and the patch mpiblacs-patch03.tgz and move into the BLACS directory:

> gzip -dc mpiblacs.tgz | tar -xvf -
> gzip -dc mpiblacs-patch03.tgz | tar -xvf -
> cd BLACS

Copy the Origin 2000 include file to the current directory:

> cp BMAKES/Bmake.MPI-O2K Bmake.inc

Edit Bmake.inc to reflect your setup. If you want to use n32-bit libraries then change the following entries to:

F77NO_OPTFLAGS = -n32
CCFLAGS        = -O2 -n32
Otherwise, if you want to use 64-bit libraries change them to:
F77NO_OPTFLAGS = -64
CCFLAGS        = -O2 -64
If in doubt about this, ask your system manager. Alternatively, omit the -n32 or -64 flag to use the system default.

Make the libraries:

> make mpi

Copy the libraries to so that they are named something a bit more useful:

> cd LIB
> cp blacs_MPI-IRIX64-0.a libblacsmpi.a
> cp blacsCinit_MPI-IRIX64-0.a libcblacsmpi.a
> cp blacsF77init_MPI-IRIX64-0.a libfblacsmpi.a

Move the libraries to a suitable library directory, hereinafter referred to as LIBDIR (for example, use a subdirectory of your home directory ~/lib):

> mkdir LIBDIR
> mv *.a LIBDIR
> cd ../..

Compiling SCALAPACK

Unpack scalapack.tgz and move into the SCALAPACK directory:

> gzip -dc scalapack.tgz | tar -xvf -
> cd SCALAPACK

Copy the IRIX64 include file to the current directory

> cp INSTALL/SLmake.IRIX64 SLmake.inc

Edit SLmake.inc to reflect your setup. If you want a n32-bit library the change the following line to:

NOOPT = -n32
or for a 64-bit library change it to:
NOOPT = -64
or omit the flag for the system default.

Make the library (meanwhile, go and have a cup of tea):

> make

Copy the library to LIBDIR:

> cp libscalapack.a LIBDIR
> cd ..

Compiling MADCAP

Make a directory for madcap and unpack the madcap2.0.tar.gz in it:

> mkdir madcap
> cd madcap
> gzip -dc ../madcap2.0.tar.gz | tar -xvf -

Firstly compile madtool.c:

> cc -DO2K -c madtool.c

The .c files in the QUAD directory need a bit of editing. In each, change the line

#include "madcap.h"
to
#include "../madcap.h"

Next, change to both of the sub-directories MAP and QUAD in turn, and compile each of the .c files as follows. The MADCAP scripts expect the names of executables to end in .x. For example, qq.c:

> cc -DO2K -c qq.c 
> f77 -o qq.x qq.o ../madtool.o -LLIBDIR -lscalapack -lblacsmpi \
    -lcblacsmpi -lblacsmpi -lscs -lmpi
Note that -lblacsmpi appears twice (for some mysterious reason this is only needed by some of the programs). You may need to add the -n32 or -64 flag to these lines as you did in compiling MPIBLACS and SCALAPACK.

MADCAP Scripts

The script files MAP/map_bug, MAP/map_bat, QUAD/quad_bug and QUAD/quad_bat need some changes. Change the variables for the directories so the scripts know the location of the MADCAP programs and your data.

Change the line

setenv MADRUN "mpprun -n $NO_PE"
to
setenv MADRUN "mpirun -np $NO_PE"
Remember also to change the line
setenv NO_PE 25
to reflect the number of processors you are going to use!


[ Notes | Home ]