Minimal set of Root libs/pcms for a small Docker image

Dear all,

I’m trying to package a program that depends on a few Root libraries, into a Docker image (based on AlmaLinux:9).

$ ldd myprog
 libTree.so => /opt/bin/../lib/libTree.so (0x00007fffff61b000)
        libMathCore.so => /opt/bin/../lib/libMathCore.so (0x00007fffff3d0000)
        libImt.so => /opt/bin/../lib/libImt.so (0x00007fffff3bc000)
        libMultiProc.so => /opt/bin/../lib/libMultiProc.so (0x00007fffff3ad000)
        libNet.so => /opt/bin/../lib/libNet.so (0x00007fffff2ce000)
        libRIO.so => /opt/bin/../lib/libRIO.so (0x00007ffffeee9000)
        libThread.so => /opt/bin/../lib/libThread.so (0x00007ffffee92000)
        libCore.so => /opt/bin/../lib/libCore.so (0x00007ffffe9fb000)
        libstdc++.so.6 => /opt/bin/../lib/libstdc++.so.6 (0x00007ffffe7d2000)
        libm.so.6 => /opt/bin/../lib/libm.so.6 (0x00007ffffe6f7000)
        libgcc_s.so.1 => /opt/bin/../lib/libgcc_s.so.1 (0x00007ffffe6dc000)
        libc.so.6 => /opt/bin/../lib/libc.so.6 (0x00007ffffe4d3000)
        /lib64/ld-linux-x86-64.so.2 (0x00007ffffffc8000)
        libtbb.so.2 => /opt/bin/../lib/libtbb.so.2 (0x00007ffffe48d000)
        libssl.so.3 => /opt/bin/../lib/libssl.so.3 (0x00007ffffe3e7000)
        libcrypto.so.3 => /opt/bin/../lib/libcrypto.so.3 (0x00007ffffdfb4000)
        libpcre2-8.so.0 => /opt/bin/../lib/libpcre2-8.so.0 (0x00007ffffdf18000)
        libz.so.1 => /opt/bin/../lib/libz.so.1 (0x00007ffffdefe000)
        liblzma.so.5 => /opt/bin/../lib/liblzma.so.5 (0x00007ffffded0000)
        libxxhash.so.0 => /opt/bin/../lib/libxxhash.so.0 (0x00007ffffdebd000)
        liblz4.so.1 => /opt/bin/../lib/liblz4.so.1 (0x00007ffffde99000)
        libzstd.so.1 => /opt/bin/../lib/libzstd.so.1 (0x00007ffffddc2000)

I’d like my final image to be as “lean” as possible, so I’m trying to copy just the parts of Root that are absolutely necessary for my program to run. I’ve sorted out the libs, but now I’m fighting with the PCM files : which ones must I bring along ?

For instance, if I bring all pcm files the program is running fine, but when using a smaller selection I get messages like :

Error in <TClass::LoadClassInfo>: no interpreter information for class TLeafI is available even though it has a TClass initialization routine.

Thanks,

_ROOT Version: 6.32.04
Platform: AlmaLinux:9
_Compiler:_gcc11.4


Hi Laurent,

Thanks for the post: that is an interesting exercise.

  • What set of PCM did you carry over?
  • Can you exclude that libTree is not loaded at runtime dynamically by your application? (TLeafI’s implementations should reside there)

Cheers,
D

Hi Danilo,

Here’s the list of pcm files I’ve copied to the docker image :

sh-5.1# ls /opt/lib/*.pcm
Cling_Runtime.pcm        MultiProc.pcm          ROOT_Foundation_Stage1_NoRTTI.pcm  TreeViewer.pcm
Cling_Runtime_Extra.pcm  Net.pcm                ROOT_Rtypes.pcm                    _Builtin_intrinsics.pcm
Core.pcm                 RIO.pcm                Thread.pcm                         _Builtin_stddef_max_align_t.pcm
Imt.pcm                  ROOT_Config.pcm        Tree.pcm                           libc.pcm
MathCore.pcm             ROOT_Foundation_C.pcm  TreePlayer.pcm                     std.pcm

For the record the list of libs :

sh-5.1# ls /opt/lib/lib*
/opt/lib/libCling.so      /opt/lib/libcrypto.so.3.0.7         /opt/lib/libssl.so.3.0.7
/opt/lib/libCore.so       /opt/lib/libfmt.a                   /opt/lib/libstdc++.so.6
/opt/lib/libImt.so        /opt/lib/libgcc_s-11-20231218.so.1  /opt/lib/libstdc++.so.6.0.29
/opt/lib/libMathCore.so   /opt/lib/libgcc_s.so.1              /opt/lib/libtbb.so.2
/opt/lib/libMultiProc.so  /opt/lib/liblz4.so.1                /opt/lib/libxxhash.so.0
/opt/lib/libNet.so        /opt/lib/liblz4.so.1.9.3            /opt/lib/libxxhash.so.0.8.2
/opt/lib/libRIO.so        /opt/lib/liblzma.so.5               /opt/lib/libz.so.1
/opt/lib/libThread.so     /opt/lib/liblzma.so.5.2.5           /opt/lib/libz.so.1.2.11
/opt/lib/libTree.so       /opt/lib/libm.so.6                  /opt/lib/libzstd.so.1
/opt/lib/libc.pcm         /opt/lib/libpcre2-8.so.0            /opt/lib/libzstd.so.1.5.1
/opt/lib/libc.so.6        /opt/lib/libpcre2-8.so.0.11.0
/opt/lib/libcrypto.so.3   /opt/lib/libssl.so.3

Concerning your second question, as far as I know no, I’m not dynamically loading libTree at runtime, or I least I’m not consciously intending to :wink: How can I double cross-check that ?

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.

Hi Laurent,

Sorry for missing your answer.
You can always check the set of loaded libs by invoking gSystem->ListLibraries()

Cheers,
D