Build error in PARSER_exp.c

Having trouble compiling the Yambo source? Using an unusual architecture? Problems with the "configure" script? Problems in GPU architectures? This is the place to look.

Moderators: Davide Sangalli, andrea.ferretti, myrta gruning, andrea marini, Daniele Varsano, Conor Hogan, Nicola Spallanzani

Forum rules
If you have trouble compiling Yambo, please make sure to list:
(1) the compiler (vendor and release: e.g. intel 10.1)
(2) the architecture (e.g. 64-bit IBM SP5)
(3) if the problems occur compiling in serial/in parallel
(4) the version of Yambo (revision number/major release version)
(5) the relevant compiler error message
Post Reply
jmcastelo
Posts: 8
Joined: Tue Nov 12, 2024 1:41 pm

Build error in PARSER_exp.c

Post by jmcastelo » Wed Oct 15, 2025 7:20 pm

Dear colleagues.

I've tried to build Yambo 5.3.0 and also 5.2.4 by cloning the official repository and checking to their respective tags (also tried the releases without success). The system is an HPC Linux cluster (Lynx), where I have built all dependencies using GCC and OpenMPI. The only dependencies I let Yambo build are iotk and devicexlib.

The same error happens no matter what Yambo version I tried. It is related to "gsl_complex" and "PARSER_exp.c". After a long search, I cannot find any fix, so I kindly ask you for help.

This is my configuration script:

Code: Select all

#!/bin/bash

OBLAS_DIR="/workshop/software/openblas/0.3.30"
FFTW_DIR="/workshop/software/fftw/3.3.10"
SLEPC_DIR="/workshop/software/slepc/3.24.0"
PETSC_DIR="/workshop/software/petsc/3.24.0"
SCALA_DIR="/workshop/software/scalapack/2.2.2"
HDF5_DIR="/workshop/software/pHDF5/1.14.6"
NC_DIR="/workshop/software/netcdf-c/4.9.3"
NF_DIR="/workshop/software/netcdf-fortran/4.6.2"
LIBXC_DIR="/workshop/software/libxc/6.2.2"

YAMBO_LIBS_DIR="${HOME}/source-code/yambo-libs"

export CC=gcc
export FC=gfortran
export MPICC=mpicc
export MPIFC=mpifort

./configure \
--enable-msgs-comps \
--enable-time-profile \
--enable-mpi \
--enable-iotk \
--without-editor \
--enable-memory-profile \
--enable-slepc-linalg \
--enable-hdf5-par-io \
--with-blas-libs="-L${OBLAS_DIR}/lib -lopenblas" \
--with-lapack-libs="-L${OBLAS_DIR}/lib -lopenblas" \
--with-fft-path=${FFTW_DIR} \
--with-slepc-path=${SLEPC_DIR} \
--with-petsc-path=${PETSC_DIR} \
--with-blacs-libs="-L${SCALA_DIR}/lib -lscalapack" \
--with-scalapack-libs="-L${SCALA_DIR}/lib -lscalapack" \
--with-hdf5-path=${HDF5_DIR} \
--with-netcdf-path=${NC_DIR} \
--with-netcdff-path=${NF_DIR} \
--with-libxc-path=${LIBXC_DIR} \
--with-extlibs-path="${YAMBO_LIBS_DIR}"
The configuration systems seems to have caught everything right:

Code: Select all

