Yambo 5.2.3 compilation error on LibXC

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
pandachang97
Posts: 19
Joined: Mon Feb 19, 2024 11:06 pm

Yambo 5.2.3 compilation error on LibXC

Post by pandachang97 » Fri Jul 19, 2024 5:26 am

Hello Daniele,

Good morning. I hope you are all doing well. Recently, I have to reinstall Yambo on a super cluster. I download the 5.2.3 version from Yambo official webcite. When I tried to compile it, the error message is always the same, *** [mod_xc_functionals.o] Error 1. It seems the package does not find the LibXC.
The weird things are:(1) When I run the configuration, I include several pathes of the libraries. But the script does not read them. The command is listed as below:

Code: Select all

./configure CC=icc FC=ifort MPIFC=mpiifort MPIF77=ifort MPICC=mpiicc F77=ifort  --with-libxc-libs=libxc-6.2.2 --with-libxc-path=/work2/09846/pandachang97/Software/libxc-6.2.2/ --with-libxc-includedir=/work2/09846/pandachang97/Software/libxc-6.2.2/include/  --with-libxc-libdir=/work2/09846/pandachang97/Software/libxc-6.2.2/lib/ \
--with-netcdff-libs --with-netcdff-path=/opt/apps/intel19/netcdf/4.9.0/x86_64/ --with-netcdff-libdir=/opt/apps/intel19/netcdf/4.9.0/x86_64/lib/  --with-netcdff-includedir=/opt/apps/intel19/netcdf/4.9.0/x86_64/include/ \
--with-hdf5-libs  --with-hdf5-path=/opt/apps/intel19/hdf5/1.12.2/x86_64/  --with-hdf5-libdir=/opt/apps/intel19/hdf5/1.12.2/x86_64/lib/  --with-hdf5-includedir=/opt/apps/intel19/hdf5/1.12.2/x86_64/include/ --with-petsc-libs 
(2) Later, I change the path in config/setup. The settting is listed below:

Code: Select all

llibxc      = /work2/09846/pandachang97/Software/libxc-6.2.2/lib/libxcf90.a /work2/09846/pandachang97/Software/libxc-6.2.2/lib/libxcf03.a  /work2/09846/pandachang97/Software/libxc-6.2.2/lib/libxc.a
ilibxc      = -I/work2/09846/pandachang97/Software/libxc-6.2.2/include
Could you please help me fix that issue? Thank you so much and best regards,
Xin
Xin Chang
Postdoc research @UT Austin

User avatar
Daniele Varsano
Posts: 4098
Joined: Tue Mar 17, 2009 2:23 pm
Contact:

Re: Yambo 5.2.3 compilation error on LibXC

Post by Daniele Varsano » Fri Jul 19, 2024 8:44 am

Dear Xin,
you can try the following:

1) avoid indicating "--with-libxc-libs=libxc-6.2.2" and see if the path is recognized
2) configure the code without indicating any libxc option. Yambo will download them and compile it

Best,
Daniele
Dr. Daniele Varsano
S3-CNR Institute of Nanoscience and MaX Center, Italy
MaX - Materials design at the Exascale
http://www.nano.cnr.it
http://www.max-centre.eu/

kz_pl
Posts: 4
Joined: Wed May 18, 2022 4:41 pm

Re: Yambo 5.2.3 compilation error on LibXC

Post by kz_pl » Sat Jul 27, 2024 2:17 pm

Hello,

It seems that the problem persists - Yambo does not download the proper libxc, and if downloaded manually as tar.gz libxc won't compile (Linux Mint 21.3, gcc 11.4.0)

Krzysztof
Krzysztof Zberecki, Ph.D.
Warsaw University of Technology, Faculty of Physics

User avatar
Daniele Varsano
Posts: 4098
Joined: Tue Mar 17, 2009 2:23 pm
Contact:

Re: Yambo 5.2.3 compilation error on LibXC

Post by Daniele Varsano » Mon Jul 29, 2024 8:50 am

Dear Krzysztof,
Yambo does not download the proper libxc,
can you post the config.log file and the error message you get in phase of compilation?

Best,
Daniele
Dr. Daniele Varsano
S3-CNR Institute of Nanoscience and MaX Center, Italy
MaX - Materials design at the Exascale
http://www.nano.cnr.it
http://www.max-centre.eu/

kz_pl
Posts: 4
Joined: Wed May 18, 2022 4:41 pm

Re: Yambo 5.2.3 compilation error on LibXC

Post by kz_pl » Mon Jul 29, 2024 10:57 am

