GEOS icon indicating copy to clipboard operation
GEOS copied to clipboard

Shared Library

Open bmhan12 opened this issue 2 years ago • 3 comments

This PR:

  • Sets the default to build geosx_core as a shared library
    • For clang@upstream on lassen release, build directory size from static to shared: 13GB --> 4.4 GB
    • For [email protected] on quartz release, build directory size from static to shared: 4.2GB --> 1.5 GB
  • Add CMake config output for what CMake targets are being built and linking behavior for each configuration of GEOSX_BUILD_SHARED_LIBS and GEOSX_BUILD_OBJ_LIBS
  • Related to #2023

As part of this PR I also tried building geosx_core as a static library and linking executables to geosx_core, but ran into the errors detailed in issue #2016 . This is likely related to circular dependencies exposed by building GEOSX this way.

bmhan12 avatar Sep 22 '22 21:09 bmhan12

Moving this out of the merge queue... seeing the lassen integrated tests hang with shared libraries (or might be my terminal/ allocation). Need to debug further against develop.

bmhan12 avatar Sep 29 '22 20:09 bmhan12

Moving this out of the merge queue... seeing the lassen integrated tests hang with shared libraries (or might be my terminal/ allocation). Need to debug further against develop.

Maybe ask LC for help

rrsettgast avatar Sep 29 '22 21:09 rrsettgast

@bmhan12 what happens if you use cmake object libraries, statically link geosx, and dynamically link all unit tests?

rrsettgast avatar Oct 12 '22 23:10 rrsettgast

For future note: Discussed with @white238 about object libraries going forward - We do not want to be using object libraries (additional discussion here - cmake actually does not officially support separable compilation for object libraries).

I have set the default settings to building geosx_core as a shared library, and each component library as a static library. This will use blt_combine_static_library to resolve circular dependency issues.

bmhan12 avatar Nov 04 '22 16:11 bmhan12