compiling VASP 5.4.4.pl2 in Ubuntu 18.04.5

Questions regarding the compilation of VASP on various platforms: hardware, compilers and libraries, etc.


Moderators: Global Moderator, Moderator

Post Reply
Message
Author
nydia_varela-rosales
Newbie
Newbie
Posts: 4
Joined: Tue Jul 06, 2021 6:31 am

compiling VASP 5.4.4.pl2 in Ubuntu 18.04.5

#1 Post by nydia_varela-rosales » Wed Jul 07, 2021 5:26 pm

Dear all,
I am encountering problems of what I think is related to blas, still, I am not sure the origin. What I have tried so far is:
-> use blas, scalapack located at /usr/lib/x86_64-linux-gnu (obtained from sudo apt-get ...)
-> compile separately openBlas and scalapack (not using sudo apt-get ...) and be sure that in the makefile.include are the proper paths.
Nevertheless, in both ways, I keep getting the errors:

Code: Select all

mkdir build/std ; \
cp src/makefile src/.objects makefile.include build/std ; \
make -C build/std VERSION=std all
mkdir: cannot create directory ‘build/std’: File exists
make[1]: Entering directory '/home/mss/vasp.5.4.4.pl2/build/std'
rsync -ru ../../src/lib .
cp makefile.include lib
make -C lib -j1
make[2]: Entering directory '/home/mss/vasp.5.4.4.pl2/build/std/lib'
make libdmy.a
make[3]: Entering directory '/home/mss/vasp.5.4.4.pl2/build/std/lib'
make[3]: 'libdmy.a' is up to date.
make[3]: Leaving directory '/home/mss/vasp.5.4.4.pl2/build/std/lib'
make[2]: Leaving directory '/home/mss/vasp.5.4.4.pl2/build/std/lib'
rsync -u ../../src/*.F ../../src/*.inc .
rm -f vasp ; make vasp ; cp vasp ../../bin/vasp_std
make[2]: Entering directory '/home/mss/vasp.5.4.4.pl2/build/std'
mpif90 -o vasp c2f_interface.o base.o profiling.o openmp.o mpi.o mpi_shmem.o smart_allocate.o xml.o constant.o jacobi.o main_mpi.o scala.o asa.o lattice.o poscar.o ini.o mgrid.o xclib.o vdw_nl.o xclib_grad.o radial.o pseudo.o gridq.o ebs.o mkpoints.o wave.o wave_mpi.o wave_high.o bext.o spinsym.o symlib.o symmetry.o lattlib.o random.o nonl.o nonlr.o nonl_high.o dfast.o choleski2.o mix.o hamil.o xcgrad.o xcspin.o potex1.o potex2.o constrmag.o cl_shift.o relativistic.o LDApU.o paw_base.o metagga.o egrad.o pawsym.o pawfock.o pawlhf.o rhfatm.o hyperfine.o paw.o mkpoints_full.o charge.o Lebedev-Laikov.o stockholder.o dipol.o solvation.o pot.o dos.o elf.o tet.o tetweight.o hamil_rot.o chain.o dyna.o k-proj.o sphpro.o us.o core_rel.o aedens.o wavpre.o wavpre_noio.o broyden.o dynbr.o reader.o writer.o tutor.o xml_writer.o brent.o stufak.o fileio.o opergrid.o stepver.o chgloc.o fast_aug.o fock_multipole.o fock.o fock_dbl.o mkpoints_change.o subrot_cluster.o sym_grad.o mymath.o npt_dynamics.o subdftd3.o internals.o dynconstr.o dimer_heyden.o dvvtrajectory.o vdwforcefield.o hamil_high.o nmr.o pead.o subrot.o subrot_scf.o paircorrection.o rpa_force.o force.o pwlhf.o gw_model.o optreal.o steep.o rmm-diis.o davidson.o david_inner.o lcao_bare.o locproj.o electron.o rot.o electron_all.o shm.o pardens.o optics.o constr_cell_relax.o stm.o finite_diff.o elpol.o hamil_lr.o rmm-diis_lr.o subrot_lr.o lr_helper.o hamil_lrf.o elinear_response.o ilinear_response.o linear_optics.o setlocalpp.o wannier.o electron_OEP.o electron_lhf.o twoelectron4o.o gauss_quad.o m_unirnk.o varpro.o minimax.o mlwf.o wnpr.o ratpol.o pade_fit.o screened_2e.o wave_cacher.o crpa.o chi_base.o wpot.o local_field.o ump2.o ump2kpar.o fcidump.o ump2no.o bse_te.o bse.o acfdt.o chi.o sydmat.o rmm-diis_mlr.o linear_response_NMR.o wannier_interpol.o linear_response.o dmft.o auger.o dmatrix.o elphon.o fftmpiw.o fftmpi_map.o  fftw3d.o  fft3dlib.o /usr/lib/x86_64-linux-gnu/libfftw3.a main.o  -Llib -ldmy -L/usr/lib/x86_64-linux-gnu -lscalapack-openmpi -L/usr/lib/x86_64-linux-gnu -llapack -L/usr/lib/x86_64-linux-gnu -lf77blas -latlas 
/home/mss/miniconda3/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: warning: libblas.so.3, needed by /usr/lib/x86_64-linux-gnu/libscalapack-openmpi.so, not found (try using -rpath or -rpath-link)
/home/mss/miniconda3/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: warning: libgfortran.so.4, needed by /usr/lib/x86_64-linux-gnu/libscalapack-openmpi.so, not found (try using -rpath or -rpath-link)
/home/mss/miniconda3/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: warning: libopenblas.so.0, needed by /usr/lib/x86_64-linux-gnu/liblapack.so, not found (try using -rpath or -rpath-link)
/home/mss/miniconda3/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: warning: libopen-pal.so.20, needed by /usr/lib/x86_64-linux-gnu/libmpi_mpifh.so, not found (try using -rpath or -rpath-link)
/home/mss/miniconda3/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: warning: libopen-rte.so.20, needed by /usr/lib/x86_64-linux-gnu/libmpi.so, not found (try using -rpath or -rpath-link)
/home/mss/miniconda3/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: warning: libhwloc.so.5, needed by /usr/lib/x86_64-linux-gnu/libmpi.so, not found (try using -rpath or -rpath-link)
/home/mss/miniconda3/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: locproj.o: in function `__locproj_MOD_lprj_reader':
locproj.f90:(.text+0x82d3): undefined reference to `parse_file_C'
/home/mss/miniconda3/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: locproj.f90:(.text+0x8331): undefined reference to `fill_basis_info_C'
/home/mss/miniconda3/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: locproj.f90:(.text+0x8344): undefined reference to `free_parser_C'
/home/mss/miniconda3/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: locproj.f90:(.text+0x8d2e): undefined reference to `free_parser_C'
/home/mss/miniconda3/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: /usr/lib/x86_64-linux-gnu/libmpi.so: undefined reference to `opal_argv_append'
/home/mss/miniconda3/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: /usr/lib/x86_64-linux-gnu/liblapack.so: undefined reference to `zlauum_L_parallel'
/home/mss/miniconda3/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: /usr/lib/x86_64-linux-gnu/libmpi.so: undefined reference to `mca_base_var_get'
Does anyone encounter a similar problem with locating: libblas.so.3, libgfortran.so.4, libopenblas.so.0, libopen-pal.so.20, libopen-pal.so.20, libopen-rte.so.20, libhwloc.so.5 ?

Thank you in advance!

henrique_miranda
Global Moderator
Global Moderator
Posts: 490
Joined: Mon Nov 04, 2019 12:41 pm
Contact:

Re: compiling VASP 5.4.4.pl2 in Ubuntu 18.04.5

#2 Post by henrique_miranda » Thu Jul 08, 2021 7:01 am

This issue seems to be caused because some of your libraries depending on others dynamically but they are not on your dynamic library search paths.
The linker looks in different places for your dynamic libraries but in most cases, you just need to make sure your LD_LIBRARY_PATH includes the path where the needed libraries can be found.

Can you post your makefile.include and the output of:

Code: Select all

$ echo $LD_LIBRARY_PATH
Check if in LD_LIBRARY_PATH you find a path that contains the *.so files that are missing

If you want to understand how dynamic linking works in detail this article might be a good place to start:
https://amir.rachum.com/blog/2016/09/17 ... libraries/

nydia_varela-rosales
Newbie
Newbie
Posts: 4
Joined: Tue Jul 06, 2021 6:31 am

Re: compiling VASP 5.4.4.pl2 in Ubuntu 18.04.5

#3 Post by nydia_varela-rosales » Thu Jul 08, 2021 7:30 am

Hi!
Thank you for your answer and for the link.
When I type echo $LD_LIBRARY_PATH
I get nothing (not even a string).
This is quite strange. If a type the same in a different pc I get: /usr/local/cuda-10.1/lib64/
I attach the stdout and makefile.include that I am obtaining from the pc where I get nothing as output from echo $LD_LIBRARY_PATH
.
You do not have the required permissions to view the files attached to this post.

henrique_miranda
Global Moderator
Global Moderator
Posts: 490
Joined: Mon Nov 04, 2019 12:41 pm
Contact:

Re: compiling VASP 5.4.4.pl2 in Ubuntu 18.04.5

#4 Post by henrique_miranda » Thu Jul 08, 2021 8:57 am

Maybe this will fix your problem:

Code: Select all

$ export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu

nydia_varela-rosales
Newbie
Newbie
Posts: 4
Joined: Tue Jul 06, 2021 6:31 am

Re: compiling VASP 5.4.4.pl2 in Ubuntu 18.04.5

#5 Post by nydia_varela-rosales » Thu Jul 08, 2021 9:36 am

Thank you, I tried

Code: Select all

export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu
, but the problem still remains. I attached the new output.
Note: I make sure I erased the directories in the build folder before compiling again. When I do diff between my new stdout and the old one I get:

Code: Select all

18c18
< mpif90 -o vasp c2f_interface.o base.o profiling.o openmp.o mpi.o mpi_shmem.o smart_allocate.o xml.o constant.o jacobi.o main_mpi.o scala.o asa.o lattice.o poscar.o ini.o mgrid.o xclib.o vdw_nl.o xclib_grad.o radial.o pseudo.o gridq.o ebs.o mkpoints.o wave.o wave_mpi.o wave_high.o bext.o spinsym.o symlib.o symmetry.o lattlib.o random.o nonl.o nonlr.o nonl_high.o dfast.o choleski2.o mix.o hamil.o xcgrad.o xcspin.o potex1.o potex2.o constrmag.o cl_shift.o relativistic.o LDApU.o paw_base.o metagga.o egrad.o pawsym.o pawfock.o pawlhf.o rhfatm.o hyperfine.o paw.o mkpoints_full.o charge.o Lebedev-Laikov.o stockholder.o dipol.o solvation.o pot.o dos.o elf.o tet.o tetweight.o hamil_rot.o chain.o dyna.o k-proj.o sphpro.o us.o core_rel.o aedens.o wavpre.o wavpre_noio.o broyden.o dynbr.o reader.o writer.o tutor.o xml_writer.o brent.o stufak.o fileio.o opergrid.o stepver.o chgloc.o fast_aug.o fock_multipole.o fock.o fock_dbl.o mkpoints_change.o subrot_cluster.o sym_grad.o mymath.o npt_dynamics.o subdftd3.o internals.o dynconstr.o dimer_heyden.o dvvtrajectory.o vdwforcefield.o hamil_high.o nmr.o pead.o subrot.o subrot_scf.o paircorrection.o rpa_force.o force.o pwlhf.o gw_model.o optreal.o steep.o rmm-diis.o davidson.o david_inner.o lcao_bare.o locproj.o electron.o rot.o electron_all.o shm.o pardens.o optics.o constr_cell_relax.o stm.o finite_diff.o elpol.o hamil_lr.o rmm-diis_lr.o subrot_lr.o lr_helper.o hamil_lrf.o elinear_response.o ilinear_response.o linear_optics.o setlocalpp.o wannier.o electron_OEP.o electron_lhf.o twoelectron4o.o gauss_quad.o m_unirnk.o varpro.o minimax.o mlwf.o wnpr.o ratpol.o pade_fit.o screened_2e.o wave_cacher.o crpa.o chi_base.o wpot.o local_field.o ump2.o ump2kpar.o fcidump.o ump2no.o bse_te.o bse.o acfdt.o chi.o sydmat.o rmm-diis_mlr.o linear_response_NMR.o wannier_interpol.o linear_response.o dmft.o auger.o dmatrix.o elphon.o fftmpiw.o fftmpi_map.o  fftw3d.o  fft3dlib.o /usr/lib/x86_64-linux-gnu/libfftw3.a main.o  -Llib -ldmy -L/usr/lib/x86_64-linux-gnu -lscalapack-openmpi -L/usr/lib/x86_64-linux-gnu -llapack -L/usr/lib/x86_64-linux-gnu -lf77blas -latlas 
---
> mpif90 -o vasp c2f_interface.o base.o profiling.o openmp.o mpi.o mpi_shmem.o smart_allocate.o xml.o constant.o jacobi.o main_mpi.o scala.o asa.o lattice.o poscar.o ini.o mgrid.o xclib.o vdw_nl.o xclib_grad.o radial.o pseudo.o gridq.o ebs.o mkpoints.o wave.o wave_mpi.o wave_high.o bext.o spinsym.o symlib.o symmetry.o lattlib.o random.o nonl.o nonlr.o nonl_high.o dfast.o choleski2.o mix.o hamil.o xcgrad.o xcspin.o potex1.o potex2.o constrmag.o cl_shift.o relativistic.o LDApU.o paw_base.o metagga.o egrad.o pawsym.o pawfock.o pawlhf.o rhfatm.o hyperfine.o paw.o mkpoints_full.o charge.o Lebedev-Laikov.o stockholder.o dipol.o solvation.o pot.o dos.o elf.o tet.o tetweight.o hamil_rot.o chain.o dyna.o k-proj.o sphpro.o us.o core_rel.o aedens.o wavpre.o wavpre_noio.o broyden.o dynbr.o reader.o writer.o tutor.o xml_writer.o brent.o stufak.o fileio.o opergrid.o stepver.o chgloc.o fast_aug.o fock_multipole.o fock.o fock_dbl.o mkpoints_change.o subrot_cluster.o sym_grad.o mymath.o npt_dynamics.o subdftd3.o internals.o dynconstr.o dimer_heyden.o dvvtrajectory.o vdwforcefield.o hamil_high.o nmr.o pead.o subrot.o subrot_scf.o paircorrection.o rpa_force.o force.o pwlhf.o gw_model.o optreal.o steep.o rmm-diis.o davidson.o david_inner.o lcao_bare.o locproj.o electron.o rot.o electron_all.o shm.o pardens.o optics.o constr_cell_relax.o stm.o finite_diff.o elpol.o hamil_lr.o rmm-diis_lr.o subrot_lr.o lr_helper.o hamil_lrf.o elinear_response.o ilinear_response.o linear_optics.o setlocalpp.o wannier.o electron_OEP.o electron_lhf.o twoelectron4o.o gauss_quad.o m_unirnk.o varpro.o minimax.o mlwf.o wnpr.o ratpol.o pade_fit.o screened_2e.o wave_cacher.o crpa.o chi_base.o wpot.o local_field.o ump2.o ump2kpar.o fcidump.o ump2no.o bse_te.o bse.o acfdt.o chi.o sydmat.o rmm-diis_mlr.o linear_response_NMR.o wannier_interpol.o linear_response.o dmft.o auger.o dmatrix.o elphon.o fftmpiw.o fftmpi_map.o  fftw3d.o  fft3dlib.o /usr/lib/x86_64-linux-gnu/libfftw3.a main.o  -Llib -ldmy -L/usr/lib/x86_64-linux-gnu -lscalapack-openmpi -L/usr/lib/x86_64-linux-gnu -llapack -L/usr/lib/x86_64-linux-gnu -lf77blas -latlas
411d410
< 
So there is no change in the stdout at all. I think it makes sense that there is no change since in the makefile.include I am already calling the proper path by:

Code: Select all

LIBDIR     = /usr/lib/x86_64-linux-gnu
ATLASHOME  = $(LIBDIR)
BLAS       = -L$(ATLASHOME) -lf77blas -latlas
LAPACK     = -L$(LIBDIR) -llapack
BLACS      = 
SCALAPACK  = -L$(LIBDIR) -lscalapack-openmpi $(BLACS)
You do not have the required permissions to view the files attached to this post.

henrique_miranda
Global Moderator
Global Moderator
Posts: 490
Joined: Mon Nov 04, 2019 12:41 pm
Contact:

Re: compiling VASP 5.4.4.pl2 in Ubuntu 18.04.5

#6 Post by henrique_miranda » Thu Jul 08, 2021 10:10 am

Ok, I have to admit this was a long shot.

I looked in more detail at your output now and I see that you are using miniconda.
I think the problem stems from that.
Miniconda uses some tricks to ensure you can override the system libraries and use the ones provided by miniconda instead.

That is very likely why your LD_LIBRARY_PATH is unset:
https://docs.conda.io/projects/conda-bu ... aries.html

In your makefile, you are indicating that system libraries should be used:

Code: Select all

LIBDIR     = /usr/lib/x86_64-linux-gnu
but you are using the compiler provided by miniconda.
I think this compiler and linker searches for libraries installed by miniconda so that's why it is not able to find the additional dynamic libraries.

You should do one of the two:
1. Use the compiler from your operating system with libraries from your operating system (or preferably optimized libraries for your hardware)
You can check which compiler you are using with:

Code: Select all

$ which mpif90
2. Use the compiler provided by miniconda with libraries provided by miniconda.
I think miniconda sets LIBRARY_PATH with the locations of the libraries so you can omit -L$(LIBDIR) from your makefile.include

It is difficult to be more precise on the instructions because it strongly depends on your local environment and what compilers, libraries, package managers you are using.

nydia_varela-rosales
Newbie
Newbie
Posts: 4
Joined: Tue Jul 06, 2021 6:31 am

Re: compiling VASP 5.4.4.pl2 in Ubuntu 18.04.5

#7 Post by nydia_varela-rosales » Thu Jul 08, 2021 11:49 am

Thank you this solved my problem

Post Reply