FLEUR Forum » User support » Installation » How to resolve the error message "No libxml2 Library found. This is required."
Dear Fleur community,
". /configure.sh -libxc TRUE", I get the message shown in the attached text file. In particular, I get the error "No libxml2 Library found. This is required."
I was wondering if you could give me some advice on how to solve this problem. Also, I am new to Linux and I think this thread contains some elementary questions.
I will do my best to provide you with as much information as possible to help you resolve the problem.
Thanks in advance,
Yuta.o
P.S. The name and logo of the "Fleur" packaging are elegant, pretty and very nice. I can't wait to join the Fleur community !! :)
1. Does this only happen if you have the "-libxc TRUE" flag in the call to the configure script or also with a pure call to it without any command line arguments?
2. Are you compiling on a special machine like a compute cluster or do you do this on your workstation?
I ask because this error can have numerous causes. In general the libxml2 library should be available on every typical linux system. But for compute clusters this is sometimes hidden at places where the configure script does not search. In such a case one would have to load certain modules. It may also be that the compiler arguments for linking libraries are somehow broken and cannot be correctly interpreted. The third possible cause that comes to mind is that often the libxml2 library is split into two parts. One part that only contains the library as it would be used by compiled programs and another part that is also important for compiling programs. We need both, but some linux distributions by default only provide the first part. In package managers the compilation-related part is sometimes called libxml2-dev.
Dear Gregor,
Thank you for your valuable advice.
The answer to your first question is: "The error message is the same whether the flag is present or not". I have attached a text file of the error message to this reply.
The answer to the second question is: "I compile on a small workstation".To describe the performance of this workstation, it has an "11th Generation Intel(R) Core(TM) i7-11800H @ 2.30 GHz" CPU and 32.0 GB of DRAM. We also built a virtual environment on the Windows OS and installed Debian 10.9 on that virtual environment to compile Fleur.
As a first aid measure I have decided to use Fleur with "Quantum Mobile". If I find a solution to this problem, I will post it in this thread.
I was delighted to receive Gregor's reply. Thank you very much for taking the time to share your valuable information with me.
Thanks,
Yuta.o
Maybe we should in a simple way first check whether it should be available. I don't know the typical folder hierarchy on Debian machines, but could you test what the output of
find /usr/ -name libxml2*
is? Maybe we have to tell Fleur by force where to look for this library.
Dear Gregor,
Gregor, thanks for the reply.
The following line reports the result of entering the command.
2
3
4
$ find /usr/ -name libxml2*
> /usr/lib/x86_64-linux-gnu/libxml2.so.2
> /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.4
> /usr/share/doc/libxml2
I am also eagerly awaiting your guidance on the next steps.
Thank you for giving of your time to me.
Best Regards,
Yuta.O
Ok, just for your information, my output for this looks like:
2
3
4
5
6
7
8
9
10
11
12
13
14
gregor@analyticalEngine:~$ find /usr/ -name libxml2*
/usr/lib/x86_64-linux-gnu/libxml2.so
/usr/lib/x86_64-linux-gnu/girepository-1.0/libxml2-2.0.typelib
/usr/lib/x86_64-linux-gnu/libxml2.a
/usr/lib/x86_64-linux-gnu/libxml2.so.2.9.10
/usr/lib/x86_64-linux-gnu/libxml2.so.2
/usr/share/aclocal/libxml2.m4
/usr/share/doc/libxml2
/usr/share/doc/libxml2-dev
/usr/share/doc/libxml2-utils
/usr/share/lintian/overrides/libxml2
/usr/include/libxml2
Some of the things that are found on my machine are not needed, but some are or may be needed.
1. What is definitely needed is the include directory. Maybe this is named slightly differently for you, but If have this '/usr/include/libxml2' directory with another 'libxml' subdirectory containing numerous files with a '.h' ending. This is the part of the library that is needed for compiling programs. I found instructions on how to install this part of the library on a Debian linux there: https://installonlinux.com/debian/jessie/libxml2-dev You need administrator rights for this. It is probably the same procedure also for other versions of Debian. Please try installing this part of the library and then calling the Fleur configure script again.
2. If this still doesn't work I sometimes saw that the system expects to find a '.so' file for the library and a '.so.2' file is not detected. Essentially the files with the number endings are just copies or links to copies of the library with different version numbers. So this can be fixed by creating another link 'libxml2.so' in the respective directory that links to the related 'libxml2.so.2' file. Such a (symbolic) link is created by changing into the respective directory '/usr/lib/x86_64-linux-gnu/' and then executing
2
3
ln -s libxml2.so.2 libxml2.so
Maybe it is also required to perform this operation with administrator rights. In that case it would be:
2
3
sudo ln -s libxml2.so.2 libxml2.so
Please try this and report afterwards whether it solved the issue.
Dear Gregor,
I took Gregor advice and compiled "Fleur". As a result, I was able to compile "Fleur".
My solution is shown in the next line.
2
3
4
5
6
7
8
9
10
11
12
13
14
15
user@malive:~/Data/App/fleur$ sudo apt-get clean
user@malive:~/Data/App/fleur$ sudo apt-get install libxml2-dev
user@malive:~/Data/App/fleur$ find /usr/ -name libxml2*
/usr/include/libxml2
/usr/lib/x86_64-linux-gnu/libxml2.so.2
/usr/lib/x86_64-linux-gnu/libxml2.so.2.9.4
/usr/lib/x86_64-linux-gnu/libxml2.so
/usr/lib/x86_64-linux-gnu/libxml2.a
/usr/share/aclocal/libxml2.m4
/usr/share/lintian/overrides/libxml2
/usr/share/doc/libxml2-dev
/usr/share/doc/libxml2
user@malive:~/Data/App/fleur$ ./configure.sh >CompileResult.txt
user@malive:~/Data/App/fleur$ cd build ; make -j2
user@malive:~/Data/App/fleur/build$ ctest -I 1,35 >test.txt
I would like to thank you very much, Gregor. If you have any books or journals that explain the source code of Fleur, please introduce them to me. I am an undergraduate student majoring in Materials Science. I would like to be like Gregor, a first-class researcher and programmer.
Best Regards,
Yuta.O
You know, a simple "Thank you!" is enough. There is no need to be overly enthusiastic about any person, especially not in a user support forum.
I'm glad that my suggestions helped to solve the problem.
With respect to further knowledge about the Fleur code I suggest you have a look at the different sections in our user guide available at: https://www.flapw.de/
If that doesn't go far enough there are also references to original publications provided. A general introduction to the FLAPW method is also available in the book by D. J. Singh and L. Nordström: "Planewaves, Pseudopotentials, and the LAPW Method".