#
# [VER] 5.3
#
# Legend: [E]=external library [C]=internal lib to be compiled [I]=internal lib already compiled [X]=used [-]=not used
#
# - GENERAL CONFIGURATIONS -
#
# [SYS] linux@x86_64
# [SRC] /home/jmcastelo/source-code/yambo
# [BRN] (HEAD
# [CMP] /home/jmcastelo/source-code/yambo
# [TGT] /home/jmcastelo/source-code/yambo
# [BIN] /home/jmcastelo/source-code/yambo/bin
# [LIB] /home/jmcastelo/source-code/yambo-libs/gfortran/mpifort
#
# [EDITOR] none
# [ MAKE ] make
#
# [-] Double precision
# [X] Keep object files
# [X] Run-Time timing profile
# [X] Run-Time memory profile
#
# - SCRIPTS -
#
# [-] YDB: Yambo DataBase
# [-] YAMBOpy: Yambo Python scripts
#
# - PARALLEL/GPU SUPPORT -
#
# [-] GPU support ( no_gpu )
# [E] MPI
# [-] OpenMP
#
# - I/O -
#
# [X]: Parallel I/O (via HDF5)
# [E]: HDF5 Parallel_lib
# [E]: NETCDF Large Files Support enabled, Version 4
#
# - LIBRARIES -
#
# > I/O: NETCDF Large Files Support enabled, Version 4, HDF5 Parallel_lib
#
# [I] IOTK      : -L(LIB)/lib -liotk (QE hdf5-support)
#                 -I(LIB)/include/
# [-] ETSF_IO   :
#
# [E] NETCDFF   : -L/workshop/software/netcdf-fortran/4.6.2/lib -lnetcdff
#                 -I/workshop/software/netcdf-fortran/4.6.2/include
# [E] NETCDF    : -L/workshop/software/netcdf-c/4.9.3/lib -lnetcdf
#                 -I/workshop/software/netcdf-c/4.9.3/include
# [E] HDF5      : -L/workshop/software/pHDF5/1.14.6/lib -lhdf5hl_fortran -lhdf5_fortran -lhdf5_hl -lhdf5
#                 -I/workshop/software/pHDF5/1.14.6/include
#
# > MATH: (FFTW v3)
#
# [E] BLAS      : -L/workshop/software/openblas/0.3.30/lib -lopenblas (for petsc: -L/workshop/software/openblas/0.3.30/lib -lopenblas)
# [E] LAPACK    : -L/workshop/software/openblas/0.3.30/lib -lopenblas (for petsc: -L/workshop/software/openblas/0.3.30/lib -lopenblas)
# [E] SCALAPACK : -L/workshop/software/scalapack/2.2.2/lib -lscalapack
# [E] BLACS     : -L/workshop/software/scalapack/2.2.2/lib -lscalapack
# [E] FFT       : -L/workshop/software/fftw/3.3.10/lib -lfftw3
#                 -I/workshop/software/fftw/3.3.10/include
# [E] PETSC     : -L/workshop/software/petsc/3.24.0/lib -lpetsc -ldl
#                 -I/workshop/software/petsc/3.24.0/include
# [E] SLEPC     : -L/workshop/software/slepc/3.24.0/lib -lslepc
#                 -I/workshop/software/slepc/3.24.0/include
#
# > OTHERs:
#
# [E] LibXC     : -L/workshop/software/libxc/6.2.2/lib -lxcf90 -lxcf03 -lxc
#                 -I/workshop/software/libxc/6.2.2/include
# [I] DevXlib   : -L(LIB)/no_gpu/lib -ldevXlib
#                 -I(LIB)/no_gpu/include
# [-] LibCUDA   :
#
# [E] MPI       : gcc -I/usr/include -Wl,-rpath -Wl,/usr/lib -Wl,--enable-new-dtags -lmpi
#                 -I/usr/include
#
# - COMPILERS -
#
# FC kind = gfortran GNU Fortran (GCC) 15.1.1 20250425
# MPI kind= Open MPI v5.0.8, package: Open MPI builduser@buildhost Distribution, ident: 5.0.8, repo rev: v5.0.8, May 30, 2025
#
# [ CPP ] gcc -E -P -D_HDF5_LIB -D_HDF5_IO -D_PAR_IO -D_MPI -D_FFTW -D_SLEPC -D_SCALAPACK     -D_TIMING     -D_P2Y_QEXSD_HDF5
# [ FPP ] gfortran -E -P -cpp -D_HDF5_LIB -D_HDF5_IO -D_PAR_IO -D_MPI -D_FFTW -D_SLEPC -D_SCALAPACK     -D_TIMING
# [ CC  ] mpicc -O2 -D_C_US -D_FORTRAN_US
# [ FC  ] mpifort -O3 -g -mtune=native -fno-lto
# [ FCUF] -O0 -g -mtune=native
# [ F77 ] mpifort -O3 -g -mtune=native -fno-lto
# [ F77U] -O0 -g -mtune=native
# [Cmain]
#
# You can modify compilers and flags by editing the file "config/setup"
#
And the compilation error, after issuing make core:

Code: Select all

