cannot find -lscalapack / -lhdf5_fortran

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


Moderators: Global Moderator, Moderator

Post Reply
Message
Author
mateusz_balcerzak
Newbie
Newbie
Posts: 1
Joined: Mon Jan 06, 2025 9:39 am

cannot find -lscalapack / -lhdf5_fortran

#1 Post by mateusz_balcerzak » Fri Jan 10, 2025 12:18 pm

Hello,

In short:
we are trying to install vasp.6.5.0 according to wiki/index.php/Personal_computer_instal ... _Debian_12, but we always get the Error

cannot find -lscalapack: Datei oder Verzeichnis nicht gefunden
cannot find -lhdf5_fortran: Datei oder Verzeichnis nicht gefunden

We think it has something to do with the ROOT-paths, but actually you are supposed to leave them commented out? We installed with the simple command in the instructions:

Code: Select all

sudo apt install rsync make build-essential g++ gfortran libopenblas-dev libopenmpi-dev libscalapack-openmpi-dev libfftw3-dev libhdf5-openmpi-dev

Little longer:

We tried and changed multiple things and always tried to compile with commands make std, make all, make DEPS=1 -j, make DEPS=1 -j64 std.
First we got the error

Fatal Error: Cannot open module file ‘hdf5.mod’ for reading at (1): Datei oder Verzeichnis nicht gefunden

