I need to use libxml2 in a project that I want to compile on a Cray machine. In principle it is installed, there is a xml2-config
program that gives me linker flags:
$ xml2-config --libs
-lxml2 -L/lib64 -lz -llzma -lm -ldl
I have a very simple test program:
$ cat test.c
int main() { return 0; }
Though in principle not needed, I can compile this with gcc test.c -lxml2 -L/lib64 -lz -llzma -lm -ldl
just fine. However, with the Cray compiler it does not work:
$ cc test.c -lxml2 -L/lib64 -lz -llzma -lm -ldl
/opt/cray/pe/cce/8.6.5/binutils/x86_64/x86_64-pc-linux-gnu/bin/ld: cannot find -lxml2
/opt/cray/pe/cce/8.6.5/binutils/x86_64/x86_64-pc-linux-gnu/bin/ld: cannot find -llzma
Same story with the Cray wrapped Intel compiler:
$ module swap PrgEnv-cray PrgEnv-intel
$ cc test.c -lxml2 -L/lib64 -lz -llzma -lm -ldl
ld: cannot find -lxml2
ld: cannot find -llzma
I need to use the Cray wrapped compiler in order to get proper MPI and hugepages into my program.
Is there anything I can do (besides trying to compile libxml2 myself, see my other question) to get this to link?