-
Notifications
You must be signed in to change notification settings - Fork 5
How to install VASP, LAMMPS, Siesta, Quantum Espresso etc. with MPI
I made this Wiki to list down the steps to install various popular Computational Materials Science codes, mostly DFT and MD in parallel. Since these instructions are taken from my learning notes, all the steps might not work for latest versions. Also, notice how most of my issues were around which compiler the MPI uses and pointing to the correct libraries. However, most steps are generic and should work unless the packages are drastically changed.
I hope it helps anyone who is starting with these packages and facing problems with installation!
Update: March 2022 - Steps for VASPv6.2.1 installation with Intel OneAPI
A small guide to this Wiki:
Pre-requisite installations to set up your system
- Install Intel® Parallel Studio XE Cluster Edition for Linux
- Install OpenMPI with Intel C++ and Fortran compilers
DFT and related packages:
- Steps to install VASP
- Steps to install Siesta with tbtrans
- Steps to install Quantum Espresso
- Steps to install Abinit
- Steps to install Gollum-2
- Steps to install Phonopy (new attempt)
- Steps to install phono3py
- Steps to install ShengBTE
- Steps to install thirdorder.py
Molecular Dynamics packages:
Post-processing and Visualization:
- Steps to install conda and pymatgen
- Steps to install Pymatgen (Python Materials Genomics) using python3.5
- Steps to install Cygwin in Windows (obviously)
- Steps to install Xcrysden
- Install and run Amazon Web Services ParallelCluster on Windows 10
If you are a student in a university, you can download the latest Intel Parallel Studio for parallel Fortran and C++ compilers, MKL libraries etc for free. These are known to speed up programs a lot.
- Register yourself and download the ~4 GB file from https://registrationcenter.intel.com/en/
- Unpack it and enter it and then
sh install.sh
- Follow all directions, give the license number as mentioned in webpage/email you receive after registration and continue.
- After it’s done, edit ~/.bashrc file or /etc/bash.bashrc (take a backup first) for all users and write this:
export PATH=$PATH:/opt/intel/compilers_and_libraries_2017/linux/bin/intel64:/opt/intel/impi/2017.0.098/intel64/bin
(TIP: Always dosource ~/.bashrc
everytime you make changes to .bashrc, for the changes to be effective in the same old terminal window. bashrc only loads when a new terminal is opened) - Voila! Now you can access all ifort, icc, mpicc, mpiifort, bleh bleh bleh. ^_^
We can continue using the mpi executables that come with the above Intel Parallel Studio, but I faced some issues initially while installing VASP solely with Intel MPI. So I switched over to using OpenMPI based mpi executables "wrapped" around the Intel Fortran and C++ compilers. (Tip: mpiifort is an Intel Fortran based Intel MPI executable that comes prebuilt in the Studio, but mpifort is an OpenMPI compiler that can be wrapped around standard GNU Fortran or Intel compilers, as you wish )
- For this to work, we need to install Intel Parallel Studio XE student edition which is free! It contains Intel compilers for C++ and fortran, icc and ifort.
- Download OpenMPI latest version from its website: OpenMPI and then do the following:
- We will install all OpenMPI based executables in a custom directory so as not to interfere with the built-in mpi executables and libraries in your Ubuntu. So
mkdir ~/build/openmpi-2.0.0-INTEL_17.0
(or any directory name of your choice) - Untar the downloaded OpenMPI package, enter and do
./configure CC=icc CXX=icpc F77=ifort FC=ifort prefix=~/build/openmpi-2.0.0-INTEL_17.0
sudo bash
make
make install
-
ERROR_TIPS: If you get ld: link failed Bad value error, just check if $LD_LIBRARY_PATH points to where the all the Intel lib files are. For ex - here it should be
$LD_LIBRARY_PATH = /opt/intel/compilers_and_libraries_2017.1.132/linux/compiler/lib/intel64/:$ {LD_LIBRARY_PATH}
- We will install all OpenMPI based executables in a custom directory so as not to interfere with the built-in mpi executables and libraries in your Ubuntu. So
- Finally we have to make the openMPI directories available for your bash. Therefore we include the following statements in the ~/.bashrc:
source /opt/intel/compilers_and_libraries_2017.0.098/linux/bin/compilervars.sh intel64
source /opt/intel/compilers_and_libraries_2017.0.098/linux/mpi/intel64/bin/mpivars.sh
export INCLUDE=/opt/intel/mkl/include/intel64:/opt/intel/impi/2017.0.098/intel64/include:/opt/intel/compilers_and_libraries_2017.0.098/linux/compiler/include:$INCLUDE
export OMPI_F77=ifort
export OMPI_FC=ifort
export LD_LIBRARY_PATH=~/build/openmpi-2.0.0-INTEL_17.0/lib:$LD_LIBRARY_PATH
export MANPATH=$MANPATH:~/build/openmpi-2.0.0-INTEL_17.0/share/man
export INFOPATH=$INFOPATH:~/build/openmpi-2.0.0-INTEL_17.0/share/man
export I_MPI_CC=icc
export I_MPI_CXX=icpc
export I_MPI_F77=ifort
export I_MPI_F90=ifort
- Also to change the compiler wrappers for mpicc, mpiifort, etc:
- Refer to: http://stackoverflow.com/questions/3353119/how-to-force-openmpi-to-use-gcc-instead-of-icc-is-recompiling-openmpi-necessary and https://www.open-mpi.org/faq/?category=mpi-apps#override-wrappers-after-v1.0
- Do
more /usr/share/openmpi/mpicc-wrapper-data.txt
to find out current compiler. Note if compiler=gcc. - To change this we need to do something like:
export OMPI_CC=icc
and so on. (But this should not be a problem if Steps 1 - 3 work fine.)
TIP: I always try to install any new packages and software in a custom directory in my home directory, named as "build". So, all packages henceforth will be unpacked and made in this "build" directory.
There was a lot of trial and error and learning involved to arrive at the perfect makefile for VASP! Below are the steps I followed along with some important error solving tips. The final makefile for my system is attached in the repo for reference.
- Intel compiler suite and OpenMPI should have been installed (Refer to Prerequisite-installations in this document)
- Do
source /opt/intel/compilers_and_libraries_2017.0.098/linux/bin/compilervars.sh intel64
if not done earlier. sudo apt-get install build-essential libfftw*
-
sudo apt-get install liblapack-dev liblapack3 libopenblas-base libopenblas-dev
to install/update the system libraries. You should use the BLAS and SCALAPACK libraries that come within the Intel Studio. Search the libmkl libraries in the Intel installation directory (something like /opt/intel/compilers_and_libraries_2017.0.098/linux/mkl/lib/intel64/) and make sure they are there. Otherwise, if you want to use libraries from other source, follow the below steps:
-
Download OpenBLAS from http://www.openblas.net/
- Enter folder:
make FC=gfortran CC=gcc USE_THREAD=0 TARGET=SANDYBRIDGE
(no space before sandybridge, mind you) - Library libopenblas_sandybridge-r0.2.18.a is created in /home/shreeja/build/OpenBLAS-0.2.18
- Then you can do
make PREFIX=/home/shreeja/build/OpenBLAS-0.2.19 install
- Enter folder:
-
Download ScaLAPACK from http://www.netlib.org/scalapack/ tarball and install it as follows:
- Extract and go inside. Copy SLmake.inc.example to SLmake.inc and make following edits in it:
BLASLIB = -L/home/shreeja/build/OpenBLAS-0.2.19/lib -lopenblas
LAPACKLIB = $(BLASLIB)
- Then
make
- If you get libopenblas (or some library) not found, then you need to install these. Do
sudo apt-get install liblapack-dev liblapack3 libopenblas-base libopenblas-dev
. Then againmake
.
- Extract and go inside. Copy SLmake.inc.example to SLmake.inc and make following edits in it:
-
Don’t know if it’s required Download LAPACK from http://www.netlib.org/lapack/#_lapack_version_3_7_0 and install it as follows:
- Extract it and go inside.
cp make.inc.example to make.inc
- Then do
make blaslib
- Then
make all
-
ERROR_TIP: If you get error “Makefile:469: recipe for target 'znep.out' failed”, try the following:
ulimit -u unlimited
ulimit -s unlimited
sudo make all
- It worked!
- Extract it and go inside.
- Untar VASP directories. Get into ~/build/Vasp_5.3.5/vasp.5.lib and edit the provided makefile.linux_ifc_P4. Change the flags,
FC = ifort; FFLAGS = -O1; FREE = -free
for Intel compilers - In general, you would like to use a vendor supplied BLAS and LAPACK, so remove the lapack_double.o part from the makefile.
- Do
make -f makefile.linux_ifc_P4
to build library, libdmy.a. - Check that the environment variables, PATH, LD_LIBRARY_PATH, INCLUDE point towards Intel and OpenMPI libraries. If not do something like
export INCLUDE=/opt/intel/mkl/include/intel64:/opt/intel/openmpi-icc/include:/opt/intel/composer_xe_2013.1.117/compiler/include/intel64/:$INCLUDE
- After VASP library build, get into /home/shreeja/build/VASP_Lit/Vasp_5.3.5 and make the following edits to makefile.linux_ifc_P4:
- Specify
MKLROOT=/opt/intel/mkl
and do other changes as required like path ofimpi
include files, BLAS library, LAPACK library etc. make -f makefile.linux_ifc_p4
- In case you need to make again do
make -f makefile.linux_ifc_p4 clean
first and thenmake
-
ERROR_TIP: If you get an error like “unrecognized file byterecl lowercase blah blah” for mpif90, then it is due to mpif90 being wrapped over gfortran instead of ifort. To change this, toggle to Intel compilers by -
export OMPI_F77=ifort
andexport OMPI_FC=ifort
(Refer to Prerequisite-installations). To check, dompif90 --version
. It should show ifort for subsequent steps to work. -
ERROR_TIP: If you get an error like “make: *** No rule to make target '/opt/intel/mkl/interfaces/fftw3xf/libfftw3xf_intel.a’”, go into /opt/intel/mkl/interfaces/fftw3xf and do
sudo -E env "PATH=$PATH" make libintel64 compiler=intel
ormake libintel64 compiler=intel
if you don't have sudo permissions. (PS: Don’t know if this is going to work. Fingers crossed) (Later: It works!)
- Specify
The following steps are some hints to resolve errors during the make if you are writing the makefile from scratch. As a beginner, I started with trying to compile using Intel MPI but couldn't, so switched over to OpenMPI based. Skip these steps if you are using the makefile from the repo here.
- ERROR_TIP: If you get an error like “chi_base.F cannot compile: this module file was not generated by any release of this compiler”, it means some conflict with mpi compilation, wrappers blah blah etc. One workaround is to change the mpif90 in your makefile to mpiifort. :D Voila! chi_base.F compiles
- ERROR_TIP: If you get error like: “libmkl_blacs_openmpi_lp64.so: undefined reference to `ompi_mpi_comm_null'”, change -lmkl_blacs_openmpi_lp64 to -lmkl_blacs_intelmpi_lp64.
- ERROR_TIP: Next, I got a vague error as “recipe for target vasp failed” without telling what the error is. (Later: actually the error was right in front. It was “wannier_interpol.f90:(.text+0x0): multiple definition of `util._' wannier_interpol.o:wannier_interpol.f90:(.text+0x0): first defined here”). The multiple definition error was due to writing the same .o more than once in SOURCE. wannier_interpol.o was written twice. Smh
- TIP: Also in the FFLAGS use -shared_intel instead of -i_dynamic for ifort 17.0.0
- Do
make -f makefile.linux_ifc_p4
- ERROR_TIP: OK, so it didn’t work. Tests ran fine, but on running MY program , I get “Fatal error in PMPI_Alltoallv: Other MPI error, error stack:”. I don’t know what it means even after scouring Google for answers. So, I am going to recompile VASP using OpenMPI compiler mpif90 instead of the Intel provided one. Modify PATH to 1st have openMPI/bin path. Changed -lmkl_blacs_intelmpi_lp64 back to -lmkl_blacs_openmpi_lp64. It works!
- Download Wannier90 from http://www.wannier.org/download.html
- Extract and enter.
-
cp ./config/make.sys.ifort ./make.sys
(replace "sys" with "inc" for wannier90-2.1) - Edit ./make.sys to include the following:
F90 = ifort
COMMS=mpi
MPIF90=mpiifort
LIBDIR=/opt/intel/mkl/lib/intel64 (wherever your Intel mkl libraries are)
LIBS = -L$(LIBDIR) -lmkl_core -lmkl_intel_lp64 -lmkl_sequential -lpthread
- Then do
make wannier lib test w90vdw w90pov
Done! - Go back to the directory where you have installed VASP and modify the winning makefile :
Add option
-DVASP2WANNIER90
to the line "CPP ="
Add/home/mslab/build/wannier90-2.0.1/libwannier.a
as library destination to the lineLIB = -L../vasp.5.lib -ldmy ../vasp.5.lib/linpack_double.o $(LAPACK) $(BLAS)
- Recompile VASP. It works! Wannier90 is installed
- Download codes from http://theory.cm.utexas.edu/vtsttools/download.html and extract it in build
- Change the main.F file in vasp folder:
CALL CHAIN_FORCE(T_INFO%NIONS,DYN%POSION,TOTEN,TIFOR, &
TSIF,LATT_CUR%A,LATT_CUR%B,IO%IU6)
(Argument TSIF is the new addition here)
- Copy contents of VTST code to Vasp folder. It will replace chain.F file. Accept the replacement
- Then in winning makefile type these before
chain.o
:
bfgs.o dynmat.o instanton.o lbfgs.o sd.o cg.o dimer.o bbm.o fire.o lanczos.o neb.o qm.o opt.o
- Then do a clean recompiling of vasp (for ex-
make distclean
and thenmake -f makefile.linux_ifcP4
) - Yay! VTST also good.
- But remember to do
ulimit -u unlimited
andulimit -s unlimited
before running VASP to avoid SISEGV segmentation faults. Oh, and also, I found the golden rule ----- “always use <1 core/atom”! - ^_^
- Make sure Intel OneAPI is installed. It was already installed in my system, so I don't have the instructions how to install it. It is typically found in places like
/opt/intel/oneapi/
or/nfs/intel/oneapi
- First do
source /nfs/intel/oneapi/setvars.sh
, so that all Intel binary and library paths are appended to you $PATH and $LD_LIBRARY_PATH. This allows us to run Intel mpi, fortran, c++ executables. - Extract vaspv6.2.1.tar.gz and enter.
- Look at the makefiles inside arch directory, and copy makefile.include.linux_intel.
cp arch/makefile.include.linux_intel ./makefile.include
- Compiling fftw3xf libraries:
- Go to /nfs/intel/oneapi/mkl/latest/interfaces/fftw3xf/
- Try doing
make libintel64
- This will work only if you have permission to write in the current directory (.)
- If you don't have write permission (like me), create a new directory in your home and do
make libintel64 INSTALL_DIR=/home/shreeja/build/fftw3xf_lib_oneapi/
- It should now create a libfftw3xf_intel.a in the INSTALL_DIR specified.
- Time to edit the
makefile.include
:- Most things do not need modification. Check out VASP's installation wiki for customization (https://www.vasp.at/wiki/index.php/Installing_VASP.6.X.X)
- Check if $(MKLROOT)/lib/intel64 contains lmkl_blacs_intelmpi_lp64.a, libmkl_scalapack_lp64.a. Do
ls $MKLROOT/lib/intel64
- If you have compiled fftw3xf libraries in a custom directory make sure to include the INSTALL_DIR/libfftw3xf_intel.a in OBJECTS:
OBJECTS = fftmpiw.o fftmpi_map.o fft3dlib.o fftw3d.o /home/shreeja/build/fftw3xf_lib_oneapi/libfftw3xf_intel.a
- Rest remains same
- To install the standard, gamma-point only and non-collinear versions:
make DEPS=1 -j12 std
,make DEPS=1 -j12 gam
,make DEPS=1 -j12 ncl
- VASP executables are now created inside
/home/shreeja/build/vasp.6.2.1/bin
. - ^_^
- Download QE version 5.4.0 (espresso-5.4.0.tar.gz) from: https://www.quantum-espresso.org/download
$ sudo apt-get install liblapack-dev fftw-dev build-essential fftw3-dev gfortran
$ cd ~/build/espresso-5.4.0
$ ./configure
$ make all
- (Psst, don’t be lazy and
make -j12 all
. It doesn’t work). - For additional programs, we do
$ make w90
,$ make plumed
etc as necessary. - Go into PW/examples and run
$ ./run_all_examples
to test your installation - All the executables are kept in the ~/build/espresso-5.4.0/bin folder.
- Done! Use any of the executables for your work. ^_^
- Download self-contained standalone executable for linux .zip file from http://www-k3.ijs.si/kokalj/pwgui/download.html
- Extract it.
- Done! Pwgui executable can be used directly now. ^_^
- Download tarball from https://launchpad.net/siesta
- Go into siesta-4.1-b2/Obj and do $ sh ../Src/obj_setup.sh
- We have to first install lapack, blas and scalapack by doing the following:
- Follow steps no. 6 & 7 of “Steps to install VASP” (But Intel compilers already have their own lapack blas etc. So probably skip this step. Umm depends)
- Do
$ cp intel.make arch.make
- Add the following lines in arch.make:
FC = mpifort
FPPFLAGS = -DMPI -DFC_HAVE_FLUSH -DFC_HAVE_ABORT
BLAS_LIBS = -L$(MKLROOT)/lib/intel64/ -lmkl_core -lmkl_intel_lp64 -lmkl_sequential
LAPACK_LIBS = -L$(MKLROOT)/lib/intel64/ -lmkl_lapack95_lp64
BLACS_LIBS = -L$(MKLROOT)/lib/intel64/libmkl_blacs_openmpi_lp64.a
SCALAPACK_LIBS = -L$(MKLROOT)/lib/intel64/libmkl_scalapack_lp64
MPI_LIBS = -L/home/mslab05/build/openmpi-2.0.0-INTEL/lib
LIBS = $(BLAS_LIBS) $(LAPACK_LIBS) $(MPI_LIBS)
Also comment out COMP_LIBS
6. Then do $ make
7. If you get “fdf.F90(502): error #7002: Error in opening the compiled module file” error, add the following lines as well:
MPI_INTERFACE = libmpi_f90.a
MPI_INCLUDE = -I/home/mslab/build/openmpi-3.0.0-intel/include/
- Most probably, no make errors will show up. But, it is to give you a sense of false security. Notice that the siesta executable does not work at all on example h2o. :(
- Means do a
make clean
and change the arch.make and try your luck again. - After thousands, no millions of attempts finally got the example h2o.fdf to run in parallel.
- If you get error “Intel MKL FATAL ERROR: Cannot load symbol MKLMPI_Get_wrappers.”, put all your Intel mkl libraries within “-Wl,-Bstatic -Wl,--start-group and -Wl,--end-group -Wl,-Bdynamic”
- Mention BLAS, BLACS, LAPACK, SCALAPACK library addresses as those from Intel MKL. Take MPI libraries from the local OpenMPI-INTEL installation.
- If error is “libmpi.so: undefined reference to MPIR_CommGetAttr_Fort”, it means the mpi compiler used to complie siesta is not the same as the ones specified in the MPI_LIBS values. Here, I had taken mpiifort (Intel MPI) but pointing to openmpi libraries. Change mpiifort to mpifort.
- If you get error “intel64/libmkl_intel_thread.a(dlaeh2_par.o): In function
mkl_lapack_dlaeh2': dlaeh2_omp_gen.f:(.text+0xa1): undefined reference to
__kmpc_global_thread_num'”. Add-liomp5 -lpthread
at the end ofLIBS
in arch.make. Like this,LIBS = -Wl,-Bstatic -Wl,--start-group $(BLAS_LIBS) $(SCALAPACK_LIBS) $(BLACS_LIBS) $(LAPACK_LIBS) -Wl,--end-group -Wl,-Bdynamic $(MPI_LIBS) -qopenmp -liomp5 -lpthread
. I think this needs to be done for old intel compilers (v2013) because it works fine withoutliomp5
andlpthread
in the newer versions (2017-2019). - Now, parallel siesta works but encounters a segmentation fault: libpthread-2.23.s 00002B9482D46390 Unknown Unknown Unknown libmpi.so.20.0.0 00002B9481D8E065 MPI_Comm_size. Changed the BLACS_LIBS form intelmpi based to openmpi based. It works now! All of this is mainly due to a conflict between Intel MPI & Open MPI.
- Naming the working makefile as: arch.make.basic.WORKS
- If you get undefined reference to ‘indxg2p’, means Intel scalapack libraries are iffy. Change the above variables to point to standard libraries:
MPI_INTERFACE = libmpi_f90.a
MPI_INCLUDE = -I/home/mslab/build/openmpi-2.0.0-INTEL_17.0/include/
FPPFLAGS = -DMPI -DFC_HAVE_FLUSH -DFC_HAVE_ABORT
BLAS_LIBS = -L$(MKLROOT)/lib/intel64/ -lmkl_core -lmkl_intel_lp64 -lm -lmkl_intel_thread -lmkl_sequential
LAPACK_LIBS = -L$(MKLROOT)/lib/intel64/ -lmkl_lapack95_lp64
BLACS_LIBS = -L$(MKLROOT)/lib/intel64/ -lmkl_blacs_openmpi_lp64
SCALAPACK_LIBS = -L$(MKLROOT)/lib/intel64/ -lmkl_scalapack_lp64
MPI_LIBS = -L/home/mslab/build/openmpi-2.0.0-INTEL_17.0/lib -lmpi
LIBS = -Wl,-Bstatic -Wl,--start-group $(BLAS_LIBS) $(SCALAPACK_LIBS) $(BLACS_LIBS) $(LAPACK_LIBS) -Wl,--end-group -Wl,-Bdynamic $(MPI_LIBS) -qopenmp
#LIBS = $(BLAS_LIBS) $(SCALAPACK_LIBS) $(BLACS_LIBS) $(LAPACK_LIBS) $(MPI_LIBS) -qopenmp
- Install zlib, HDF5 with parallel I/O and finally NetCDF
- Note: Keep in mind the c and fortran compilers used to compile your computer’s mpi compiler. In my case mpicc, mpifort are the openMPI compilers built around Intel C and Fortran compilers (icc and ifort). We have to maintain this consistently throughout all the following makes.
- Ok, so this compilation is not easy at all. It differs from instance to instance. I am going to write down a few pointers during installation that one should look out for.
- Installation sequence to follow: zlib -> curl -> hdf5 -> NetCDF -> NetCDF Fortran -> tbtrans
- Every time you think you messed something up, do this:
make uninstall
,make distclean
. Then recompile. Keep checkingconfig.log
for clues to what went wrong. - First set the environment variables to Intel compilers:
export CC=mpicc
export CXX=mpicxx
export CFLAGS='-O3 -xHost -ip -no-prec-div -static-intel'
export CXXFLAGS='-O3 -xHost -ip -no-prec-div -static-intel'
export F77=mpifort
export FC=mpifort
export F90=mpifort
export FFLAGS='-O3 -xHost -ip -no-prec-div -static-intel'
export CPP='icc -E'
export CXXCPP='icpc -E'
CPPFLAGS='-I/home/shreeja/local/include -L/home/shreeja/local/lib'
LDFLAGS=’-L/home/shreeja/local/lib’
-
Install zlib
- Download zlib from https://zlib.net/zlib-1.2.11.tar.gz
- Untar using
$ tar -xvzf zlib-1.2.3.tar.gz
and enter. - Do
$ ./configure --prefix=/home/shreeja/local/
$make install
- If it gives permission error, try sudo. But it might make programs like apt-get depend on libimf.so (provided by Intel). The workaround is to install zlib in a custom directory like /home/shreeja/local on which you can freely give permissions. -_-
- Install curl with zlib:
- Download from https://curl.haxx.se/download/curl-7.61.0.tar.gz
- Extract and enter
$ ./configure --with-zlib=/home/shreeja/local --prefix=/home/shreeja/local/
$ make
$ make install
- Make sure libcurl library is present in /home/shreeja/local/lib after installation
-
Install HDF5 parallel:
- Download hdf5-1.8.13. Untar and enter.
./configure --enable-parallel --prefix=/home/shreeja/local/ --enable-fortran --disable-shared --enable-cxx --enable-fortran2003 --enable-unsupported --with-zlib=/home/shreeja/local
- Then
$ make
$ make check
$ make install
- Verify by checking
libhdf5.settings
. It should have Fortran and C compilers. `Parallel HDF5: yes, I/O filters (external): deflate(zlib),
- Install NetCDF-C with hdf5 and parallel enabled
- Download NetCDF-C v4.6.1. Extract and enter
./configure --enable-shared --enable-parallel-tests --disable-filter-testing --enable-dap --with-hdf5=/home/shreeja/local --prefix=/home/shreeja/local CPPFLAGS='-I/home/shreeja/local/include -L/home/shreeja/local/lib' LDFLAGS='-L/home/shreeja/local/lib'
- If you get configure error: z library not found, check libz.so is present in /home/shreeja/local/lib and make sure -L/home/shreeja/local/lib is passed to the compiler. I just added this line to CPPFLAGS variable because somehow setting LDFLAGS was not working. -_-
- Then
$ make check
- Then
$ sudo make install
- If your parallel hdf5 is successfully compiled, you should see the following tags on doing
$ ./nc-config –all
--has-nc4 -> yes
--has-hdf5 -> yes
--flibs -> -L/home/shreeja/local/lib -lnetcdff -L/home/shreeja/local/lib -lnetcdf -lnetcdf -lnetcdf
--has-f90 -> no
--has-f03 -> yes
- There is a catch. The above options might not all appear in the first install. Only after installing netcdf-fortran it appears.
- Install NetCDF-Fortran v4.4.4 parallel enabled
- Download, extract and enter.
./configure --prefix=/home/shreeja/local --enable-shared --enable-dap CPPFLAGS='-I/home/shreeja/local/include -L/home/shreeja/local/lib' LDFLAGS='-L/home/shreeja/local/lib'
$ make
$ make install
- Check
./nf-config
for following flags:
--has-f90 -> no
--has-f03 -> yes
--has-nc2 -> no
--has-nc4 -> yes
- Edit arch.make file in siesta/Obj/ and add following lines:
NETCDF_LIBS = -L/usr/local/lib -lnetcdff -lnetcdf -lhdf5_fortran -lhdf5_hl -lhdf5 -lz -lcurl
COMP_LIBS = libncdf.a
LIBS = -Wl,-Bstatic -Wl,--start-group $(BLAS_LIBS) $(SCALAPACK_LIBS) $(BLACS_LIBS) $(LAPACK_LIBS) -Wl,--end-group -Wl,-Bdynamic $(MPI_LIBS) $(NETCDF_LIBS) $(COMP_LIBS) –qopenmp
NETCDF_ROOT = /home/nayakgroup/local
NETCDF_INCFLAGS = -I$(NETCDF_ROOT)/include
INCFLAGS= $(NETCDF_INCFLAGS)
atom.o: atom.F
$(FC) -c $(FFLAGS_DEBUG) $(INCFLAGS) $(FPPFLAGS) $(FPPFLAGS_fixed_F) $<
state_analysis.o: state_analysis.F
$(FC) -c $(FFLAGS_DEBUG) $(INCFLAGS) $(FPPFLAGS) $(FPPFLAGS_fixed_F) $<
Add .c to list of .SUFFIXES:
14. Get into siesta-4.1-b3/Util/TS/TBtrans and do $ make tbtrans
15. If anything about nc_***
symbol not recognized comes up, means netcdf install is not ok or INCLUDE flags are not set to correct location of netcdf header files. Go back and recompile EVERYTHING. Ughh!
16. Finally done!
17. Save this arch.make in the Obj directory. Saved it as arch.make.FORTBTRANS
18. Serial tbtrans takes 40000 seconds but the parallel version takes only 300 seconds!Yayy!
- Download Abinit from website. Untar it by tar -xvzf abinit-8.10.3.tar.gz
-
mkdir tmp
Enter it andprefix="/data/EXTERNAL/mihir/build/abinit-dir" CC="icc" CXX="cpp" FC="gfortran" enable_mpi="yes" enable_mpi_io="yes" with_mpi_prefix="/data/EXTERNAL/mihir/build/openmpi-3.0.0-intelv17.0" with_linalg_flavor="mkl" with_linalg_incs="-I${MKLROOT}/include" with_linalg_libs="-L${MKLROOT}/lib/intel64 -Wl,--start-group -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -Wl,--end-group -lpthread -lm -ldl"
- Check out
doc/build/config-examples/ubu_intel_17.0_openmpi.ac
for clues
- Check if matlab runtime compiler is there. If not, install as instructed in https://in.mathworks.com/help/compiler/install-the-matlab-runtime.html#bvf6bih-4
- If MATLAB is installed in your system, check location of MCR runtime. Run matlab in terminal. At prompt type,
>>mcrinstaller
. It shows the location of MCRInstaller: /usr/local/MATLAB/R2015b/toolbox/compiler/deploy/glnxa64/MCRInstaller.zip. I don’t know if we should install this (maybe it can tamper with existing MATLAB) - So, download MATLAB MCR_R2017a from website. Unzip it. We will install this MCR in the local user account without sudo rights.
- Do
$ ./install -v -mode silent -agreeToLicense yes -destinationFolder /home/shreeja/
- A new directory
/home/shreeja/v92
is created. This is the MCR root now. - Gollum executable is a standalone. We can directly run it. Do
$ ./run_gollum.sh /home/shreeja/v92
- Edit
~/.bashrc
to include:
MCR_ROOT=/home/shreeja
XAPPLRESDIR=$MCR_ROOT/v92/X11/app-defaults
- But, changing the LD_LIBRARY_PATH variables as mentioned in the README caused symbol lookup errors in certain commands like vim. So, not doing that. In case Gollum does not run, will do:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MCR_ROOT/v92/runtime/glnxa64:$MCR_ROOT/v92/bin/glnxa64:$MCR_ROOT/v92/sys/os/glnxa64:$MCR_ROOT/v92/sys/opengl/lib/glnxa64
- Done
- Refer: https://atztogo.github.io/phonopy/install.html. Best way is to install using conda as explained in the link. Otherwise follow below steps.
$ sudo apt-get install python-matplotlib python-yaml python-dev python-numpy
- Download ver 1.10.10 from https://sourceforge.net/projects/phonopy/files/phonopy/phonopy-1.10/
- Inside ~/build do $
cp ../Downloads/phonopy-1.10.10.tar.gz ./
- Then do $
tar xvfz phonopy-1.10.10.tar.gz
- Then $
cd phonopy-1.10.10/
- Do $
python setup.py install –home=.
- Write in ~/.bashrc:
export PYTHONPATH=$PYTHONPATH:/home/shreeja/build/phonopy-1.10.10/lib/python
- Open a new terminal and type
phonopy
- Done! Phonopy run! ^_^
- Goto from http://atztogo.github.io/phonopy/install.html
- Install matplotlib $
sudo apt-get install python-matplotlib
- Install python-yaml $
sudo pip install PyYAML
- Actually just do $
sudo apt-get install python-dev python-numpy python-matplotlib python-yaml python-scipy texlive-fonts-recommended
- Download phonopy-1.10.8 from https://sourceforge.net/projects/phonopy/files/phonopy/phonopy-1.10/
- Run $
python setup.py install –home=.
- Add $
export PYTHONPATH=~/build/phonopy-1.10.8/lib/python
to ~./bashrc - Sudo copy phonopy to one of the destinations in $PATH: $
sudo cp /home/raj/build/phonopy-1.10.8/bin /usr/local/bin
- Goto http://atztogo.github.io/phono3py/install.html
- Install following python modules and libraries by doing $
sudo apt-get install python-numpy python-matplotlib python-yaml python-h5py libgomp1 liblapacke-dev
:- numpy
- matplotlib
- yaml
- h5py – error of file not hd5f.h found, do $
sudo apt-get install libhdf5-dev
- libgomp1
- liblapacke-dev
- liblapacke
- Download from ver 1.10.9 from: https://sourceforge.net/projects/phonopy/files/phonopy/phonopy-1.10/
- Inside ~/build do $
cp ../Downloads/phono3py-1.10.9.tar.gz ./
- Then do $
tar xvfz phono3py-1.10.9.tar.gz
- Then $
cd phono3py-1.10.9/
- Change setup3.py to reflect where liblapacke libraries and headers are:
#if platform.system() == 'Darwin':
# include_dirs += ['../lapack-3.5.0/lapacke/include']
# extra_link_args = ['../lapack-3.5.0/liblapacke.a']
TO
if platform.system() == 'Darwin':
include_dirs += ['usr/include']
extra_link_args = ['usr/lib/liblapacke.a']
- Then do $
python setup3.py install --home=.
- Make sure
$PYTHONPATH = /home/raj/build/phonopy-1.10.8/lib/python
- Then add
export PYTHONPATH=$PYTHONPATH:/home/raj/build/phono3py-1.10.9/lib/python
to ~/.bashrc so that phono3py library files are also included - Done! ^_^
- Download ShengBTE and thirdorder.py from http://www.shengbte.org/downloads
- Installation instructions in https://bitbucket.org/sousaw/shengbte/src/master/README.md?fileviewer=file-view-default
- Download spglib-1.7.4 from https://sourceforge.net/p/spglib/activity/?page=0&limit=100#55bf5f7e5fcbc92aaffd7688
- Install lapack by $
sudo apt-get install liblapack*
- Install spglib by going to spglib-1.7.4 folder:
./configure
sudo make install
- Goto ShengBTE folder
- $
cp arch.make.example Src/arch.make
- Set MKLROOT value by $
export MKLROOT=/opt/intel/compilers_and_libraries_2016.0.109/linux/mkl
. Put this line in ~/.bashrc as well. - $
vim arch.make
-->- Search for location of libmkl_lapack95_lp64.a etc in your system and set value of MKL as per that. Here just replace 'em64t' by 'intel64_lin'
- Search for libsymspg and put that path in $LDFLAGS in arch.make. That is,
export LDFLAGS=-L/usr/local/lib -lsymspg export FFLAGS=-fbacktrace -debug -O2 -static export MPIFC=mpifort
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
- Because we are going to use only OpenMPI compiler (that is why wrote mpifort instead of mpiifort), make sure all library dependencies of ShengBTE (can be obtained from
ldd ShengBTE
) are taken from OpenMPI libraries and not Intel libraries. To do this ensure that LD_LIBRARY_PATH starts with the OpenMPI libraries (i.e /usr/local/lib) followed by other libraries.- Note: In case, you have not installed openMPI and are using the MPI that came with the system, then probably mpifort won’t be available. Then we use
MPIFC=mpiifort
andFFLAGS = -fbacktrace -debug -O2
(i.e. remove the -static_intel option) and run make all. - Arch.make:
- Note: In case, you have not installed openMPI and are using the MPI that came with the system, then probably mpifort won’t be available. Then we use
export FFLAGS=-fbacktrace -debug -O2
export LDFLAGS=-L/usr/local/lib -lsymspg
export MPIFC=mpiifort
MKL=$(MKLROOT)/lib/intel64_lin/libmkl_lapack95_lp64.a -Wl,--start-group \
$(MKLROOT)/lib/intel64_lin/libmkl_intel_lp64.a \
$(MKLROOT)/lib/intel64_lin/libmkl_sequential.a \
$(MKLROOT)/lib/intel64_lin/libmkl_core.a -Wl,--end-group -lpthread -lm
export LAPACK=$(MKL)
export LIBS=$(LAPACK)
- $
make all
- Put ShengBTE executable’s path in $PATH.
- Test ShengBTE in Test-VASP folder.
- Done! ShengBTE executable is created! ^_^
- Download from http://www.shengbte.org/downloads and extract thirdorder.py in ~/build
- Go inside thirdorder
- Edit setup.py file
- Mention location of spglib/spglib.h in
INCLUDE_DIRS=["/usr/local/include"]
- Mention locatin of spglib libraries (libsymspg.*) in
LIBRARY_DIRS=["/usr/local/lib"]
- $
./compile.sh
- thirdorder_core.so, thirdorder_common.py and thirdorder_vasp.py will have been created.
- Copy these to $PATH.
- Done! ^_^
- Download tarball lammps-stable.tar.gz from http://lammps.sandia.gov/download.html
- Extract it into ~/build
- Go into lammps-30Jul16/src and then do
$ make mpi
for simple parallel installation. - Executable lmp_mpi is created. Put this in PATH and use it!
- Voila! ^_^
- New Prob: If your lmp_mpi is nicely compiled but when you try to run parallel programs using “mpirun -np lmp_mpi -in in.test”, you get multiple “LAMMPS (30 Jul 2016) ERROR: Specified processors != physical processors (../comm.cpp:329)”. It means the mpicxx compiler wrapper is different than the lmp_mpi compiler wrapper. Like in this case, mpicxx is from openmpi but lmp_mpi takes libraries from IntelMPI. So, we have to change the MPI Library destination in the mpi makefile. Edit MPI Library destination: MPI_PATH = -L/home/build/openmpi-2.0.0-INTEL_17.0/lib/
- Also, Intel MPI wrappers for both mpicxx and lmp_mpi run OK for older Intel versions. In newer versions complex MPI_blah_blah errors are coming. So better switch to openmpi libraries for LAMMPS
- ^_^
- To install a new package like USER-MISC, do:
$ sudo make yes-user-misc
- Then redo
$sudo make mpi
- BUT you run into 1001 problems. If you point MPI_PATH to the openmpi libraries as in step 6, you always get this error during compilation “libmpi.so: undefined reference to
__intel_sse2_strdup
”. According to intel, this is due to conflicting version of intel compilers (something to do with icc ifort being of different versions. But we are not using ifort in LAMMPS at all!). Also this error starts with a warning: libimf.so not found. So to point to libimf. - Compiler mpicc linkflags can be found from
$ mpicc --showme:link
(output:-pthread -Wl,-rpath -Wl,/home/mslab/build/openmpi-2.0.1-INTEL_17.0/lib -Wl,--enable-new-dtags -L/home/mslab/build/openmpi-2.0.1-INTEL_17.0/lib -lmpi
). Then editLINKFLAGS = -g -O -pthread -Wl,-rpath -Wl, /opt/intel/compilers_and_libraries_2017.1.132/linux/compiler/lib/intel64/ -Wl,--enable-new-dtags -L/home/mslab/build/openmpi-2.0.1-intel-latest/lib -lmpi
- Note that there is a link to intel compiler libraries instead of openmpi libraries to point to libimf.so etc.
- Now do
$ sudo make clean-mpi
and$ sudo make -j12 mpi
. No errors! - Your suffering does not end here. No guarantee that the executable runs without errors. So TEST!
- If you get this error on running: lmp_mpi: error while loading shared libraries: libmpi.so.20: cannot open shared object file: No such file or directory, add the libmpi.so.20 destination to your LD_LIBRARY_PATH variable in ~/.bashrc. Do $source ~/.bashrc
- Saved the working Makefile as ‘Makefile.lmp_mpi.openmpiWithIntelCompilersWORKING’
- Update on 15.07.2019: Example makefiles are available in src/MAKE/MACHINES. We can copy one of them and edit accordingly. Or better still, take src/MAKE/Makefile.mpi and do the above edits and then do
$make mpi
. - TIP: Install these packages for most work (you can check using
make pi
).$ make yes-MANYBODY yes-misc yes-molecule yes-user-misc yes-kspace yes-user-phonon
:
Installed YES: package KSPACE
Installed YES: package MANYBODY
Installed YES: package MISC
Installed YES: package MOLECULE
Installed YES: package USER-MISC
Installed YES: package USER-PHONON
- First install MPICH2:
- Refer http://swash.sourceforge.net/online_doc/swashimp/node9.html
- Download ver 1.4.1p1 from http://www.mpich.org/static/downloads/1.4.1p1/
- On double-click, it might ask to 1st install .NET framework ver 2.0.50727. So go to website http://download.microsoft.com/download/7/0/3/703455ee-a747-4cc8-bd3e-98a615c3aedb/dotNetFx35setup.exe and download and install it. It will install via Windows Features.
- Install it as you usually do. Note the secret passphrase. Here its “behappy”. REMEMEBER to do it for Everyone. Finish.
- Add C:/Program Files/MPICH2/bin to PATH environment variable so that the 2 executables, smpd and mpiexec are recognizable.
- Then do:
smpd -install
mpiexec -remove
mpiexec -register (Enter the account username and password)
mpiexec -validate (Should come as SUCCESS)
smpd -status (Should come as: smpd running on IIT)
- Then refer: http://rpm.lammps.org/windows.html to download and install LAMMPS-64 bit
- lmp_mpi executable is created in Program Files/LAMMPS/bin folder.
- For parallel execution use >
mpiexec -np # lmp_mpi ...
- Also you should probably do >
set OMP_NUM_THREADS=4
(or any other number I guess) - Done! ^_^
- Checkout “Steps to install Cygwin” for a different way.
- Download Anaconda installer for Linux from: https://www.anaconda.com/download/#linux (it will be a .sh file)
- Run it using $ sh Anaconda-000.sh
- Answer whatever it asks
- Do
$source ~/.bashrc
to set the conda paths etc - Conda is ready! It installs python3.6 in my case. So, whenever I type python, it shows this version. Cool!
- Make sure you are connected to the internet. Then install pymatgen using
$ conda install --channel matsci pymatgen
. Will take some time
- The default python version in ubuntu is 2.7.x which is not adequate for pymatgen and other complex modules
- It is also not advisable at all to change this default python installation. So, we need to create a virtual environment for the python v3.5 and then install whatever we want in that virtual environment
$ sudo pip install virtualenv
$ ls /usr/bin/python*
$ mkdir ~/build/python3.5_virtualenv
- Do
$ virtualenv -p /usr/bin/python3.5 python3.5_virtualenv
to shift the python3.5 to your man-made virtual environment - Then we need to activate this virtual env by doing
$ source ~/build/python3.5_virtualenv/bin/activate
. This will change the command prompt to “(python3.5_virtualenv) shreeja@shreeja-Precision-Tower-7910:~/build$” - We can then install any module using pip install ...
- To deactivate the virtual environment, do
$ deactivate
. - Refer to this link for more: http://docs.python-guide.org/en/latest/dev/virtualenvs/
OR (if you have installed Anaconda in your system)
- Use conda:
$ conda create --name my_pymatgen python
. - Then activate this new environment
$conda activate my_pymatgen
- To use pymatgen, work in this environment.
- Download cygwin and install by following Next>Next>...
- Change name of your home directory by doing:
mkdir /home/bob
echo "export HOME=/home/bob" >>.bashrc
echo "export HOME=/home/bob" >>.bash_profile
cp .bashrc .bash_profile /home/bob
echo "cd" >>.bashrc
- Download linux x86_64 binary package (not the source package) from http://www.xcrysden.org/Download.html
- Extract and get inside xcrysden-1.5.60-bin-shared.
- Then do $
./xcrysden
- Got error: error while loading shared libraries: libtk8.5.so:
- Do $
sudo apt-get install build-essential gfortran freeglut3-dev tcl8.5-dev tk8.5-dev
- It works now!
- Install Cygwin by running https://www.cygwin.com/setup-x86_64.exe
- It will list packages to install according to our need.
- For xcrysden, install the following (list also given in README.cygwin of xcrysden distro) in Cygwin by running setup.exe again:
vim
openssh
libgfortran3-6.4.0-5 (for cannot load shared libraries: cyggfortran-3.dll error on doing Step 5)
tcl-tk (tcl-tk-8.5.18-1; only v8.5 not v8.6)
tcl-8.5.18-1
fftw3
libGL1
libGLU1
xorg-server
xinit
xlaunch
xorg-docs
bash
bc
coreutils
gawk
grep
gzip
ImageMagick
less
more
- Download and unzip xcrysden source tar.
- Run cygwin. Do $
cd /cygdrive/c/Users/shreeja/Downloads/build/xcrysden-folder/
- Then run
./xcrysden
. Mostly there will be some error. - If you get error libtcl8.5.dll no such file or directory, means you need to install the package containing this library file.
- Search for the missing dll in https://cygwin.com/cgi-bin2/package-grep.cgi
- Then install those packages
- Run
startx
to open the X-terminal - Run
./xcrysden
in the X-terminal - Hopefully, it works! :D
- Your Windows should already have python installed in it. Best way is to install Anaconda for Windows. For me, it installs Python 3.7.
- Refer to https://docs.aws.amazon.com/parallelcluster/latest/ug/install-virtualenv.html
- Open Anaconda prompt. Do >
pip install --user --upgrade virtualenv
- If virtualenv command is not found when executing, add virtualenv.exe’s location to the environment variable PATH.
- Create a virtual environment to run AWS, apc-ve. Do >
virtualenv %USERPROFILE%\apc-ve
- Activate the new virtualenv. Do >
%USERPROFILE%\apc-ve\Scripts\activate
pip install --upgrade aws-parallelcluster
- Do >
pcluster version
to check if its installed.