shared library disaster

T

Tobias Bergmann

Hi,

I work on a big project that consists of many small linux C++ CGI
binaries. This actually works fine but our problem is that we use many
..so libraries and we need to compile it separately for many different
linux distributions and versions and even architectures. I actually want
one compiled version that works everywhere.

One idea is to store all used .so libraries of the compiling system in a
seperate directory, install that directory on other systems and use
rpath
(http://godi.ocaml-programming.de/project-doc/finding_libraries.txt) to
make ld to search in this directory first.

This works fine with a few libraries but I could not manage to do this
for our big list of libraries e.g. ImageMagick that uses 10 more other
libraries.

Another idea is to compile all libraries static into one big shared
library and just link this shared one. Seems like the linker / ld can
not do such a mix of static and shared? Compiling all small CGI binaries
static would take too much disc space I think.

Any other ideas / suggestions?

Thanks
 
G

Gavin Deane

Hi,

I work on a big project that consists of many small linux C++ CGI
binaries. This actually works fine but our problem is that we use many
.so libraries and we need to compile it separately for many different
linux distributions and versions and even architectures. I actually want
one compiled version that works everywhere.

One idea is to store all used .so libraries of the compiling system in a
seperate directory, install that directory on other systems and use
rpath
(http://godi.ocaml-programming.de/project-doc/finding_libraries.txt) to
make ld to search in this directory first.

This works fine with a few libraries but I could not manage to do this
for our big list of libraries e.g. ImageMagick that uses 10 more other
libraries.

Another idea is to compile all libraries static into one big shared
library and just link this shared one. Seems like the linker / ld can
not do such a mix of static and shared? Compiling all small CGI binaries
static would take too much disc space I think.

Any other ideas / suggestions?

This isn't a C++ language question, it's a question about the tools
you are using so it's off-topic here. So the best suggestion is to ask
in a forum full of people who are familiar with those tools and how to
use them on your OS, as they should be able to help you. The FAQ has
suggestions that may be useful:

http://www.parashift.com/c++-faq-lite/how-to-post.html#faq-5.9

Gavin Deane
 
R

Rolf Magnus

Tobias said:
Hi,

I work on a big project that consists of many small linux C++ CGI
binaries. This actually works fine but our problem is that we use many
.so libraries and we need to compile it separately for many different
linux distributions and versions and even architectures. I actually want
one compiled version that works everywhere.

One idea is to store all used .so libraries of the compiling system in a
seperate directory, install that directory on other systems and use
rpath
(http://godi.ocaml-programming.de/project-doc/finding_libraries.txt) to
make ld to search in this directory first.

This works fine with a few libraries but I could not manage to do this
for our big list of libraries e.g. ImageMagick that uses 10 more other
libraries.

Another idea is to compile all libraries static into one big shared
library and just link this shared one. Seems like the linker / ld can
not do such a mix of static and shared?

Depends on whether you made your static libraries position independant.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top