Charles R Harris wrote:
> 
> On 4/18/07, *Robert Kern* <[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>> wrote:
> 
>     Charles R Harris wrote:
>     > I'm wondering if the static libraries could simply be compiled
>     with the
>     > -fPIC flag and linked with the program to produce the dynamic library.
>     > The static libraries are just collections of *.o files, so I don't
>     see
>     > why that shouldn't work.
> 
>     I don't think there is a reason why it *wouldn't* work; it's just
>     that one needs
>     to do "gcc -shared" to make a .so and that flag also tells the
>     linker to choose
>     .so's over .a's for the libraries that get linked into the target .so.
> 
> 
> The linker picks dynamic over static even without the -shared flag.

Oh sorry, using -static would normally make the linker choose static libraries
over shared libraries, but that only works when linking an executable. Of
course, David found the right way to bypass this and talk directly to the 
linker.

> I
> think that putting the static libraries in their own directory *without*
> the dynamic libraries might do the trick. Hmm... something to try.

That's usually the way I worked around it. Things may be difficult if your
shared libraries are installed to /usr/lib and you don't want to muck about as
root in there. IIRC (but I possibly don't), you'd have to remove the .so's from
the entire library search path in order to find the .a's.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
  -- Umberto Eco
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to