Dynamic linking is not done properly on Linux
Telemac compilation scripts do not use the "standard" way of linking libraires. This normal way should be to use -l
followed by the library name, without the library suffix and, on Linux, without the lib
prefix as well. Instead, the compilation script uses the absolute path of each of the shared library that we are linking to.
While this has no impact on Windows, it does on Linux because when linking with shared libraries, i.e. when doing dynamic linking, the resulting Telemac binaries contain the full path to each their external libraries. This can be checked by using readelf -d
on Telemac binaries, e.g. on TELEMAC-2D:
Dynamic section at offset 0x134b38 contains 62 entries:
Tag Type Name/Value
0x0000000000000001 (NEEDED) Shared library: [/home/d60881/telemac-mascaret/builds/S10.gfortran.dyn/lib/libgaia4telemac2d.so]
0x0000000000000001 (NEEDED) Shared library: [/home/d60881/telemac-mascaret/builds/S10.gfortran.dyn/lib/libkhione4telemac2d.so]
0x0000000000000001 (NEEDED) Shared library: [/home/d60881/telemac-mascaret/builds/S10.gfortran.dyn/lib/libwaqtel4telemac2d.so]
0x0000000000000001 (NEEDED) Shared library: [/home/d60881/telemac-mascaret/builds/S10.gfortran.dyn/lib/libstbtel4telemac2d.so]
0x0000000000000001 (NEEDED) Shared library: [/home/d60881/telemac-mascaret/builds/S10.gfortran.dyn/lib/libsisyphe4telemac2d.so]
0x0000000000000001 (NEEDED) Shared library: [/home/d60881/telemac-mascaret/builds/S10.gfortran.dyn/lib/libtomawac4telemac2d.so]
0x0000000000000001 (NEEDED) Shared library: [/home/d60881/telemac-mascaret/builds/S10.gfortran.dyn/lib/libad4telemac2d.so]
0x0000000000000001 (NEEDED) Shared library: [/home/d60881/telemac-mascaret/builds/S10.gfortran.dyn/lib/libnestor4telemac2d.so]
0x0000000000000001 (NEEDED) Shared library: [/home/d60881/telemac-mascaret/builds/S10.gfortran.dyn/lib/libbief4telemac2d.so]
0x0000000000000001 (NEEDED) Shared library: [/home/d60881/telemac-mascaret/builds/S10.gfortran.dyn/lib/libparallel4telemac2d.so]
0x0000000000000001 (NEEDED) Shared library: [/home/d60881/telemac-mascaret/builds/S10.gfortran.dyn/lib/libhermes4telemac2d.so]
0x0000000000000001 (NEEDED) Shared library: [/home/d60881/telemac-mascaret/builds/S10.gfortran.dyn/lib/libdamocles4telemac2d.so]
0x0000000000000001 (NEEDED) Shared library: [/home/d60881/telemac-mascaret/builds/S10.gfortran.dyn/lib/libspecial4telemac2d.so]
As such, Telemac folder can't be moved and its parent folder can't be renamed at all. To fix this, a "real" dynamic mode has been implemented by @yoann.audouin a while back. This mode should be generalized as it also works when linking with static libraries.