Please find attached config.log and compilation.log
You do not have the required permissions to view the files attached to this post.
Krzysztof Zberecki, Ph.D.
Warsaw University of Technology, Faculty of Physics

User avatar
Daniele Varsano
Posts: 4098
Joined: Tue Mar 17, 2009 2:23 pm
Contact:

Re: Yambo 5.2.3 compilation error on LibXC

Post by Daniele Varsano » Mon Jul 29, 2024 12:09 pm

Dear Krzysztof ,

Code: Select all

*** Unable to download libxc-5.2.3. Test whether curl or wget is installed and working,
*** if you have direct access to the internet.
*** If not, copy libxc-5.2.3.tar.gz into extlibs/archive/
It seems you do not have the wget sw installed on your machine. Please install it and try again, e.g. sudo apt-get install wget
If you cannot install "wget" for some reason, please download the libxc-5.2.3.tar.gz and copy it into extlibs/archive and try again.

Before reinstalling, please do a:
make distclean

Best,
Daniele
Dr. Daniele Varsano
S3-CNR Institute of Nanoscience and MaX Center, Italy
MaX - Materials design at the Exascale
http://www.nano.cnr.it
http://www.max-centre.eu/

kz_pl
Posts: 4
Joined: Wed May 18, 2022 4:41 pm

Re: Yambo 5.2.3 compilation error on LibXC

Post by kz_pl » Mon Jul 29, 2024 1:04 pm

The lack of wget is not the case - it's what I checked first.
What is the actual wget command Yambo uses to download the libxc source?
Anyway, if I put tar.gz in lib/archive (or extlib/archive) the result is the same - seems that the libxc won't compile...
Output is:

Code: Select all

make[2]: *** [/home/kz/compilations_local/yambo-5.2.3.gnu.mpi/config/mk/local/rules.mk:15: mod_xc_functionals.o] Error 1
Fatal Error: Cannot open module file ‘xc_f03_lib_m.mod’ for reading at (1): No such file or directory
	[driver] yambo (setup)
yambo linking failed. Check log/compile_yambo.log
Fatal Error: Cannot open module file ‘xc_f03_lib_m.mod’ for reading at (1): No such file or directory
make[1]: *** [config/mk/global/actions/compile_yambo.mk:48: yambo] Error 1
yambo build failed
I can compile the libxc by hand (but using cmake, not automake), but the compiler still won't make the mod file...

ah, ok, after the make distclean I got:

Code: Select all

make[2]: *** [/home/kz/compilations_local/yambo-5.2.3.gnu.mpi/config/mk/local/rules.mk:15: mod_memory.o] Error 1
Fatal Error: Cannot open module file ‘openmp.mod’ for reading at (1): No such file or directory
	[driver] yambo (setup)
yambo linking failed. Check log/compile_yambo.log
Fatal Error: Cannot open module file ‘openmp.mod’ for reading at (1): No such file or directory
make[1]: *** [config/mk/global/actions/compile_yambo.mk:48: yambo] Error 1
yambo build failed
Krzysztof Zberecki, Ph.D.
Warsaw University of Technology, Faculty of Physics

User avatar
Davide Sangalli
Posts: 631
Joined: Tue May 29, 2012 4:49 pm
Location: Via Salaria Km 29.3, CP 10, 00016, Monterotondo Stazione, Italy
Contact:

Re: Yambo 5.2.3 compilation error on LibXC

Post by Davide Sangalli » Wed Jul 31, 2024 11:09 am

Dear all,
for the "internally compiled" libxc (fallback in case the external ones are not properly detected/recognised), the errors are due to the fact that the website tddft.org went offline.
See connected issues here:
- https://github.com/yambo-code/yambo/issues/119
- https://gitlab.com/libxc/libxc/-/issues/508

Below the patch which fixes the compilation in branch 5.2. We will soon release version 5.2.4 with the fix included.
Please notice that you need autoconf tools installed in your machine (see discussion in the above issues).

Best,
D.

Code: Select all

diff --git a/lib/archive/package.list b/lib/archive/package.list
index 0bb67a9a4e..0f84572201 100644
--- a/lib/archive/package.list
+++ b/lib/archive/package.list
@@ -98,12 +98,11 @@ url_netcdff=https://github.com/Unidata/netcdf-fortran/archive/refs/tags/$(tarbal
 #
 url_slepc=https://gitlab.com/slepc/slepc/-/archive/v$(version_slepc)/$(tarball_slepc)
 url_petsc=https://gitlab.com/petsc/petsc/-/archive/v$(version_petsc)/$(tarball_petsc)
