how to install BerkeleyGW

Submitted by mhammouri on Fri, 02/05/2016 - 20:50

Forums 

Installation

Hi all,
I need to install BerkeleyGW on SUSE Linux, but I do not know how to do so, these are my machine properties:

Linux version 3.1.10-1.9-desktop (geeko@buildhost) (gcc version 4.6.2 (SUSE Linux) ) #1 SMP PREEMPT
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
Vendor ID: AuthenticAMD
CPU family: 21

Thank You in Advance!

hammouri

Submitted by dyq on Tue, 02/09/2016 - 16:50

Hi Hammouri,

Have you tried adapting the generic linux makefiles provided with the BerkeleyGW source code? There are a number of generic makefiles for Linux in the config/ directory. In the header of each file, there are instructions for obtaining other packages required for BerkeleyGW.

Submitted by mhammouri on Wed, 02/10/2016 - 16:12

thank you for ur reply,
I dont see anything related to SUSE Linux, which one do u think is close to my machine? I have a little experience with such things.

Submitted by mhammouri on Tue, 03/15/2016 - 19:35

Thank you Felipe, Lucas, and Diana for your help.
I have tried this but got an error:
1) cp config/generic.mpi.linux.mk arch.mk
2) cp flavor_real.mk flavor.mk
3) make -j all-flavors

make[3]: Leaving directory `/home/mhammouri/BerkeleyGW-1.1-beta2'
make[3]: Entering directory `/home/mhammouri/BerkeleyGW-1.1-beta2'
cpp -ansi -I./Common -DGNU -DMPI -DUSESCALAPACK Common/nrtype.f90 > Common/nrtype.p.f
cpp -ansi -I./Common -DGNU -DMPI -DUSESCALAPACK Common/intrinsics.f90 > Common/intrinsics.p.f
/usr/bin/mpif90 -ffree-form -ffree-line-length-none -fbounds-check -Wall -pedantic-errors -std=gnu -I ./Common -I /usr/share/doc/fftw-dev/fortran -c -O3 Common/nrtype.p.f -o Common/nrtype.o -JCommon/
make[3]: /usr/bin/mpif90: Command not found
make[3]: *** [Common/nrtype_m.mod] Error 127
make[3]: *** Waiting for unfinished jobs....
/usr/bin/mpif90 -ffree-form -ffree-line-length-none -fbounds-check -Wall -pedantic-errors -std=gnu -I ./Common -I /usr/share/doc/fftw-dev/fortran -c -O3 Common/intrinsics.p.f -o Common/intrinsics.o -JCommon/
make[3]: /usr/bin/mpif90: Command not found
make[3]: *** [Common/intrinsics_m.mod] Error 127
make[3]: Leaving directory `/home/mhammouri/BerkeleyGW-1.1-beta2'
make[2]: *** [pre] Error 2
make[2]: Leaving directory `/home/mhammouri/BerkeleyGW-1.1-beta2'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/mhammouri/BerkeleyGW-1.1-beta2'
make: *** [all-flavors] Error 2
*-----------------------------------------
hammouri

Submitted by yunhailiseu on Tue, 03/29/2016 - 00:16

Firstly, please make sure that you have MPI (either MPICH or openmpi or IntelMPI) installed on your server. To my experience, the pre-build MPI from the software repository is likely to fail or to produce annoying segment faults. Here's my configuration for openmpi:
---------------------------------------------------------------------
export CC=icc
export CXX=icpc
export FC=ifort

export CFLAGS=-O2
export CXXFLAGS=-O2
export FCFLAGS=-O2

./configure \
--prefix=$HOME/soft/openmpi-1.10.0 \
--enable-mpi-fortran=yes --enable-mpi-cxx=yes --enable-mpi-java=no \
--enable-wrapper-rpath=yes --enable-cxx-exceptions=yes \
--enable-shared=yes --enable-static=yes
------------------------------------------------------------------------------------------
Replace icc with gcc, icpc with g++ and ifort with gfortran as the above configuration is based on Intel compiler suite, not GCC.

After openmpi is installed, install Lapack and ScaLapack from the source code of netlib. DO NOT use the pre-build versions from software repository. Sorry that I cannot help at this stage as I haven't build ScaLapack yet.

The compilation for FFTW-2.1.5 is straightforward and easy. Do not forget to copy fftw_f77.i to the include sub-directory of installation directory.

AFTER ALL THE NECESSARY LIBRARIES ARE SUCCESSFULLY INSTALLED, you may copy one mk file from config and modify it to fit your server software settings. Here's my arch.mk
---------------------------------------------------------------------------------------------
#
# arch.mk for bgw-1.0.6
#
# suitable for host n74
#

#
# Precompiler options
#
COMPFLAG = -DINTEL
PARAFLAG = -DMPI
MATHFLAG = -DUSESCALAPACK
DEBUGFLAG =
C_DEBUGFLAG =

#
# Fortran compiler options
#
FCPP = cpp -ansi
F90free = mpif90 -free
LINK = mpif90 -i-static
FOPTS = -O3 -no-prec-div
FNOOPTS = -O2 -no-prec-div
MOD_OPT = -module
INCFLAG = -I

