How to compile VASP: Difference between revisions

From Micro and Nano Mechanics Group
Jump to navigation Jump to search
No edit summary
No edit summary
Line 3: Line 3:
In general we follow the instructions given in http://cms.mpi.univie.ac.at/vasp/vasp/node16.html
In general we follow the instructions given in http://cms.mpi.univie.ac.at/vasp/vasp/node16.html


First, go to vasp.4.lib/ directory copy the following file <tt>makefile.su-ahpcrc</tt> to <tt>makefile</tt> and then type
First, go to vasp.4.lib/ directory, copy the [[media:vasp.4.lib_makefile.su-ahpcrc.txt‎ | vasp.4.lib/makefile.su-ahpcrc]] file to <tt>makefile</tt> and then type


make
make


Next, go to vasp.4.6/ directory, copy the [[media:vasp.4.6_makefile.su-ahpcrc.txt‎ | vasp.4.6/makefile.su-ahpcrc]] file to <tt>makefile</tt> and then type
Notice that in this makefile, we use the <tt>mpif90</tt> compiler.

Next, go to vasp.4.6/ directory copy file <tt>makefile.su-ahpcrc</tt> to <tt>makefile</tt> and then type


make
make


Notice that in both cases, we use the <tt>mpif90</tt> compiler.

Here is the [[media:vasp.4.lib_makefile.su-ahpcrc.txt‎ | vasp.4.lib/makefile.su-ahpcrc]] file.

<tt>vasp.4.lib/makefile.su-ahpcrc</tt> file.

<pre>
.SUFFIXES: .inc .f .F
#-----------------------------------------------------------------------
# Makefile for mpif90 compiler
# This makefile has not been tested by the vasp crew.
# It is supplied as is.
#-----------------------------------------------------------------------

# C-preprocessor
CPP = gcc -E -P -C $*.F >$*.f
FC=mpif90

CFLAGS = -O
FFLAGS = -O1
FREE = -ffree-form
LINK = -L/usr/lib -lgfortran
DOBJ = preclib.o timing_.o derrf_.o dclock_.o diolib.o dlexlib.o drdatab.o


#-----------------------------------------------------------------------
# general rules
#-----------------------------------------------------------------------

libdmy.a: $(DOBJ) lapack_double.o linpack_double.o lapack_atlas.o
-rm libdmy.a
ar vq libdmy.a $(DOBJ)

# files which do not require autodouble
lapack_double.o: lapack_double.f
$(FC) $(FFLAGS) $(NOFREE) -c lapack_double.f
lapack_single.o: lapack_single.f
$(FC) $(FFLAGS) $(NOFREE) $(LINK) -c lapack_single.f
lapack_atlas.o: lapack_atlas.f
$(FC) $(FFLAGS) $(NOFREE) $(LINK) -c lapack_atlas.f
linpack_double.o: linpack_double.f
$(FC) $(FFLAGS) $(NOFREE) $(LINK) -c linpack_double.f
linpack_single.o: linpack_single.f
$(FC) $(FFLAGS) $(NOFREE) $(LINK) -c linpack_single.f

.c.o:
$(CC) $(CFLAGS) -c $*.c
.F.o:
$(CPP)
$(FC) $(FFLAGS) $(FREE) $(INCS) -c $*.f
.F.f:
$(CPP)
.f.o:
$(FC) $(FFLAGS) $(FREE) $(INCS) -c $*.f
</pre>


Here is the <tt>vasp.4.6/makefile.su-ahpcrc</tt> file.
<pre>


</pre>

Revision as of 21:58, 19 September 2008

In this document, we describe how to compile VASP program on su-ahpcrc.stanford.edu (Linux 64-bit parallel cluster).

In general we follow the instructions given in http://cms.mpi.univie.ac.at/vasp/vasp/node16.html

First, go to vasp.4.lib/ directory, copy the vasp.4.lib/makefile.su-ahpcrc file to makefile and then type

make

Next, go to vasp.4.6/ directory, copy the vasp.4.6/makefile.su-ahpcrc file to makefile and then type

make

Notice that in both cases, we use the mpif90 compiler.