Segmentation fault after making the abinit excutables

Hello all,

I’m trying to compile a basic parallel version of abinit. I’ve downloaded abinit-9.6.2, and configured it with the parameters below:

# MPI settings
with_mpi="yes"
enable_mpi_io="yes"

# linear algebra settings
with_linalg_flavor="netlib"
LINALG_LIBS="-L/usr/lib/x86_64-linux-gnu -llapack -lblas"

# mandatory libraries
with_libxc="yes"
with_hdf5="yes"
with_netcdf="yes"
with_netcdf_fortran="yes"

Then I run the command make -j32. I’m doing all these on a system with Intel Xeon Gold 5218 CPU, memory space 31.3 GiB, and OS Ubuntu 20.04.2 LTS with Open MPI installed.

The making process went smoothly, and I got ~/build/src/98_main/abinit executable after that. But when I tried to run:

abinit -b

the terminal returned:

Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:
#0  0x14acc82d677d in ???
#1  0x14acc82d5993 in ???
#2  0x14acc84b341f in ???
#3  0x14acc82d5e9b in ???
#4  0x14acc8454a8d in ???
#5  0x14acc84425fb in ???
#6  0x55a54ac8c851 in __m_xmpi_MOD_xmpi_init
	at ../../../../../shared/common/src/12_hide_mpi/m_xmpi.F90:763
#7  0x55a5497afaa6 in abinit
	at ../../../src/98_main/abinit.F90:202
#8  0x55a5497ba9da in main
	at ../../../src/98_main/abinit.F90:88
Segmentation fault (core dumped)

Trying to run it in parallel by using:

mpirun -np 4 abinit -b

also returned a similar error, all four processes were killed by signal 11 (segmentation fault).

I’ve also installed mkl (libmkl-full-dev) as the default alternative for blas and lapack, could this be the problem?

Hi,

perhaps a problem of library during link…

what is the output of

ldd abinit

Hi, thanks for your reply.