#
# C/C++ compiler options
#
C_PARAFLAG = -DPARA -DMPICH_IGNORE_CXX_SEEK
CC_COMP = mpicxx
C_COMP = mpicc
C_LINK = mpicxx
C_OPTS = -O3

#
# Command to remove, for make clean
#
REMOVE = /bin/rm -f

#
# FFTW settings
#
FFTWPATH = $(HOME)/soft/fftw-2.1.5
FFTWLIB = -L$(FFTWPATH)/lib -lfftw
FFTWINCLUDE = $(FFTWPATH)/include

#
# MKL settings
#
MKLPATH = $(HOME)/soft/mkl-13.0.079/lib/intel64
LAPACKLIB = -L$(MKLPATH) -lmkl_intel_lp64 -lmkl_sequential -lmkl_core
SCALAPACKLIB = -L$(MKLPATH) -lmkl_scalapack_lp64 -lmkl_blacs_openmpi_lp64

#
# Flags for performance profiling
#
PERFORMANCE =

#
# Test suite
#
TESTSCRIPT = make check-parallel
--------------------------------------------------------------------

Hope that it may help.

PS: It seems that you have an AMD based server. To my experience, specific version of MKL will cause the complex version of epsilon code stuck when inverting the dielectric matrix using more than 1 AMD CPU cores. Wish you good luck.

Submitted by mhammouri on Wed, 08/24/2016 - 15:19

