Hello everyone,
I’m trying building the mpi using MPI and Fortran 10+ , but I’ve faced the following compilation errors:
/usr/bin/ld: cannot find -lmpi_usempif08: Datei oder Verzeichnis nicht gefunden
/usr/bin/ld: cannot find -lmpi_usempi_ignore_tkr: Datei oder Verzeichnis nicht gefunden
/usr/bin/ld: cannot find -lmpi_mpifh: Datei oder Verzeichnis nicht gefunden
/usr/bin/ld: cannot find -lopen-rte: Datei oder Verzeichnis nicht gefunden
/usr/bin/ld: cannot find -lopen-pal: Datei oder Verzeichnis nicht gefunden
/usr/bin/ld: cannot find -levent_core: Datei oder Verzeichnis nicht gefunden
/usr/bin/ld: cannot find -levent_pthreads: Datei oder Verzeichnis nicht gefunden
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile.mkmf:5240: exciting] Fehler 1
make[3]: Verzeichnis „/temp_local/…/exciting/build/mpi“ wird verlassen
make[2]: *** […/Make.common:93: bin] Fehler 2
make[2]: Verzeichnis „/temp_local/…/exciting/build/mpi“ wird verlassen
make[1]: *** [Makefile:6: all] Fehler 2
make[1]: Verzeichnis „/temp_local/…/exciting/build/mpi“ wird verlassen
make: *** [Makefile:26: mpi] Fehler 2
I modified my Makefile as follows:
F90 = gfortran
F77 = $(F90)
FCCPP = cpp
F90_OPTS = -O3 -march=native -ffree-line-length-0 -fallow-argument-mismatch
F77_OPTS = -O3 -fallow-argument-mismatch
F90_DEBUGOPTS = -g -O0 -DUSE_ASSERT -fbounds-check -fbacktrace -Wall -Wextra -ffree-line-length-0 -fcheck=all -finit-integer=42 -frecord-gcc-switches -finit-character=42 -finit-logical=true -ffpe-trap=invalid,zero,overflow -fdump-core -fstack-protector
F77_DEBUGOPTS = $(F90_DEBUGOPTS)
CPP_ON_OPTS = -cpp -DXS -DISO -DLIBXC
export USE_SYS_LAPACK = true
LIB_LPK = -L./ -llapack -lblas
MPI_LIBS =
LIB_FFT = fftlib.a
LIB_BZINT = libbzint.a
LIBS = (LIB_LPK) (LIB_FFT) $(LIB_BZINT)
MPIF90 = mpif90
MPIF77 = mpif77
MPIF77_OPTS = $(MPIF90_OPTS)
MPIF90 = mpif90
MPIF90_OPTS = -fopenmp -DUSEOMP -DSCAL -DMPI -I/usr/lib/x86_64-linux-gnu/fortran/gfortran-mod-15/mpich -I/usr/lib/x86_64-linux-gnu/openmpi/include -I/usr/lib/x86_64-linux-gnu/openmpi/include/openmpi
SMPF90_OPTS = -fopenmp -DUSEOMP
SMPF77_OPTS = $(SMPF90_OPTS)
SMP_LIBS =
BUILDMPI = true
BUILDSMP = true
BUILDMPISMP = true
my steps to solve:
- Ensured all the mentioned libraries (e.g.,
libevent_pthreads
,libevent_core
, etc.) are installed at/usr/lib/x86_64-linux-gnu/
. - Updated the library paths in the bash environment variables.
- Attempted to explicitly define
MPI_LIBS
in the Makefile, but no success.