The output of ldd abinit is:

	linux-vdso.so.1 (0x00007ffdf45e1000)
	libxc.so.5 => /usr/lib/x86_64-linux-gnu/libxc.so.5 (0x00001516103d3000)
	liblapack.so => /usr/lib/x86_64-linux-gnu/liblapack.so (0x000015160fcf3000)
	libnetcdff.so.7 => /usr/lib/x86_64-linux-gnu/libnetcdff.so.7 (0x000015160fc75000)
	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x000015160fc50000)
	libgfortran.so.4 => /usr/lib/x86_64-linux-gnu/libgfortran.so.4 (0x000015160fa6f000)
	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x000015160f920000)
	libmpi_mpifh.so.40 => /usr/lib/x86_64-linux-gnu/libmpi_mpifh.so.40 (0x000015160f8bb000)
	libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x000015160f8a0000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x000015160f6ae000)
	libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x000015160f6a6000)
	libnetcdf.so.15 => /usr/lib/x86_64-linux-gnu/libnetcdf.so.15 (0x000015160f581000)
	libgfortran.so.5 => /usr/lib/x86_64-linux-gnu/libgfortran.so.5 (0x000015160f2b9000)
	/lib64/ld-linux-x86-64.so.2 (0x0000151616ad9000)
	libquadmath.so.0 => /usr/lib/x86_64-linux-gnu/libquadmath.so.0 (0x000015160f26f000)
	libmpi.so.40 => /usr/lib/x86_64-linux-gnu/libmpi.so.40 (0x000015160f14a000)
	libopen-pal.so.40 => /usr/lib/x86_64-linux-gnu/libopen-pal.so.40 (0x000015160f09c000)
	libhdf5_serial_hl.so.100 => /usr/lib/x86_64-linux-gnu/libhdf5_serial_hl.so.100 (0x000015160f073000)
	libhdf5_serial.so.103 => /usr/lib/x86_64-linux-gnu/libhdf5_serial.so.103 (0x000015160ecf6000)
	libcurl-gnutls.so.4 => /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4 (0x000015160ec67000)
	libopen-rte.so.40 => /usr/lib/x86_64-linux-gnu/libopen-rte.so.40 (0x000015160ebad000)
	libhwloc.so.15 => /usr/lib/x86_64-linux-gnu/libhwloc.so.15 (0x000015160eb5c000)
	libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x000015160eb55000)
	libevent-2.1.so.7 => /usr/lib/x86_64-linux-gnu/libevent-2.1.so.7 (0x000015160eaff000)
	libevent_pthreads-2.1.so.7 => /usr/lib/x86_64-linux-gnu/libevent_pthreads-2.1.so.7 (0x000015160eafa000)
	libsz.so.2 => /usr/lib/x86_64-linux-gnu/libsz.so.2 (0x000015160eaf5000)
	libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x000015160ead9000)
	libnghttp2.so.14 => /usr/lib/x86_64-linux-gnu/libnghttp2.so.14 (0x000015160eab0000)
	libidn2.so.0 => /usr/lib/x86_64-linux-gnu/libidn2.so.0 (0x000015160ea8d000)
	librtmp.so.1 => /usr/lib/x86_64-linux-gnu/librtmp.so.1 (0x000015160ea6d000)
	libssh.so.4 => /usr/lib/x86_64-linux-gnu/libssh.so.4 (0x000015160e9ff000)
	libpsl.so.5 => /usr/lib/x86_64-linux-gnu/libpsl.so.5 (0x000015160e9ec000)
	libnettle.so.7 => /usr/lib/x86_64-linux-gnu/libnettle.so.7 (0x000015160e9b2000)
	libgnutls.so.30 => /usr/lib/x86_64-linux-gnu/libgnutls.so.30 (0x000015160e7dc000)
	libgssapi_krb5.so.2 => /usr/lib/x86_64-linux-gnu/libgssapi_krb5.so.2 (0x000015160e78d000)
	libldap_r-2.4.so.2 => /usr/lib/x86_64-linux-gnu/libldap_r-2.4.so.2 (0x000015160e737000)
	liblber-2.4.so.2 => /usr/lib/x86_64-linux-gnu/liblber-2.4.so.2 (0x000015160e726000)
	libbrotlidec.so.1 => /usr/lib/x86_64-linux-gnu/libbrotlidec.so.1 (0x000015160e718000)
	libudev.so.1 => /lib/x86_64-linux-gnu/libudev.so.1 (0x000015160e6eb000)
	libltdl.so.7 => /usr/lib/x86_64-linux-gnu/libltdl.so.7 (0x000015160e6e0000)
	libaec.so.0 => /usr/lib/x86_64-linux-gnu/libaec.so.0 (0x000015160e6d5000)
	libunistring.so.2 => /usr/lib/x86_64-linux-gnu/libunistring.so.2 (0x000015160e553000)
	libhogweed.so.5 => /usr/lib/x86_64-linux-gnu/libhogweed.so.5 (0x000015160e51c000)
	libgmp.so.10 => /usr/lib/x86_64-linux-gnu/libgmp.so.10 (0x000015160e498000)
	libcrypto.so.1.1 => /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1 (0x000015160e1c2000)
	libp11-kit.so.0 => /usr/lib/x86_64-linux-gnu/libp11-kit.so.0 (0x000015160e08a000)
	libtasn1.so.6 => /usr/lib/x86_64-linux-gnu/libtasn1.so.6 (0x000015160e074000)
	libkrb5.so.3 => /usr/lib/x86_64-linux-gnu/libkrb5.so.3 (0x000015160df97000)
	libk5crypto.so.3 => /usr/lib/x86_64-linux-gnu/libk5crypto.so.3 (0x000015160df66000)
	libcom_err.so.2 => /lib/x86_64-linux-gnu/libcom_err.so.2 (0x000015160df5f000)
	libkrb5support.so.0 => /usr/lib/x86_64-linux-gnu/libkrb5support.so.0 (0x000015160df50000)
	libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x000015160df32000)
	libsasl2.so.2 => /usr/lib/x86_64-linux-gnu/libsasl2.so.2 (0x000015160df15000)
	libgssapi.so.3 => /usr/lib/x86_64-linux-gnu/libgssapi.so.3 (0x000015160ded0000)
	libbrotlicommon.so.1 => /usr/lib/x86_64-linux-gnu/libbrotlicommon.so.1 (0x000015160dead000)
	libffi.so.7 => /usr/lib/x86_64-linux-gnu/libffi.so.7 (0x000015160dea1000)
	libkeyutils.so.1 => /lib/x86_64-linux-gnu/libkeyutils.so.1 (0x000015160de98000)
	libheimntlm.so.0 => /usr/lib/x86_64-linux-gnu/libheimntlm.so.0 (0x000015160de8c000)
	libkrb5.so.26 => /usr/lib/x86_64-linux-gnu/libkrb5.so.26 (0x000015160ddf9000)
	libasn1.so.8 => /usr/lib/x86_64-linux-gnu/libasn1.so.8 (0x000015160dd52000)
	libhcrypto.so.4 => /usr/lib/x86_64-linux-gnu/libhcrypto.so.4 (0x000015160dd1a000)
	libroken.so.18 => /usr/lib/x86_64-linux-gnu/libroken.so.18 (0x000015160dcff000)
	libwind.so.0 => /usr/lib/x86_64-linux-gnu/libwind.so.0 (0x000015160dcd5000)
	libheimbase.so.1 => /usr/lib/x86_64-linux-gnu/libheimbase.so.1 (0x000015160dcc3000)
	libhx509.so.5 => /usr/lib/x86_64-linux-gnu/libhx509.so.5 (0x000015160dc75000)
	libsqlite3.so.0 => /usr/lib/x86_64-linux-gnu/libsqlite3.so.0 (0x000015160db4c000)
	libcrypt.so.1 => /lib/x86_64-linux-gnu/libcrypt.so.1 (0x000015160db11000)