mpicc -O2 -D_C_US -D_FORTRAN_US  -D_HDF5_LIB -D_HDF5_IO -D_PAR_IO -D_MPI -D_FFTW -D_SLEPC -D_SCALAPACK -D_TIMING -D_MEM_CHECK -D_yambo -D_linux -I/home/jmcastelo/source-code/yambo/include -I/home/jmcastelo/source-code/yambo/include/headers/common -I/home/jmcastelo/source-code/yambo/include/headers/parser -I/home/jmcastelo/source-code/yambo/include/driver -I/home/jmcastelo/source-code/yambo/include/version -c /home/jmcastelo/source-code/yambo/src/parser/PARSER_math.c
mpicc -O2 -D_C_US -D_FORTRAN_US  -D_HDF5_LIB -D_HDF5_IO -D_PAR_IO -D_MPI -D_FFTW -D_SLEPC -D_SCALAPACK -D_TIMING -D_MEM_CHECK -D_yambo -D_linux -I/home/jmcastelo/source-code/yambo/include -I/home/jmcastelo/source-code/yambo/include/headers/common -I/home/jmcastelo/source-code/yambo/include/headers/parser -I/home/jmcastelo/source-code/yambo/include/driver -I/home/jmcastelo/source-code/yambo/include/version -c /home/jmcastelo/source-code/yambo/src/parser/PARSER_interface.c
mpicc -O2 -D_C_US -D_FORTRAN_US  -D_HDF5_LIB -D_HDF5_IO -D_PAR_IO -D_MPI -D_FFTW -D_SLEPC -D_SCALAPACK -D_TIMING -D_MEM_CHECK -D_yambo -D_linux -I/home/jmcastelo/source-code/yambo/include -I/home/jmcastelo/source-code/yambo/include/headers/common -I/home/jmcastelo/source-code/yambo/include/headers/parser -I/home/jmcastelo/source-code/yambo/include/driver -I/home/jmcastelo/source-code/yambo/include/version -c /home/jmcastelo/source-code/yambo/src/parser/PARSER.c
mpicc -O2 -D_C_US -D_FORTRAN_US  -D_HDF5_LIB -D_HDF5_IO -D_PAR_IO -D_MPI -D_FFTW -D_SLEPC -D_SCALAPACK -D_TIMING -D_MEM_CHECK -D_yambo -D_linux -I/home/jmcastelo/source-code/yambo/include -I/home/jmcastelo/source-code/yambo/include/headers/common -I/home/jmcastelo/source-code/yambo/include/headers/parser -I/home/jmcastelo/source-code/yambo/include/driver -I/home/jmcastelo/source-code/yambo/include/version -c /home/jmcastelo/source-code/yambo/src/parser/PARSER_exp.c
In file included from /home/jmcastelo/source-code/yambo/src/parser/PARSER_exp.c:41:
grammar.y: In function ‘yyparse’:
grammar.y:41:16: error: too many arguments to function ‘(yyvsp + -48)->tptr->value.fnctptr’; expected 0, have 1
In file included from /home/jmcastelo/source-code/yambo/src/parser/PARSER_exp.c:24:
/home/jmcastelo/source-code/yambo/include/headers/parser/symbols.h:48:31: note: declared here
   48 |                 gsl_complex (*fnctptr)();  /* value of a FNCT */
      |                               ^~~~~~~
I hope you can lend me a hand with this.
Thanks in advance,
José
José M. Castelo
HPC System Administrator
Institute of Materials Science
University of Valencia
Spain

User avatar
Nicola Spallanzani
Posts: 102
Joined: Thu Nov 21, 2019 10:15 am

Re: Build error in PARSER_exp.c

Post by Nicola Spallanzani » Thu Oct 16, 2025 7:19 am

Dear José,
this is a known issues concerning gcc v15 that we have already fixed in the github repo:
https://github.com/yambo-code/yambo/com ... 433566510d

You need to change only two files: `src/parser/PARSER_symbols.c` and `include/headers/parser/symbols.h` in the same way.

Substitute this:

Code: Select all

gsl_complex (*fnctptr)(); 
with this:

Code: Select all

gsl_complex (*fnctptr)(gsl_complex); 
Best,
Nicola
Nicola Spallanzani, PhD
S3 Centre, Istituto Nanoscienze CNR and MaX Center, Italy
MaX - Materials design at the Exascale
http://www.nano.cnr.it
http://www.max-centre.eu

jmcastelo
Posts: 8
Joined: Tue Nov 12, 2024 1:41 pm

Re: Build error in PARSER_exp.c

Post by jmcastelo » Thu Oct 16, 2025 10:28 am

Thank you Nicola!
That solved this issue, although another one, related to PETSc arose.

Code: Select all

