[CP2K:1033] Re: cp2k.popt and g95

Luca bellu... at unisi.it
Tue May 13 09:32:32 UTC 2008


...and makefile
> On Tuesday 13 May 2008 11:25:22 Luca wrote:
> > 
> > Hi all,
> > after having had some problems with the intel fortran compiler, I decided to compile cp2k with g95.  
> > I found some  difficulties to compile the parallel version of cp2k with g95.  
> > I wrote some notes for myself and I posted them in the group mailing list.  
> > This is what you need:
> > 
> > Stable version 0.91, March 2008 g95 compiler:  http://www.g95.org/
> > mpich2-1.0.7 :       http://www.mcs.anl.gov/research/projects/mpich2/
> > Lapack   version 3.1.1 :       http://www.netlib.org/lapack/
> > scalapack version 1.8.0 :    http://www.netlib.org/scalapack/
> > mpiblacs and mpiblacs-patch03 :  http://www.netlib.org/blacs/
> > 
> > Follow a brief howto. 
> > 1-Install G95.
> > 2-MPICH2:
> > in /usr/local/mpich2-1.0.7
> > set F90 an F77 environment variables. 
> > From bash shell:
> >  # su root
> >  #  F77='g95 -ffixed-form -fno-second-underscore'
> >  #  F90='g95 -ffree-form -fno-second-underscore'
> >  #  export F90 F77
> > check with:
> >  # echo $F77 $F90
> > Configure MPI for your system  
> > For SMP system with shared memory (i.e. dual or quad core) you can use:
> >  #./configure --with-device=ch3:shm 
> >  # make 
> >  # make install
> > 
> > 3-BLAS LAPACK
> > in /usr/local/lapack-3.1.1
> > Edit make.inc like this:
> > .....
> > PLAT = _G95
> > FORTRAN  = g95 
> > OPTS     = -O2                   # -O3 optimization does not work
> > DRVOPTS  = $(OPTS)
> > NOOPT    = -ffloat-store   #  It is necessary
> > LOADER   = g95
> > ......
> > # make blaslib
> > # make lapacklib
> > 
> > 4-BLACS
> > mpiblacs.tgz and mpiblacs-patch03.tgz   PATCH!!!
> > Edit and modify Bmake.inc in  /usr/local/....yourpath../BLACS
> > Set the top level BLACS directory.
> >  ......
> >  INTFACE = -DAdd_
> >  TRANSCOMM = -DCSameF77 -DPOINTER_64_BITS=1 -DUseMpi2
> >  .......
> >    F77            = g95
> >    F77NO_OPTFLAGS = -fno-second-underscore
> >    F77FLAGS       = $(F77NO_OPTFLAGS) -O2 
> >    F77LOADER      = $(F77)
> > cd ....../BLACS/SRC/MPI and make
> > # make
> > 
> > 5-SCALAPACK
> > Edit and modify SLmake.in in /usr/local/...yourpath../sclapack-1.8.0
> > Set the top level directory and path for blacs library.
> > ............
> >  F77           = g95 
> >  CC            = gcc
> >  NOOPT         =  -fno-second-underscore
> >  F77FLAGS      = $(NOOPT) -O2 
> >  CCFLAGS       = -O2 
> >  SRCFLAG       =
> >  F77LOADER     = $(F77)
> >  CCLOADER      = $(CC)
> >  F77LOADFLAGS  = -i-static
> >  CCLOADFLAGS   =
> >  CDEFS         =-DAdd_  $(USEMPI)
> > ........
> > In ./sclapack-1.8.0 compile library with 
> > # make 
> > 
> > In attach there are makefile for cp2k, Bmake.inc for the BLACS library and SLmake.inc 
> > for the scalapack library. Please pay attention, all paths directory are for my system....
> > Any suggestions or improvements are well accepted.
> > ...thanks Fabiana for reviews :-)
> > Luca
> > 
> > > 
> > 
> 
> 
> 
> > 
> 


-------------- next part --------------

CC       = cc
CPP      = 
FC       = mpif90 
LD       = mpif90 


AR       = ar -r
DFLAGS   = -D__G95 -D__FFTSG -D__parallel -D__BLACS -D__SCALAPACK  -D__FFTW3 -traditional
CPPFLAGS = 
FCFLAGS  = $(DFLAGS) -ffree-form -O3 -ffast-math -funroll-all-loops -march=nocona -cpp

G95_LIB  = /usr/local/LIBSC-G95
LL       = /usr/local/LIB-Lapack/
LIBS     = $(G95_LIB)/libscalapack.a \
           $(G95_LIB)/blacsCinit_MPI-G95-0.a \
           $(G95_LIB)/blacsF77init_MPI-G95-0.a \
           $(G95_LIB)/blacs_MPI-G95-0.a \
           /usr/local/mpich2-1.0.7/lib/libmpich.a \
           $(LL)/lapack_G95.a $(LL)/blas_G95.a /usr/lib/libfftw3.a 
           
          
OBJECTS_ARCHITECTURE = machine_g95.o
-------------- next part --------------
CC       = cc
CPP      = cpp

FC       = g95 
LD       = g95

AR       = ar -r

CPPFLAGS = -C -D__G95 -D__FFTSG -D_LAPACK -D__FFTW3 -traditional 
FCFLAGS  = -cpp -O2 -ffast-math -funroll-all-loops -march=nocona
LDFLAGS  = $(FCFLAGS)

LG95     = /usr/local/LIB-Lapack
LIBS     = $(LG95)/lapack_G95.a $(LG95)/blas_G95.a /usr/lib/libfftw3.a -lpthread

OBJECTS_ARCHITECTURE = machine_g95.o




More information about the CP2K-user mailing list