And speaking of the library, I remember another issue occurred during the installation of hdf5-dev via apt. The terminal reported a dependency error about libjpeg-dev that apt cannot solve, so I tried to install it first, which led to a series of dependency errors, at the end of that series is a similar issue like this. I tried to install gfortran-7 as that post suggested, then finished the installation of hdf5-dev without further issues. Could this be related?

Hi,

In the output of the ldd command, I notice that there are 2 versions of the libgfortran.so library : libgfortran.so.4 and libgfortran.so.5 : it’s the problem… but how it happened… during an OS upgrade?

I started from scratch :
-minimum installation of Ubuntu 20.04.4 LTS
-installation of these packages :

  • apt install make patch m4
  • apt install gfortran g++ ( => version 9.4 )
  • apt install libopenmpi-dev
  • apt install libhdf5-dev libnetcdf-dev libnetcdff-dev libxc-dev
  • apt install libmkl-sequential libmkl-core libmkl-gf-lp64 libmkl-interface-dev libmkl-dev
  • apt install libpython3.8-dev

-my ac9 file :

# MPI settings
with_mpi="yes"
enable_mpi_io="yes"

# linear algebra settings
with_linalg_flavor="mkl"
LINALG_CPPFLAGS="-I/usr/include/mkl"
LINALG_FCFLAGS="-I/usr/include/mkl/intel64/lp64"
LINALG_LIBS="-L/usr/lib/x86_64-linux-gnu -Wl,--start-group  -lmkl_gf_lp64 -lmkl_sequential -lmkl_core -Wl,--end-group"

with_fft_flavor="dfti"
FFT_FCFLAGS="-I/usr/includei/mkl"

# mandatory libraries
with_libxc="yes"
with_hdf5="yes"
with_netcdf="yes"
with_netcdf_fortran="yes"

-compilation : OK ( only libgfortran.so.5 library :wink: )
-all tests pass :slight_smile:

jmb

Thanks very much! Seems indeed an env problem. This system has too many messy packages to fix on my own, but I’m the sole user of it now, so I just reinstalled everything and started from scratch, and problem solved I think? At least test run was finished cleanly.
Thanks again, I know this (restarting everything in a clean environment) is not a doable solution for everyone who might also be reading this thread, but the problem is very much like the different versions of the same library.

1 Like