Skip to content

Use a shared library when compiling

Sebastian Ohlmann requested to merge shared_library into develop

Description

A shared library is created from all object files except the ones that contain the program. The programs (i.e. octopus and the utilities) can then simply be linked to this shared library. The creation of the shared library is done using libtool. The static libraries shipped with the code are now compiled with -fPIC such that they can be included in the shared object file.

This has several advantages: the total size of the installed binaries and libraries is much smaller and the linking is faster. Moreover, when starting octopus as an MPI program, less memory is needed because the shared library needs to be loaded only once.

News snippet

Build system: use a shared library to reduce total size of executables

Checklist

Merge request reports

Loading