Linux based HPC clusters can use different Linux distributions or different versions of a given Linux distribution for different types of nodes in the HPC cluster.
When the Linux distribution on which the connector extension has been built uses a glibc version 2.14 or newer and the Linux distribution where the connector extension is used, i.e. where clck-analyze is executed, uses a glibc version lower than 2.14, clck-analyze is not able to execute the shared library of the connector extension due to a missing symbol.
clck-analyze will show a message like this:
<your check>... not found
and
ldd lib<your check>.so
will show the following message, in addition to other output:
./lib<your check>.so: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by ./lib<your check>.so)
The underlying reason is that memcpy is versioned by default as memcpy@GLIBC_2.14 starting in glibc version 2.14.
glibc versions lower than 2.14 will not have memcpy versioned like this.
The previous version, memcpy@GLIBC_2.2.5, is available in all glibc versions.
There are three solutions to this problem.
- The preferred solution is to compile the connector extension, i.e. lib<your check>.so, on a Linux distribution using a glibc version lower than 2.14
- If case option #1 cannot be used, you can enforce the use of the compatible memcpy@GLIBC_2.2.5 by adding the following code into the header file of your connector extension (as described here http://stackoverflow.com/questions/8823267/linking-against-older-symbol-version-in-a-so-file):
#if defined(__GNUC__) && defined(__LP64__) /* only with 64bit gcc, just to be sure */ #include <features.h> /* get the glibc version */ /* only change memcpy when the version is newer than 2.14 */ #if defined(__GLIBC__) && (__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 14) /* enforce mempcy to use the earlier, i.e. compatible, memcpy@GLIBC_2.2.5 */ __asm__(".symver memcpy,memcpy@GLIBC_2.2.5"); #endif #undef _FEATURES_H /* reload it ... usually necessary */ #endif
- The third solution is to use a wrapper function. This is also described on the above mentioned web page, but option #2 is simpler and easier to use.
Now you can compile your connector extension on a Linux distribution with a glibc version of 2.14 or newer and use it on a Linux distribution with a glibc version lower than 2.14.