gfortran -E -P -cpp -D_HDF5_LIB -D_HDF5_IO -D_PAR_IO -D_MPI -D_FFTW -D_SLEPC -D_SCALAPACK -D_TIMING -D_MEM_CHECK -D_yambo -D_linux -I/home/jmcastelo/source-code/yambo/include -I/home/jmcastelo/source-code/yambo/include/headers/common -I/
home/jmcastelo/source-code/yambo/include/headers/parser -I/home/jmcastelo/source-code/yambo/include/driver -I/home/jmcastelo/source-code/yambo/include/version -I/home/jmcastelo/source-code/yambo-libs/gfortran/mpifort/include/ -I/workshop
/software/netcdf-fortran/4.6.2/include -I/workshop/software/netcdf-c/4.9.3/include -I/workshop/software/petsc/3.24.0/include -I/workshop/software/slepc/3.24.0/include -I/workshop/software/pHDF5/1.14.6/include -I/workshop/software/libxc/6
.2.2/include -I/home/jmcastelo/source-code/yambo-libs/gfortran/mpifort/no_gpu/include  -I/workshop/software/fftw/3.3.10/include   -I/home/jmcastelo/source-code/yambo/include/driver -I/home/jmcastelo/source-code/yambo/include/version /hom
e/jmcastelo/source-code/yambo/src/bse/K_stored_in_a_nest_matrix.F >> K_stored_in_a_nest_matrix.tmp_source
mpifort -c -O3 -g -mtune=native -fno-lto      -I/home/jmcastelo/source-code/yambo/include -I/home/jmcastelo/source-code/yambo/include/headers/common -I/home/jmcastelo/source-code/yambo/include/headers/parser -I/home/jmcastelo/source-code
/yambo/include/driver -I/home/jmcastelo/source-code/yambo/include/version -I/home/jmcastelo/source-code/yambo-libs/gfortran/mpifort/include/ -I/workshop/software/netcdf-fortran/4.6.2/include -I/workshop/software/netcdf-c/4.9.3/include -I
/workshop/software/petsc/3.24.0/include -I/workshop/software/slepc/3.24.0/include -I/workshop/software/pHDF5/1.14.6/include -I/workshop/software/libxc/6.2.2/include -I/home/jmcastelo/source-code/yambo-libs/gfortran/mpifort/no_gpu/include
  -I/workshop/software/fftw/3.3.10/include   -I/home/jmcastelo/source-code/yambo/include/driver -I/home/jmcastelo/source-code/yambo/include/version K_stored_in_a_nest_matrix.f90
K_stored_in_a_nest_matrix.f90:471:109:

  471 |  call MatCreateNest(PETSC_COMM_WORLD,itwo,PETSC_NULL_INTEGER,itwo,PETSC_NULL_INTEGER,matArray,slepc_mat,ierr)
      |                                                                                                             1
Error: There is no specific subroutine for the generic ‘matcreatenest’ at (1)
The PETSc version used in this Yambo build has indeed this function:

Code: Select all

$ grep -iR matcreatenest /workshop/software/petsc/3.24.0/include/
/workshop/software/petsc/3.24.0/include/petscmat.h:PETSC_EXTERN PetscErrorCode MatCreateNest(MPI_Comm, PetscInt, const IS[], PetscInt, const IS[], const Mat[], Mat *);
The number of arguments is different, anyway. I checked PETSc repository to see if this changed in later versions of the software, but the function is the same in all of them.
Do you have any idea of what could be the cause of this error?
I switched to Yambo branch 5.3, by the way.

Regards,
José
José M. Castelo
HPC System Administrator
Institute of Materials Science
University of Valencia
Spain

User avatar
Nicola Spallanzani
Posts: 102
Joined: Thu Nov 21, 2019 10:15 am

Re: Build error in PARSER_exp.c

Post by Nicola Spallanzani » Fri Oct 17, 2025 8:28 am

Dear José,
could you try to compile the branch 5.4? This is a release candidate, so quite stable.

Otherwise I suggest to downgrade the version of the PETSc and SLEPc libraries. Version 3.22.x should be fine, even if you checked that the interface of the function is the same, I'm using this version without any problem.

Best,
Nicola
Nicola Spallanzani, PhD
S3 Centre, Istituto Nanoscienze CNR and MaX Center, Italy
MaX - Materials design at the Exascale
http://www.nano.cnr.it
http://www.max-centre.eu

jmcastelo
Posts: 8
Joined: Tue Nov 12, 2024 1:41 pm

Re: Build error in PARSER_exp.c

Post by jmcastelo » Fri Oct 24, 2025 8:24 am

Dear Nicola.
Yes, downgrading PETSc and SLEPc to the 3.22.x versions worked well.
Thank you!
José M. Castelo
HPC System Administrator
Institute of Materials Science
University of Valencia
Spain

Post Reply