[gmx-developers] libxml2 detection problem (bug?)

Szilárd Páll pall.szilard at gmail.com
Wed Jul 2 21:35:37 CEST 2014


Hi,

I'm having trouble getting libxml2 detection pass with
-DGMX_PREFER_STATIC_LIBS=ON with 5.0 release.

I keep getting:
-- Found LibXml2: /usr/lib/x86_64-linux-gnu/libxml2.a (found version "2.7.8")
-- Looking for xmlTextWriterEndAttribute in /usr/lib/x86_64-linux-gnu/libxml2.a
-- Looking for xmlTextWriterEndAttribute in
/usr/lib/x86_64-linux-gnu/libxml2.a - not found

even though:
nm -g /usr/lib/x86_64-linux-gnu/libxml2.a | grep -i xmlTextWriterEndAttribute
0000000000001090 T xmlTextWriterEndAttribute

It looks like the trouble is caused by some linking order issue
because I see this in the CMakeError.log:

/usr/bin/gcc-4.8  -Wno-maybe-uninitialized -Wextra
-Wno-missing-field-initializers -Wno-sign-compare -Wpointer
-arith -Wall -Wno-unused -Wunused-value -Wunused-parameter
-DCHECK_FUNCTION_EXISTS=xmlTextWriterEndAttribute
    CMakeFiles/cmTryCompileExec3409173216.dir/CheckFunctionExists.c.o
-o cmTryCompileExec3409173216 -rdynamic
 -Wl,-Bstatic -lxml2 -Wl,-Bdynamic
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libxml2.a(xmlIO.o):
In function `xmlGzfileOpenW':
(.text+0x253): undefined reference to `gzdopen'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libxml2.a(xmlIO.o):
In function `xmlGzfileOpenW':
(.text+0x285): undefined reference to `gzopen64'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libxml2.a(xmlIO.o):
In function `xmlFreeZMemBuff':
(.text+0x2f8): undefined reference to `deflateEnd'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libxml2.a(xmlIO.o):
In function `xmlGzfileClose':
(.text+0x995): undefined reference to `gzclose'

... and so one with all kinds of libz and even math.h functions listed.

Any idea what's going on?

Cheers,
--
Szilárd


More information about the gromacs.org_gmx-developers mailing list