[C++-sig] compile libboost_python.a with '-fPIC' flag on x86_64
Grant Tang
gtang at blake.bcm.tmc.edu
Fri Feb 17 18:37:35 CET 2006
Rene Rivera wrote:
> Grant Tang wrote:
>> Neal Becker wrote:
>>
>>> Grant Tang wrote:
>>>
>>>> Hi,
>>>>
>>>> I need to compile a static boost.python library with '-fPIC' CFLAGS. I
>>>> don't know how to do it with bjam/jamfile.
>>>>
>>>> Since my platform is x86_64 based, the libboost_python.a compiled
>>>> without '-fPIC' will not make my project compiled.
>>>>
>>>> Thanks,
>>>> Grant
>>> Should you be using the .so versions which would be built with -fPIC?
>>> What os?
>>
>> My os is linux.
>
> In that case...
>
>> The libboost_python.so works fine. But we want to statically compile our
>> software with boost.python, so it will not ask our end user to install
>> libboost_python first, just to minimize the dependency. We have a dozen
>> of dependency libraries. All other I can make their static library
>> compiled with '-fPIC' CFLAGS, since they use MAKEFILE instead of jamfile.
>
> Add "-Wl,-rpath,'${ORIGIN}'" when linking all those SOs and the EXEs.
> And just put all the SOs in the same dir as the EXEs.
>
>
> --
> -- Grafik - Don't Assume Anything
> -- Redshift Software, Inc. - http://redshift-software.com
> -- rrivera/acm.org - grafik/redshift-software.com
> -- 102708583/icq - grafikrobot/aim - grafikrobot/yahoo
Yes, I can deliver all SOs in a directory, and ask user set a
$LD_LIBRARY_PATH to that directory. But we still hope we can build it
statically into our own .so library like what we did for all other
dependency libraries.
More information about the Cplusplus-sig
mailing list