University of Cambridge Home Physics Dept Home TCM Group Home
BACK

+ + +

[Valid HTML 4.01!]

CASTEP 4.4 and TCM

ajm

Hydrogen in Silicon

This page is here to aid those wanting to install CASTEP 4.4 in TCM. I was helped by Drs Rutter and Hasnip and I take no credit in the sucess. I'm writing this HOW-TO, so they don't have to.

Acknowledgements:

Michael Rutter

Phil Hasnip

Obtain CASTEP-4.4.tar.gz and CASTEP-4.4-bugfixes-XX-XXX-20XX.tar.gz from Michael, or ask me where they can be found. Unpack these where you want to install CASTEP, I would suggest /rscratch, there's no point filling up your /home directory with object files, (for fastest compiles, use on the /scratch of the machine you're compiling on.)

$ tar -xzf CASTEP-4.4.tar.gz
$ tar -xzf CASTEP-4.4-bugfixes-XX-XXX-20XX.tar.gz

Copy the bugfixes to the source file,

$ cp -r Source/ CASTEP-4.4/Source/
$ cd CASTEP-4.4

Making in Serial for the PCs

Open up the Makefile and set

COMMS_ARCH := serial
FFT := default
BUILD := fast

Then use the MJR hack

MATHLIBS := Hands_Off
MATH_LIBS := -lmkl -lguide -lpthread
export MATH_LIBS

Save and exit. Now use gmake, (not make), to make the binary. Make is currently version 3.80 in TCM, which is incompatible with the CASTEP build system which requires Make 3.81.

CASTEP-4.4/$ gmake

...write a short novel or have a 3 course meal...

Now copy the resulting binary to somewhere sensible.

CASTEP-4.4/$ cp obj/linux_x86_64_ifort10/castep ~/bin/castep64s

Making with MPI for the PCs

Clear up the mess from making the serial version,

CASTEP-4.4/$ gmake clean

Change the communications architecture to MPI, (leaving the other flags as hacked above),

COMMS_ARCH := mpi

Now compile telling gmake the correct mpi wrapper to use for ifort10

CASTEP-4.4/$ gmake F90=mpifort

...write the next in the series of novels or peg a rug...

Copy the resulting binary to somewhere sensible.

CASTEP-4.4/$ cp obj/linux_x86_64_ifort10/castep ~/bin/castep64p

Making with MPI for tcmc1

This build will use fftw3 as I've installed it on tcmc1. This version does not need the MJR hack, hence the Makefile flags should be,

COMMS_ARCH := mpi
FFT := fftw3
BUILD := fast
MATHLIBS := mkl

When prompted, the directory for fftw3 is

/usr/local/shared/lib

And you can press enter for the mkl library directory, as it is in the default place,

...write the third in the trilogy, or learn to juggle...

Copy the resulting binary to somewhere sensible.

CASTEP-4.4/$ cp obj/linux_ia32_ifort10/castep ~/bin/castep32p_4.4

Making with MPI for Darwin

This build will use fftw3 and gotoBLAS as they're both available.

You may decide you want to use ifort version 10 (instead of the default version 9), in this case

$ module load intel/fce/10.1.015

You may also decide to add this to your ./bashrc for future use

This version does not need the MJR hack, hence the Makefile flags should be,

COMMS_ARCH := mpi
FFT := fftw3
BUILD := fast
MATHLIBS := goto

Darwin's default make version is 3.81, so we can just

CASTEP-4.4/$ make

When prompted, the directory for fftw3 is

/usr/local/Cluster-Apps/fftw/intel/64/3.2/lib

When prompted, the directory for BLAS is

/usr/local/Cluster-Apps/gotoblas/intel/64/1.19/lib

Remember to set,

export GOTO_NUM_THREADS=1

in your CASTEP runscripts or .bashrc.

FFTW3

I'm lead to beleive that The Fastest Fourier Transfoms in the West 3 are better than the default ones. (As the name might suggest) If you have fftw3 libraries - which you'll have to make yourself in TCM- or link to mine. It's worth changing the makefile to,

FFT := fftw3

and telling it where the libraries (libfftw3.a libfftw3.la) can be found when it asks. Note that it doens't like ~ (tildes) in the library path.

FFTW3 libraries are available on Dawrin and tcmc1.

gotoBLAS

gotoBLAS is also apparently a speed-up over the mkl. However, I haven't any experience of it at the moment in TCM. Remember to set the environment variable GOTO_NUM_THREADS=1 when running CASTEP in parallel.

Making make3.81

If you come accross a system without make 3.81, it's relativly easy to make yourself, see below.

The source can be downloaded from here. It should be unpacked somewhere sensible, such as /rscratch.

$ tar -xzf make-3.81.tar.gz

Then the make needs configuring

$ cd make-3.81
make-3.81/$ ./configure

Finally, we need to make make. (If you don't have a previous version of make, you can use ./build.sh.) On Darwin you should be fine to type,

make-3.81/$ make

this should be compiled quite quickly. You now must put the new make into a directory on your path, such as ~/bin. However, it's probably best to give it a different name

make-3.81/$ cp make ~/bin/make3.81