We changed:
- Comment or uncommented ROOT lines (e.g. #HDF5_ROOT ?= /path/to/your/hdf5/installation)
- Setting HDF5 path to : "/usr/lib/x86_64-linux-gnu" where we installed:

Code: Select all

ii  hdf5-helpers                                     1.10.8+repack1-1                        amd64        HDF5 - Helper tools
ii  libhdf5-103-1:amd64                              1.10.8+repack1-1                        amd64        HDF5 C runtime files - serial version
ii  libhdf5-cpp-103-1:amd64                          1.10.8+repack1-1                        amd64        HDF5 - C++ runtime files - serial version
ii  libhdf5-dev                                      1.10.8+repack1-1                        amd64        HDF5 - development files - serial version
ii  libhdf5-fortran-102:amd64                        1.10.8+repack1-1                        amd64        HDF5 Fortran runtime files - serial version
ii  libhdf5-hl-100:amd64                             1.10.8+repack1-1                        amd64        HDF5 High Level runtime files - serial version
ii  libhdf5-hl-cpp-100:amd64                         1.10.8+repack1-1                        amd64        HDF5 High Level C++ runtime files - serial version
ii  libhdf5-hl-fortran-100:amd64                     1.10.8+repack1-1                        amd64        HDF5 High Level Fortran runtime files - serial version
ii  libhdf5-mpi-dev                                  1.10.8+repack1-1                        amd64        HDF5 - development files - default MPI version
ii  libhdf5-mpich-103-1:amd64                        1.10.8+repack1-1                        amd64        HDF5 - C runtime files - MPICH2 version
ii  libhdf5-mpich-cpp-103-1:amd64                    1.10.8+repack1-1                        amd64        HDF5 - C++ runtime files - MPICH2 version - unsupported
ii  libhdf5-mpich-dev                                1.10.8+repack1-1                        amd64        HDF5 - development files - MPICH2 version
ii  libhdf5-mpich-fortran-102:amd64                  1.10.8+repack1-1                        amd64        HDF5 Fortran runtime files - MPICH2 version
ii  libhdf5-mpich-hl-100:amd64                       1.10.8+repack1-1                        amd64        HDF5 High Level runtime files - MPICH2 version
ii  libhdf5-mpich-hl-cpp-100:amd64                   1.10.8+repack1-1                        amd64        HDF5 High Level C++ runtime files - MPICH2 version - unsupported
ii  libhdf5-mpich-hl-fortran-100:amd64               1.10.8+repack1-1                        amd64        HDF5 High Level Fortran runtime files - MPICH2 version
ii  libhdf5-openmpi-103-1:amd64                      1.10.8+repack1-1                        amd64        HDF5 - C runtime files - OpenMPI version
ii  libhdf5-openmpi-cpp-103-1:amd64                  1.10.8+repack1-1                        amd64        HDF5 - C++ runtime files - OpenMPI version - unsupported
ii  libhdf5-openmpi-dev                              1.10.8+repack1-1                        amd64        HDF5 - development files - OpenMPI version
ii  libhdf5-openmpi-fortran-102:amd64                1.10.8+repack1-1                        amd64        HDF5 Fortran runtime files - OpenMPI version
ii  libhdf5-openmpi-hl-100:amd64                     1.10.8+repack1-1                        amd64        HDF5 High Level runtime files - OpenMPI version
ii  libhdf5-openmpi-hl-cpp-100:amd64                 1.10.8+repack1-1                        amd64        HDF5 High Level C++ runtime files - OpenMPI version - unsupported
ii  libhdf5-openmpi-hl-fortran-100:amd64             1.10.8+repack1-1                        amd64        HDF5 High Level Fortran runtime files - OpenMPI version

- Setting HDF5 path to : "/HDF_Group/HDF5/1.14.5/" where we installed the HDF5 version from the official website:

Code: Select all

ii  hdf5                                             1.14.5                                  amd64        HDF5 version 1.14.5 released on 2024-09-30

- Setting HDF5 path to : "/usr", because in /usr/include/ is a hdf5 directory

Code: Select all

/usr/include/hdf5$ ls
mpich  openmpi	serial

Since the last change we can run make std and it runs for quite some time (30 min) until the following output with the previously mentioned error arises:

Code: Select all

mpif90 -fopenmp -o vasp c2f_interface.o simd.o base.o string.o tutor.o version.o build_info.o command_line.o vhdf5_base.o incar_reader.o reader_base.o openmp_struct.o openacc_struct.o offload_st                                           ruct.o mpi.o mpi_shmem.o main_mpi.o mathtools.o profiling.o bse_struct.o mgrid_struct.o pot_struct.o hamil_struct.o radial_struct.o pseudo_struct.o wave_struct.o nl_struct.o mkpoints_struct.o ba                                           ndgap_struct.o poscar_struct.o esf_struct.o afqmc_struct.o minimax_struct.o setex_struct.o locproj_struct.o fock_glb.o chi_glb.o smart_allocate.o xml.o constant.o plugins.o ml_ff_c2f_interface.o                                            ml_ff_prec.o ml_ff_string.o ml_ff_tutor.o ml_ff_constant.o ml_ff_mpi_help.o ml_ff_neighbor.o ml_ff_taglist.o ml_ff_struct.o ml_ff_mpi_shmem.o vdwforcefield_glb.o jacobi.o scala_struct.o ini.o s                                           cala.o nvcuda.o crayhip.o intelmkl.o openmp.o openacc.o offload.o scalapack_wrappers.o blas_wrappers.o lapack_wrappers.o asa.o lattice.o poscar.o fft_comm.o fftw.o fft_wrappers.o fft_base.o mgri                                           d.o libmbd.o ml_asa2.o ml_ff_mpi.o ml_ff_helper.o ml_ff_logfile.o ml_ff_math.o ml_ff_iohandle.o ml_ff_memory.o ml_ff_abinitio.o ml_ff_ff2.o ml_ff_ff3.o ml_ff_ff.o ml_ff_mlff.o vaspml.o ldalib.o                                            wpbe.o ggalib.o mbj.o mggalib.o vdw_nl.o xc_driver.o setex.o pseudo.o radial.o gridq.o coulomb_cutoff.o ebs.o symlib.o gauss_quad.o m_unirnk.o mkpoints.o random.o wave.o wave_mpi.o wave_high.o b                                           ext.o spinsym.o symmetry.o lattlib.o nonl.o nonlr.o nonl_high.o dfast.o choleski2.o mix.o hamil.o constrmag.o cl_shift.o relativistic.o LDApU.o paw_base.o tau_mu.o fexcg.o egrad.o pawsym.o pawfo                                           ck.o pawlhf.o diis.o rhfatm.o hyperfine.o fock_ace.o mkpoints_full.o charge.o us.o extpot.o paw.o Lebedev-Laikov.o stockholder.o pot_electrostat.o dipol.o solvation.o scpc.o fermi_energy.o tet.o                                            dos.o elf.o hamil_rot.o chain.o dyna.o fileio.o vhdf5.o bandgap_tools.o pot.o sphpro.o core_rel.o aedens.o wavpre.o wavpre_noio.o broyden.o dynbr.o reader.o writer.o xml_writer.o brent.o stufak                                           .o opergrid.o stepver.o fast_aug.o fock_multipole.o fock.o fock_dbl.o fock_frc.o supercell.o mkpoints_change.o subrot_cluster.o sym_grad.o mymath.o npt_dynamics.o subdftd3.o subdftd4.o internals                                           .o dynconstr.o dimer_heyden.o dvvtrajectory.o vdwforcefield.o nmr.o pead.o k-proj.o subrot.o subrot_scf.o paircorrection.o rpa_force.o ml_reader.o ml_interface_writer.o ml_interface.o coulomb_cu                                           toff_gradients.o force.o pwlhf.o gw_model.o optreal.o steep.o rmm-diis.o davidson.o david_full.o david_inner.o root_find.o lcao_bare.o locproj.o electron_common.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 setlo                                           calpp.o wannier.o electron_OEP.o electron_lhf.o twoelectron4o.o minimax_ini.o minimax_dependence.o minimax_functions1D.o minimax_functions2D.o minimax_varpro.o minimax.o umco.o mlwf.o ratpol.o p                                           ade_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_lanczos.o bse.o bse_driver.o time_propagation.o esf.o acfdt.o afqmc                                           .o rpax.o chi.o dmft.o GG_base.o acfdt_GG.o greens_orbital.o lt_mp2.o rnd_orb_mp2.o greens_real_space.o chi_GG.o chi_super.o sydmat.o rmm-diis_mlr.o linear_response_NMR.o wannier_interpol.o wave                                           _interpolate.o wave_rotator.o wave_window.o wap.o elphon_potential_struct.o elphon_base.o elphon_triplets.o elphon_potential.o elphon_accumulators.o elphon_kgrid.o transport.o elphon_common.o el                                           phon_mels.o elphon_selfen_ph.o elphon_driver.o linear_response.o auger.o dmatrix.o phonon.o elphon_derivative.o wannier_mats.o elphon.o core_con_mat.o embed.o rpa_high.o  main.o  -Llib -ldmy -Lp                                           arser -lparser -lstdc++ -L/usr/lib/x86_64-linux-gnu/lib -lscalapack -L/usr/lib/x86_64-linux-gnu/lib -lopenblas -L/usr/lib -lfftw3 -lfftw3_omp -L/usr/lib -lhdf5_fortran
/usr/bin/ld: cannot find -lscalapack: Datei oder Verzeichnis nicht gefunden
/usr/bin/ld: cannot find -lhdf5_fortran: Datei oder Verzeichnis nicht gefunden
collect2: error: ld returned 1 exit status
make[2]: *** [makefile:153: vasp] Fehler 1
make[2]: Verzeichnis „/software/VASP/vasp.6.5.0/build/std“ wird verlassen
cp: der Aufruf von stat für 'vasp' ist nicht möglich: Datei oder Verzeichnis nicht gefunden
make[1]: *** [makefile:150: all] Fehler 1
make[1]: Verzeichnis „/software/VASP/vasp.6.5.0/build/std“ wird verlassen
make: *** [makefile:17: std] Fehler 2

our makefile.include:

Code: Select all

# Default precompiler options
CPP_OPTIONS = -DHOST=\"LinuxGNU\" \
              -DMPI -DMPI_BLOCK=8000 -Duse_collective \
              -DscaLAPACK \
              -DCACHE_SIZE=4000 \
              -Davoidalloc \
              -Dvasp6 \
              -Dtbdyn \
              -Dfock_dblbuf \
              -D_OPENMP

CPP         = gcc -E -C -w $*$(FUFFIX) >$*$(SUFFIX) $(CPP_OPTIONS)

FC          = mpif90 -fopenmp
FCL         = mpif90 -fopenmp

FREE        = -ffree-form -ffree-line-length-none

FFLAGS      = -w -ffpe-summary=none

OFLAG       = -O2
OFLAG_IN    = $(OFLAG)
DEBUG       = -O0

# For what used to be vasp.5.lib
CPP_LIB     = $(CPP)
FC_LIB      = $(FC)
CC_LIB      = gcc
CFLAGS_LIB  = -O
FFLAGS_LIB  = -O1
FREE_LIB    = $(FREE)

OBJECTS_LIB = linpack_double.o

# For the parser library
CXX_PARS    = g++
LLIBS       = -lstdc++

##
## Customize as of this point! Of course you may change the preceding
## part of this file as well if you like, but it should rarely be
## necessary ...
##

# When compiling on the target machine itself, change this to the
# relevant target when cross-compiling for another architecture
VASP_TARGET_CPU ?= -march=native
FFLAGS     += $(VASP_TARGET_CPU)

# For gcc-10 and higher (comment out for older versions)
FFLAGS     += -fallow-argument-mismatch

# BLAS and LAPACK (mandatory)
OPENBLAS_ROOT ?= /usr/lib/x86_64-linux-gnu
BLASPACK    = -L$(OPENBLAS_ROOT)/lib -lopenblas

# scaLAPACK (mandatory)
SCALAPACK_ROOT ?= /usr/lib/x86_64-linux-gnu
SCALAPACK   = -L$(SCALAPACK_ROOT)/lib -lscalapack

LLIBS      += $(SCALAPACK) $(BLASPACK)

# FFTW (mandatory)
FFTW_ROOT  ?= /usr
LLIBS      += -L$(FFTW_ROOT)/lib -lfftw3 -lfftw3_omp
INCS       += -I$(FFTW_ROOT)/include

# HDF5-support (optional but strongly recommended, and mandatory for some features)
#CPP_OPTIONS+= -DVASP_HDF5
HDF5_ROOT  ?= /usr
LLIBS      += -L$(HDF5_ROOT)/lib -lhdf5_fortran
INCS       += -I$(HDF5_ROOT)/include

# For the VASP-2-Wannier90 interface (optional)
#CPP_OPTIONS    += -DVASP2WANNIER90
#WANNIER90_ROOT ?= /path/to/your/wannier90/installation
#LLIBS          += -L$(WANNIER90_ROOT)/lib -lwannier

# For the fftlib library (recommended)
#CPP_OPTIONS+= -Dsysv
#FCL        += fftlib.o
#CXX_FFTLIB  = g++ -fopenmp -std=c++11 -DFFTLIB_THREADSAFE
#INCS_FFTLIB = -I./include -I$(FFTW_ROOT)/include
#LIBS       += fftlib
#LLIBS      += -ldl

# For machine learning library vaspml (experimental)
#CPP_OPTIONS += -Dlibvaspml
#CPP_OPTIONS += -DVASPML_USE_CBLAS
#CPP_OPTIONS += -DVASPML_DEBUG_LEVEL=3
#CXX_ML      = mpic++ -fopenmp
#CXXFLAGS_ML = -O3 -std=c++17 -pedantic-errors -Wall -Wextra
#INCLUDE_ML  = -I$(OPENBLAS_ROOT)/include

Thank you very much for your help!


christopher_sheldon1
Global Moderator
Global Moderator
Posts: 74
Joined: Mon Mar 25, 2024 1:36 pm

Re: cannot find -lscalapack / -lhdf5_fortran

#2 Post by christopher_sheldon1 » Fri Jan 10, 2025 2:18 pm

Hi Mateusz,

Thank you for your message. The procedure that you've followed seems good. It looks like an issue with HDF5. Could you try compiling without HDF5? That's these lines in makefile.include:

Code: Select all

HDF5_ROOT  ?= /usr
LLIBS      += -L$(HDF5_ROOT)/lib -lhdf5_fortran
INCS       += -I$(HDF5_ROOT)/include

On the part of the ScalaPACK, you could try compiling without it by removing the line containing -DscaLAPACK, which for you is:

Code: Select all

# Default precompiler options
CPP_OPTIONS = -DHOST=\"LinuxGNU\" \
              -DMPI -DMPI_BLOCK=8000 -Duse_collective \
              -DscaLAPACK \
              -DCACHE_SIZE=4000 \
              -Davoidalloc \
              -Dvasp6 \
              -Dtbdyn \
              -Dfock_dblbuf \
              -D_OPENMP

Best wishes,

Chris


Post Reply