CP2k install howto

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
EDit 07/13: if you can, you should substitute AMD’s ACML or Intel’s MKL (depending on your machine of course) for the Lapack/ATLAS steps below. Back when I wrote this there was no academic version of MKL…


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

2 comments

  1. Deepthi Jose

    Dear sir,
    I am Deepthi Jose, a research student. I was trying to install cp2k following the instructions given above. I could install g95, lapack and fftw3. But i am getting an errorr while compiling ATLAS. Can u please help me.

    deepthi@iiser-46:~/ATLAS/myobj$ /home/deepthi/ATLAS/configure -C if /bin/g95 –with-netlib-lapack-tarfile=/home/deepthi/lapack.tgz -b 32
    make: `xconfig’ is up to date.
    ./xconfig -d s /home/deepthi/ATLAS/ -d b /home/deepthi/ATLAS/myobj -C if /bin/g95 -Si lapackref 1 -b 32
    atlconf_misc.o: In function `CmndResults’:
    /home/deepthi/ATLAS//CONFIG/src/atlconf_misc.c:306: warning: the use of `tmpnam’ is dangerous, better use `mkstemp’

    OS configured as Linux (1)
    atlconf_misc.o: In function `CmndResults’:
    /home/deepthi/ATLAS//CONFIG/src/atlconf_misc.c:306: warning: the use of `tmpnam’ is dangerous, better use `mkstemp’

    Assembly configured as GAS_x8632 (1)
    atlconf_misc.o: In function `CmndResults’:
    /home/deepthi/ATLAS//CONFIG/src/atlconf_misc.c:306: warning: the use of `tmpnam’ is dangerous, better use `mkstemp’

    Vector ISA Extension configured as SSE3 (2,28)
    atlconf_misc.o: In function `CmndResults’:
    /home/deepthi/ATLAS//CONFIG/src/atlconf_misc.c:306: warning: the use of `tmpnam’ is dangerous, better use `mkstemp’

    Architecture configured as Core2 (15)
    atlconf_misc_BE.o: In function `CmndResults’:
    /home/deepthi/ATLAS//CONFIG/src/atlconf_misc.c:306: warning: the use of `tmpnam’ is dangerous, better use `mkstemp’

    Clock rate configured as 3000Mhz

    Maximum number of threads configured as 2
    atlconf_misc.o: In function `CmndResults’:
    /home/deepthi/ATLAS//CONFIG/src/atlconf_misc.c:306: warning: the use of `tmpnam’ is dangerous, better use `mkstemp’
    Parallel make command configured as ‘$(MAKE) -j 2′
    Cannot detect CPU throttling.
    gcc -I/home/deepthi/ATLAS//CONFIG/include -g -w -c /home/deepthi/ATLAS//CONFIG/src/probe_comp.c
    gcc -I/home/deepthi/ATLAS//CONFIG/include -g -w -o xprobe_comp probe_comp.o atlconf_misc.o
    atlconf_misc.o: In function `CmndResults’:
    /home/deepthi/ATLAS//CONFIG/src/atlconf_misc.c:306: warning: the use of `tmpnam’ is dangerous, better use `mkstemp’
    rm -f config1.out
    make atlas_run atldir=/home/deepthi/ATLAS/myobj exe=xprobe_comp args=”-v 0 -o atlconf.txt -O 1 -A 15 -Si nof77 0 -C if ‘/bin/g95′ -b 32″ \
    redir=config1.out
    make[1]: Entering directory `/home/deepthi/ATLAS/myobj’
    cd /home/deepthi/ATLAS/myobj ; ./xprobe_comp -v 0 -o atlconf.txt -O 1 -A 15 -Si nof77 0 -C if ‘/bin/g95’ -b 32 > config1.out
    UNKNOWN COMPILER ‘/bin/g95′ for F77: you must also supply flags!
    make[1]: *** [atlas_run] Error 7
    make[1]: Leaving directory `/home/deepthi/ATLAS/myobj’
    make: *** [IRun_comp] Error 2
    xconfig: /home/deepthi/ATLAS//CONFIG/src/config.c:125: ProbeComp: Assertion `!system(ln)’ failed.
    Aborted
    xconfig exited with 134

  2. bbrouwer

    So sorry for the delay! I need to check the blog more often 🙂 going back through your output, it looks like /bin/g95 doesn’t exist, did you create a symbolic link from your install location?

Leave a comment