undefined reference to `libxc_free'

Questions regarding the compilation of VASP on various platforms: hardware, compilers and libraries, etc.


Moderators: Global Moderator, Moderator

Post Reply
Message
Author
gscquvasp
Newbie
Newbie
Posts: 2
Joined: Tue Aug 13, 2024 6:17 am

undefined reference to `libxc_free'

#1 Post by gscquvasp » Wed Sep 04, 2024 4:48 am

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


michael_wolloch
Global Moderator
Global Moderator
Posts: 110
Joined: Tue Oct 17, 2023 10:17 am

Re: undefined reference to `libxc_free'

#2 Post by michael_wolloch » Wed Sep 04, 2024 8:56 am

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


gscquvasp
Newbie
Newbie
Posts: 2
Joined: Tue Aug 13, 2024 6:17 am

Re: undefined reference to `libxc_free'

#3 Post by gscquvasp » Fri Sep 06, 2024 5:29 am

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


michael_wolloch
Global Moderator
Global Moderator
Posts: 110
Joined: Tue Oct 17, 2023 10:17 am

Re: undefined reference to `libxc_free'

#4 Post by michael_wolloch » Fri Sep 06, 2024 6:57 am

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


Post Reply