Compilation error for abinit-9.4.2

Hi,

I’m trying to go from version 9.2.2 to 9.4.2 using the same configuration file, but it looks like some bits in 02_clib/sockets.c are causing the following errors when I run make:

sockets.c(84): error: incomplete type is not allowed
struct addrinfo hints, *res;
^

sockets.c(90): error: identifier “AI_PASSIVE” is undefined
hints.ai_flags = AI_PASSIVE;
^

sockets.c(93): warning #266: function “getaddrinfo” declared implicitly
ai_err = getaddrinfo(host, service, &hints, &res);
^

sockets.c(97): error: pointer to incomplete class type is not allowed
sockfd = socket(res->ai_family, res->ai_socktype, res->ai_protocol);
^

sockets.c(97): error: pointer to incomplete class type is not allowed
sockfd = socket(res->ai_family, res->ai_socktype, res->ai_protocol);
^

sockets.c(97): error: pointer to incomplete class type is not allowed
sockfd = socket(res->ai_family, res->ai_socktype, res->ai_protocol);
^

sockets.c(101): error: pointer to incomplete class type is not allowed
if (connect(sockfd, res->ai_addr, res->ai_addrlen) < 0)
^

sockets.c(101): error: pointer to incomplete class type is not allowed
if (connect(sockfd, res->ai_addr, res->ai_addrlen) < 0)
^

sockets.c(103): warning #266: function “freeaddrinfo” declared implicitly
freeaddrinfo(res);
^

I’ve put the contents of my configuration file below. Is there something I should change in there to sort this out?

Thanks for any help,
Ben

config file:

prefix=‘/home/bs544/local/lib/abinit-9.2.2/ben’
FC=mpiifort
CC=mpiicc
CXX=mpiicpc

FCFLAGS=“-O3 -heap-arrays 64”

enable_mpi_io=“yes”

with_optim_flavor=“aggressive”
with_mpi=“/opt/intel/oneapi/mpi/latest/”
MPI_LIBS=“-L/opt/intel/oneapi/mpi/latest/lib -lmpi_lp64”

#LINALG
with_linalg_flavor=“mkl”
wihh_fft_flavor=“dfti”

\

HDF5

with_hdf5=$HDF5_DIR

H5CC=“{HDF5_DIR}/bin/h5pcc" HDF5_CPPFLAGS="-I{HDF5_DIR}/include”
HDF5_CFLAGS=“-std=c99”
HDF5_LDFLAGS=“”
HDF5_LIBS=“-L${HDF5_DIR}/lib -lhdf5 -lhdf5_hl”

NetCDF

with_netcdf=$NETCDF_DIR

NETCDF_CPPFLAGS=“-I${NETCDF_DIR}/include”
NETCDF_FCFLAGS=“-I${NETCDF_DIR}/include”
NETCDF_LIBS=“-L${NETCDF_DIR}/lib -lnetcdf”

NetCDF-Fortran

NETCDFF_DIR=${NETCDF_FORTRAN_DIR}

with_netcdf_fortran={NETCDFF_DIR} NETCDF_FORTRAN_CPPFLAGS="-I{NETCDFF_DIR}/include"
NETCDF_FORTRAN_FCFLAGS=“-I${NETCDFF_DIR}/include”
NETCDF_FORTRAN_LIBS=“-L${NETCDFF_DIR}/lib -lnetcdff”

LibXC

LIBXC_DIR=“/home/bs544/local/lib/libxc-4.3.4/ben”

with_libxc=LIBXC_DIR LIBXC_CPPFLAGS="-I{LIBXC_DIR}/include"
LIBXC_CFLAGS=“-I${LIBXC_DIR}/include”
LIBXC_FCFLAGS=“-I${LIBXC_DIR}/include”
LIBXC_LIBS=“-L${LIBXC_DIR}/lib -lxc” #f90 -lxcf03 -lxc"

Hi,

Maybe some packages are missing depending on your OS :question:

We find /usr/include/sys/socket.h :

  • for Ubuntu 18 : libc6-dev-amd64
  • for CentOS 7 : glibc-headers-2.17-323.el7_9.x86_64
1 Like

Hi,
Currently I have the same error messages with abinit 9.10.3 on a Centos 7 cluster. My glibc-headers are updated though:

rpm -qa | grep glibc

glibc-headers-2.17-326.el7_9.x86_64
compat-glibc-2.12-4.el7.centos.x86_64
glibc-2.17-326.el7_9.x86_64
glibc-devel-2.17-326.el7_9.x86_64
compat-glibc-headers-2.12-4.el7.centos.x86_64
glibc-common-2.17-326.el7_9.x86_64

Is there a solution for this which do not imply upgrading the Centos version? Thanks in advance!

Camilo.

Hi Camilo,

I see, in the config file of bs544, that it is mentioned oneAPI suite! as compiler!

CentOS 7 (Red Hat 7) is not supported. See this link

I installed oenAPI 2023.2.1 under CentOS 7.9 and had the same problem:

fort: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.21’ not found (required by ifort)

Problem is still the same with CentOS Linux release 8.5.2111

For info, I compiled abinit 9.4.2 ( CentOS 7.9.2009 / openMPI 4.1.5 / GNU 9.3 / fallbacks ) without any problem…

A+

jmb

Hi Jean-Michel,
Many thanks for the advise. I’ll turn to gnu asap!

Regards,
Camilo.