CP2k install howto

April 8, 2009

There is the possibility that I’ll be using CP2k in the near future, so I’ve been getting better acquainted. By all accounts this is a distribution that makes you work for its love, which is fine b/c I’m not needy. It also represents a new domain for me, mixed Gaussian/plane waves and molecular dynamics, I look forward to what it can do. In the meantime, Lady and Gentleman, I give you 5 READMEs and 7 hours later the complete steps for a full install on a fresh Linux i686 OS


0.0 Get Coffee

1.0 Install g95:

# wget -O – http://ftp.g95.org/g95-x86-linux.tgz | tar xvfz -

//check g95-install/bin for binary name, make symbolic link, eg.,

# ln -s /root/g95-install/bin/i686-unknown-linux-gnu-g95 /bin/g95

2.0 Install Lapack:

# wget -O – http://www.netlib.org/lapack/lapack.tgz | tar xvfz -

# cd lap*

//cp & edit the make.inc file to use g95 (edit FORTRAN & LOADER lines)

# cp make.inc.example make.inc
# vim make.inc

//make

# make lib

2.1 Lunch

3.0 Install & run ATLAS:

//get file from sourceforge & gunzip etc, cd into ATLAS,
//make a dir

# mkdir MyObj
# cd MyObj

//run configure specifying compiler and path to LAPACK eg.,

# /root/ATLAS/configure -C if /bin/g95 –with-netlib-lapack=/root/lapack-3.2/lapack_LINUX.a

//run all variants of make (will take quite a while :) )

# make
# make check
# make ptcheck
# make time
# make install

3.1 Coffee

4. Install FFTW3:

# wget -O – ftp://ftp.fftw.org/pub/fftw/fftw-3.2.1.tar.gz | tar xvfz -
# cd fft*
# ./configure
# make
# make install

5. Install cp2k

//download eg., via cvs:

# cvs -d :pserver:anonymous@cvs.cp2k.berlios.de:/cvsroot/cp2k co cp2k

// cd into cp2k/arch, create/edit arch file, eg., for Linux 686 w/ g95, serial;

# cp Linux-i686-g95.sopt foo.sopt

// edit with vim, making sure order of libraries is lapack/blas/cblas/atlas:

LIBS = /usr/local/atlas/lib/liblapack.a /usr/local/atlas/lib/libf77blas.a /
usr/local/atlas/lib/libcblas.a /usr/local/atlas/lib/libatlas.a

// cd into cp2k/makefiles,

# make ARCH=foo VERSION=sopt
# make install

// if build succesful, should have executable in ~/cp2k/exe/foo, make link eg.,

# ln -s /root/cp2k/exe/foo/cp2k.sopt /bin/cp2k

5.1 Dinner

5.2 Coffee

6. Watch tv for a bit

7. Edit & run ~cp2k/tools/do_regtest in future


Norm Conserving Pseudopotentials I

January 14, 2009

Excellent description by Eberhard Engel here

I’m in the process of trying to create a large number of NCPP’s for the calculation of magnetic properties, using GIPAW. The end goal is to try, in conjunction with machine learning and NMR, to do structure determination for complicated materials.

This is somewhat related to the work presented at M’soft eScience, with the slightly different goal of going from a large database of calculated values, and via clustering and comparison to NMR simulations, back-out chemical structures.

ml_mqmas


Glorious Gawk part I

January 10, 2009

It’s frequently helpful to eyeball a structure while going through iterations of ab initio, sometimes even building up animation for a dynamic calculation. One very simple way without going through a more intensive application is to parse a structure file with Gawk/Awk, to create input for POVray which is then easily rendered. Example follows, simply change expressions /foo/ and fields $ to suit your file…

ED: POVray uses a left-handed system


#script to write povray code from co-ordinates

BEGIN{print “\#include \”colors.inc\”\n \
\#include \”textures.inc\”\n \
\camera \{ \n \ location \<-2,18,-5\>\n \
look_at \<-2, 0,-5\>\n \ angle 45 \n \
\} \n \ plane \{ \n \
y, -100 \n \ texture \{ \n \
pigment \{ \n \ color rgb\<1, 1, 1\>\n \
\} \n \ finish \{ \n \
diffuse 0.4 \n \ ambient 2 \n \
phong 0 \n \ phong_size 0 \n \
reflection 0 \n \ \}\}\} \n \

\#declare a=8.7\; \n \ \#declare c=9.0\; \n \
\#declare Green = texture\{ \n \
pigment \{ color rgb\<0.2, 0.8, 0.2\>\} \n \
finish \{ambient 0.7 diffuse 0.5 reflection 0.01\} \n \
\} \n \
\#declare Blue = texture\{ \n \
pigment \{ color rgb\<0.2, 0.2, 0.8\>\} \n \
finish \{ambient 0.7 diffuse 0.5 reflection 0.01\} \n \
\} \n \
\#declare Yellow = texture\{ \n \
pigment \{ color Yellow\} \n \
finish \{ambient 0.7 diffuse 0.5 reflection 0.01\} \n \
\} \n \
\#declare Red = texture\{ \n \
pigment \{ color rgb\<0.8, 0.2, 0.2\>\} \n \
finish \{ambient 0.7 diffuse 0.5 reflection 0.01\} \n \
\}” > “scsul.pov”};

/S1/{print “\n sphere\{\< “$7″ , “$9″ , “$8″ \>, 0.15 \n \
texture \{Yellow\}\n \\}\n” > “scsul.pov”};

/Sc/{print “\n sphere\{\< “$7″ , “$9″ , “$8″ \>, 0.3 \n \
texture \{Green\}\n \
\}\n” > “scsul.pov”};

/O/{print “\n sphere\{\< “$7″ , “$9″ , “$8″ \>, 0.6 \n \
texture \{Red\}\n \
\}\n” > “scsul.pov”};

END{ print “light_source \{ \<5, 40, 5\> \n \
color White \}” > “scsul.pov”};


Microsoft eScience presentation 12/08/08

December 18, 2008