thank you for ur reply, i tried it but did not work:
see this :
cpp -ansi -I./Common -DINTEL -DMPI -DUSESCALAPACK Common/norm.f90 > Common/norm.p.f
Common/fftw.p.f(200): error #6404: This name does not have a type, and must have an explicit type. [FFTW_BACKWARD]
call fftwnd_f77_create_plan(plus_plan,3,Nfft,FFTW_BACKWARD, &
---------------------------------------------------^
Common/fftw.p.f(201): error #6404: This name does not have a type, and must have an explicit type. [FFTW_MEASURE]
FFTW_MEASURE+FFTW_IN_PLACE+FFTW_USE_WISDOM)
--------^
Common/fftw.p.f(201): error #6404: This name does not have a type, and must have an explicit type. [FFTW_IN_PLACE]
FFTW_MEASURE+FFTW_IN_PLACE+FFTW_USE_WISDOM)
---------------------^
Common/fftw.p.f(201): error #6404: This name does not have a type, and must have an explicit type. [FFTW_USE_WISDOM]
FFTW_MEASURE+FFTW_IN_PLACE+FFTW_USE_WISDOM)
-----------------------------------^
Common/fftw.p.f(201): warning #6075: The data type of the actual argument does not match the definition.
FFTW_MEASURE+FFTW_IN_PLACE+FFTW_USE_WISDOM)
----------------------------------^
Common/fftw.p.f(202): error #6404: This name does not have a type, and must have an explicit type. [FFTW_FORWARD]
call fftwnd_f77_create_plan(minus_plan,3,Nfft,FFTW_FORWARD, &
----------------------------------------------------^
Common/fftw.p.f(203): warning #6075: The data type of the actual argument does not match the definition.
FFTW_MEASURE+FFTW_IN_PLACE+FFTW_USE_WISDOM)
----------------------------------^
compilation aborted for Common/fftw.p.f (code 1)
make[3]: *** [Common/fftw_m.mod] Error 1
make[3]: *** Waiting for unfinished jobs....
mpif90 -free -I ./Common -I -L/opt/intel/composer_xe_2011_sp1.10.319/mkl/include -c -O3 -no-prec-div Common/misc.p.f -o Common/misc.o -moduleCommon/
ifort: command line warning #10159: invalid argument for option '-m'
mpif90 -free -I ./Common -I -L/opt/intel/composer_xe_2011_sp1.10.319/mkl/include -c -O3 -no-prec-div Common/norm.p.f -o Common/norm.o -moduleCommon/
ifort: command line warning #10159: invalid argument for option '-m'
ar ru libtile_qhull.a libtile_qhull.o libtile_qhull_find.o geom2.o geom.o global.o io.o libqhull.o mem.o merge.o poly2.o poly.o qset.o random.o rboxlib.o stat.o user.o usermem.o userprintf.o userprintf_rbox.o
ar: creating libtile_qhull.a
make[4]: Leaving directory `/home/mhammouri/BerkeleyGW-1.1-beta2/Common/qhull'
make[3]: Leaving directory `/home/mhammouri/BerkeleyGW-1.1-beta2'
make[2]: *** [pre] Error 2
make[2]: Leaving directory `/home/mhammouri/BerkeleyGW-1.1-beta2'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/mhammouri/BerkeleyGW-1.1-beta2'
make: *** [all-flavors] Error 2

Submitted by mhammouri on Wed, 08/24/2016 - 15:20

and this was the mk file :
# arch.mk for BerkeleyGW codes
#
# Suitable for Ubuntu 10.10 in parallel.
# Install packages: liblapack-dev, fftw-dev, gfortran, g++, mpi-default-dev
# Build BLACS according to http://www.open-mpi.org/faq/?category=mpi-apps#blacs
# Build ScaLAPACK according to http://www.open-mpi.org/faq/?category=mpi-apps#scalapack,
#
# D. Strubbe
# January 2011, UCB

COMPFLAG = -DINTEL
PARAFLAG = -DMPI
MATHFLAG = -DUSESCALAPACK
# Only uncomment DEBUGFLAG if you need to develop/debug BerkeleyGW.
# The output will be much more verbose, and the code will slow down by ~20%.
DEBUGFLAG =
C_DEBUGFLAG =
#########################################################################
# NOTE: This arch.mk is used by a buildslave. The compiler flags are #
# optimized to debug the code and not for code performance. #
#########################################################################
FCPP = cpp -ansi
#F90free = /usr/bin/mpif90 -ffree-form -ffree-line-length-none -Wall
F90free = mpif90 -free
#F90free = /usr/bin/mpif90 -ffree-form -ffree-line-length-none -fbounds-check -fbacktrace -ffpe-trap=invalid,zero,overflow
# denormal not supported, according to runtime error
# precision is flagged by cputime: http://gcc.gnu.org/onlinedocs/gcc-4.5.3/gfortran/Debugging-Options.html
# underflow is flagged by dlamch from lapack
LINK = mpif90 -i-static
FOPTS = -O3 -no-prec-div
#FOPTS = -g -C
FNOOPTS = -O2 -no-prec-div
MOD_OPT = -module
INCFLAG = -I

C_PARAFLAG = -DPARA -DMPICH_IGNORE_CXX_SEEK
CC_COMP = mpicxx
C_COMP = mpicc
C_LINK = mpicxx
C_OPTS = -O3

REMOVE = /bin/rm -f

# Math Libraries
#
FFTWLIB = -L/opt/intel/composer_xe_2011_sp1.10.319/mkl/lib/ -lfftw
FFTWINCLUDE = -L/opt/intel/composer_xe_2011_sp1.10.319/mkl/include
LAPACKLIB = --L/opt/intel/composer_xe_2011_sp1.10.319/mkl/lib -lfftw
BLACSDIR = /usr/lib
BLACS = $(BLACSDIR)/blacs_MPI-LINUX-1.a $(BLACSDIR)/blacsF77init_MPI-LINUX-1.a $(BLACSDIR)/blacs_MPI-LINUX-1.a
SCALAPACKLIB = /usr/lib/libscalapack-1.a $(BLACS)

#Ubuntu BLACS/SCALAPACK packages don't work properly sometimes
#BLACS = -lblacs-openmpi -lblacsF77init-openmpi -lblacs-openmpi
#SCALAPACK = -lscalapack-openmpi $(BLACS)

#MKL ScaLAPACK fails completely in complex version
#MKLPATH = /auto/opt/intel/mkl/lib/intel64
#LAPACKLIB = -Wl,--start-group $(MKLPATH)/libmkl_gf_lp64.a $(MKLPATH)/libmkl_sequential.a \
$(MKLPATH)/libmkl_core.a $(MKLPATH)/libmkl_blacs_openmpi_lp64.a -Wl,--end-group -lpthread
#SCALAPACKLIB = $(MKLPATH)/libmkl_scalapack_lp64.a

#need to export MPIEXEC=/usr/bin/mpirun if this is not default in `which mpiexec`
TESTSCRIPT = make check-parallel

jornada's picture

Submitted by jornada on Wed, 08/31/2016 - 18:31

Hi Mahmoud,

the error you are getting tells us that your fftw include files have some missing definitions. I suggest you make sure the FFTW include path is correct and, if you still get this error, switch to FFTW3. You can also try the new BerkeleyGW-1.2, which uses a slightly more robust FFTW interface, and might solve this problem.

Cheers,
Felipe

Submitted by Predictoraegis on Mon, 10/03/2016 - 16:02

Dear Mahmoud,

IN MOD_OPT = -module
After -module, it requires an "SPACE".

wrong : mpif90 -free -I ./Common -I -L/opt/intel/composer_xe_2011_sp1.10.319/mkl/include -c -O3 -no-prec-div Common/norm.p.f -o Common/norm.o -moduleCommon/
right : mpif90 -free -I ./Common -I -L/opt/intel/composer_xe_2011_sp1.10.319/mkl/include -c -O3 -no-prec-div Common/norm.p.f -o Common/norm.o -module Common/

so after "MOD_OPT = -module" in arch.mk, please click a spacebar key to add an space.

Yours,

Honggi Nam
CINAP, SKKU, South Korea.

jornada's picture

Submitted by jornada on Thu, 10/06/2016 - 11:51

Hi Honggi,

thanks for spotting the error. Mahmoud: did this work for you? Please, let us know. If it doesn't, I can test on BerkeleyGW on SUSE Linus in a virtual machine with gcc compilers.

Best,
Felipe

Submitted by mhammouri on Thu, 01/19/2017 - 14:55

Thank you Felipe & Honggi.
I was moving to new job so I was not able to check this forum. I will try it and let you know.