Page 1 of 1

undefined reference to `libxc_free'

Posted: Wed Sep 04, 2024 4:48 am
by gscquvasp

Hi,
I am compiling VASP6.3.2 with libxc (both libxc5.2.3 and libxc6.2.2 tested, and encountered the same error).
I am using intel compiler 2017.

Without libxc, I compiled VASP6.3.2 succesfully, and vasp also runs smoothly without errors.

Then I downloaded libxc, compiled libxc (no error) (as instructed https://www.vasp.at/wiki/index.php/Makefile.include#Libxc_.28optional.29) , and added this to makefile.include

LIBXC_ROOT ?= /work/home/programs/vasp6.3.2/VASP_6.3.2/libxc-5.2.3-intel-2017
#LLIBS += -L$(LIBXC_ROOT)/lib -lxcf03 -lxc
LLIBS += $(LIBXC_ROOT)/lib/libxcf03.a $(LIBXC_ROOT)/lib/libxc.a
INCS += -I$(LIBXC_ROOT)/include

FInally, the compililation stops at this error:

/work/home/programs/vasp6.3.2/VASP_6.3.2/libxc-5.2.3-intel-2017/lib/libxcf03.a(libxcf03.o): In function `xc_f03_lib_m_mp_xc_f03_functional_get_name_':
libxcf03.f90:(.text+0xd3b): undefined reference to 'libxc_free'

How can I solve this error? Thank you very much in advance,
Geng


Re: undefined reference to `libxc_free'

Posted: Wed Sep 04, 2024 8:56 am
by michael_wolloch

Dear Geng,

please share your makefile.include, so I can try to replicate the issue.

Did you compile libxc with the --disable-fhc option?
Did you add the precompiler flag -DUSELIBXC?

Cheers, Michael


Re: undefined reference to `libxc_free'

Posted: Fri Sep 06, 2024 5:29 am
by gscquvasp

Dear Michael,
Thank you for the reply.

I finally found the cause of this error,
I accidentally configured and compiled libxc with CC=icpc,
Switching that to CC=icc solved the error.

Best

Geng


Re: undefined reference to `libxc_free'

Posted: Fri Sep 06, 2024 6:57 am
by michael_wolloch

Dear Geng,
thanks for providing a post with the solution. If you don't have any additional questions, please indicate that I can lock the topic.
Cheers, Michael