flux-framework / dyad

DYAD: DYnamic and Asynchronous Data Streamliner
GNU Lesser General Public License v3.0
7 stars 5 forks source link

CMake CHECK_GLIBC_VERSION macro causes configure crashes on non-LC systems #115

Open ilumsden opened 6 months ago

ilumsden commented 6 months ago

On some non-LC systems, the CHECK_GLIBC_VERSION macro in cmake/modules/SetupCompiler.cmake causes configuration failures. This is because the .so file for GLibc does not always include the version number. Additionally, the .so file for GLibc rarely includes a dash. Both of these things must be present for CHECK_GLIBC_VERSION to pass without a FATAL_ERROR.

An example of a case where this error occurs is the Docker container for the Flux tutorial. That container is based on Ubuntu 22.04 and uses an apt installed version of GCC 11. When I replicate the commands run by CHECK_GLIBC_VERSION using bash commands, I see the following:

$ echo "GLibc output: $(gcc -print-file-name=libc.so.6)"
GLibc output: /usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu/libc.so.6

$ echo "GLibc realpath: $(realpath $(gcc -print-file-name=libc.so.6))"
GLibc realpath: /usr/lib/x86_64-linux-gnu/libc.so.6

Since the path does not contain a dash nor does it contain the version, CHECK_GLIBC_VERSION fails with the following:

2.401 -- The C compiler identification is GNU 11.4.0
2.968 -- The CXX compiler identification is GNU 11.4.0
3.020 -- Detecting C compiler ABI info
3.793 -- Detecting C compiler ABI info - done
3.834 -- Check for working C compiler: /usr/bin/cc - skipped
3.835 -- Detecting C compile features
3.837 -- Detecting C compile features - done
3.849 -- Detecting CXX compiler ABI info
4.587 -- Detecting CXX compiler ABI info - done
4.626 -- Check for working CXX compiler: /usr/bin/c++ - skipped
4.627 -- Detecting CXX compile features
4.630 -- Detecting CXX compile features - done
4.640 -- CMAKE_INSTALL_LIBDIR lib
4.687 CMake Error at cmake/modules/SetupCompiler.cmake:38 (MESSAGE):
4.687   Unknown glibc version: libc.6
4.687 Call Stack (most recent call first):
4.687   cmake/modules/SetupCompiler.cmake:42 (CHECK_GLIBC_VERSION)
4.687   CMakeLists.txt:120 (include)
4.687
4.687
4.688 -- Configuring incomplete, errors occurred!
4.688 See also "/home/fluxuser/dyad/build/CMakeFiles/CMakeOutput.log".
ilumsden commented 3 months ago

Fixed by #116