-#url_libxc=https://gitlab.com/libxc/libxc/-/archive/$(version_libxc)/$(tarball_libxc)  # this would require to run "autoreconf -i"
+url_libxc=https://gitlab.com/libxc/libxc/-/archive/$(version_libxc)/$(tarball_libxc)  # this requires to run "autoreconf -i" (coded)
 #
 # External URL's More
 #
 url_fftw=https://fftw.org/$(tarball_fftw)
-url_libxc=https://www.tddft.org/programs/libxc/down/$(version_libxc)/$(tarball_libxc)
 #
 # Internal URL's
 #
diff --git a/lib/config/external_libs_commons.mk b/lib/config/external_libs_commons.mk
index 185dd01a72..095f69ae0e 100644
--- a/lib/config/external_libs_commons.mk
+++ b/lib/config/external_libs_commons.mk
@@ -22,17 +22,27 @@ if ! test -e configured.stamp && test -d $(PACKAGE); then \
 fi
 endef
 #
+define autoconf
+if ! test -e autoconf.stamp && test -d $(PACKAGE); then \
+ echo "\t[$(PACKAGE)] autoconf"; \
+ rm -f ${compdir}/log/autoconf_$(PACKAGE).log; \
+ CWD=`pwd`;\
+ cd $(PACKAGE);  autoreconf -i >> ${compdir}/log/autoconf_$(PACKAGE).log 2>&1 ; \
+ touch $$CWD/autoconf.stamp;\
+fi
+endef
+#
 define compile
 if ! test -e compiled.stamp && test -d $(PACKAGE); then \
  echo "\t[$(PACKAGE)] $(1) compilation"; \
  rm -f ${compdir}/log/compile_$(PACKAGE).log; \
  CWD=`pwd`;\
  FLGS="$(MAKEFLAGS)";\
- if [ "$(PACKAGE)" = "scalapack-2.1.0" ]; then \
-  FLGS=`echo "$(MAKEFLAGS)" | sed 's/-j//g'`; \
+ if [ "$(PACKAGE)" = "$(pkgname_scalapack)" ]; then \
+  FLGS="-j1";\
  fi;\
  cd $(PACKAGE); \
- $(make) $(MAKEFLAGS) $(1) >> ${compdir}/log/compile_$(PACKAGE).log 2>&1;  \
+ $(make) $$FLGS $(1) >> ${compdir}/log/compile_$(PACKAGE).log 2>&1;  \
  if [ ! "$(1)" = "blaslib" ] &&  [ ! "$(1)" = "loclib_only" ]; then touch $$CWD/compiled.stamp; fi;\
 fi
 endef
diff --git a/lib/libxc/Makefile.loc b/lib/libxc/Makefile.loc
index 58fd4b4117..fb5fde28a6 100644
--- a/lib/libxc/Makefile.loc
+++ b/lib/libxc/Makefile.loc
@@ -32,6 +32,7 @@ uncompress:
        @$(uncompress)
 
 configure: uncompress
+       @$(autoconf)
        @$(configure)
 
 compile: uncompress configure
Davide Sangalli, PhD
CNR-ISM, Division of Ultrafast Processes in Materials (FLASHit) and MaX Centre
https://sites.google.com/view/davidesangalli
http://www.max-centre.eu/

kz_pl
Posts: 4
Joined: Wed May 18, 2022 4:41 pm

Re: Yambo 5.2.3 compilation error on LibXC

Post by kz_pl » Thu Aug 01, 2024 5:01 pm

Thank you. For now, libxc on linux mint 21/22 can only be compiled with cmake, automake does not work...
Krzysztof Zberecki, Ph.D.
Warsaw University of Technology, Faculty of Physics

sanoj
Posts: 8
Joined: Tue Sep 03, 2024 1:13 am

Re: Yambo 5.2.3 compilation error on LibXC

Post by sanoj » Wed Sep 04, 2024 3:23 am

I had the same problem. Please find the fix below.

1. cd yambo-5.2.3
2. vi lib/archive/package.list
3. Replace
url_libxc=https://www.tddft.org/programs/libxc/down/$(version_libxc)/$(tarball_libxc) with
url_libxc=https://www.cp2k.org/static/downloads/libxc-6.2.2.tar.gz
4. ./configure
5. make all
It will download new libxc and compile.

I did the above steps and I was able to successfully install yambo.
Sanoj
University of Central Arkansas, US
Department of Chemistry and Biochemistry

Post Reply