Gerald,
On 5/3/2009 3:32 PM, Gerald I. Evenden wrote:
In a shared library there are about 8 routines out over 100 that refer to
libgsl and libpthread. A frequent situation may arise where an application
program has no need for using the 8 procedures infected with other library
needs.
At the current time, when I try to link such a program I get a failure unless
I add all the references to the additional libraries---even though they are
not employed by the program in any manner.
Is there any reasonable way around this or do I have to either separate the 8
routines into another library or add the references to libgsl (+*blas) and
pthread to Makefiles of programs that have no involvement with these library
procedures?
There are two options: one you mentioned already - separate the 8
routines into another library. The other option involves manually
loading importing the routines you need from pthread and libgsl at
run-time. This will clear the hard dependency on these other libraries.
And if you call these 8 routines only 2 percent of the time, then it
will also clear soft dependencies for your users 98 percent of the time.
Regards,
John