Hello Anatoly,

You likely need to add libxml2.a to your link command-line. And some others may be missing later.

Instead of linking with src/.libs/libhwloc.a, you should run "make install" and use libhwloc.a from there (use --prefix=</where/you/want/to/install> to tell configure where to install).

Once hwloc is installed, pkg-config can tell you which dependency libs are needed for static linking:
$ pkg-config --static --libs hwloc
-lhwloc -lxml2 -lz -lm -lpci
If you don't install hwloc in prefix=/usr, you may need PKG_CONFIG_PATH to tell pkg-config where to look.

Anyway, the above list (-lxml2 -lz -lm -lpci) should be correct.


Le 20/05/2012 15:14, Anatoly G a écrit :
I downloaded 1.4.2 version (tar file).
1) ./configure --enable-static
2) make
3) Wrote program
#include "hwloc.h"
link with ($hwloc_dir)/src/.libhwloc.a
4) In link stage I get following errors:
Linking  EXE: /space/home/anatol-g/Grape/release_4.6_FH/core/bin/linux64/rhe6/g++4.4.4/debug/mpi_rcv_waitany ...
/product/grape-data/hwloc-1.4.2/src/.libs/libhwloc.a(topology-xml.o): In function `hwloc_libxml2_disable_stderrwarnings':
topology-xml.c:(.text+0x2d9): undefined reference to `__xmlGenericError'
topology-xml.c:(.text+0x2f0): undefined reference to `xmlSetGenericErrorFunc'
/product/grape-data/hwloc-1.4.2/src/.libs/libhwloc.a(topology-xml.o): In function `hwloc_backend_xml_init':
topology-xml.c:(.text+0x34f): undefined reference to `xmlCheckVersion'
topology-xml.c:(.text+0x37c): undefined reference to `xmlReadFile'

Attached program file + error report.
I use 
OS: Red Hat 6.0 Santiago  
gcc 4.4.4-13

Can you please help me?
Sorry if my question looks stupid.

hwloc-users mailing list