Hi I’m trying to build hwloc (1.8) on Linux (CentOS 6 x64) as a static library that will be linked into my own shared library that is part of my application. I am not using very much of hwloc, and I am trying to avoid having the full hwloc shared library distributed with my application just for the tiny bit of it that I am using. However, this turns out to be a challenge.
I configured with: ./configure --enable-static --disable-shared which builds the static library just fine, but when I link it to my shared library I get this error: /usr/bin/ld: /usr/local/lib/libhwloc.a(topology.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC So, I tried re-configuring: ./configure --enable-static --disable-shared CXXFLAGS=-fPIC but after rebuilding the library, I still get the same link error. Is this a possible configuration? I can make my app work with hwloc in its own shared library distributed with my app, it just seems so wasteful for what I’m doing with it. I’m not the biggest Linux expert, so I’m pretty sure I’m doing something wrong, but I have managed to get other libraries I’m using (boost.regex and zeromq) to work this way, so it seems like it should be possible. Thank you for any help you can provide. Robin Scher ro...@uberware.net +1 (213) 448-0443
signature.asc
Description: Message signed with OpenPGP using GPGMail