Import grapth-tool with multiple GLIBCXX versions available on system

I’m trying to use graph-tool on my University’s HPC system. I’m having trouble importing the library because libgraph_tool_core.so attempts to use an incompatible libstdc++.so.6 version.

The import statement below (in Jupyter) generates this following error:

import sys
tool_path = "/home/cstansbu/miniconda3/lib/python3.9/site-packages"
sys.path.append(tool_path)
import graph_tool

Error:

ImportError: /sw/pkgs/arc/python3.9-anaconda/2021.11/bin/../lib/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by /home/cstansbu/miniconda3/lib/python3.9/site-packages/graph_tool/libgraph_tool_core.so)

Specifically, the import statement is sufficient to generate the same error above. I saw from the stack trace that the import error starts with dl_import().

import sys
tool_path = "/home/cstansbu/miniconda3/lib/python3.9/site-packages/graph_tool/"
sys.path.append(tool_path)
import libgraph_tool_core as libcore

I have a compatible libstdc++.so.6 implementation in another location. I have set LD_LIBRARY_PATH to point to the correct version. Despite this, libgraph_tool_core.so looks in /sw/pkgs/arc/python3.9-anaconda/2021.11/bin/../lib/. The correct LD_LIBRARY_PATH was set prior to installation via conda:

conda install -c conda-forge graph-tool

I have the following graph-tool version:

graph-tool                2.58             py39h7b6895e_0    conda-forge
graph-tool-base           2.58             py39h6234548_0    conda-forge

I don’t think that this is a graph-tool issue. But any guidance would be greatly appreciated.

C

EDIT: The libgraph_tool_core.so seems to be correctly linked to the appropriate libstdc++.so.6.

ldd libgraph_tool_core.so 
        linux-vdso.so.1 (0x00007ffd253ca000)
        libboost_iostreams.so.1.78.0 => /home/cstansbu/miniconda3/lib/python3.9/site-packages/graph_tool/./../../../libboost_iostreams.so.1.78.0 (0x000014a374e44000)
        libboost_python39.so.1.78.0 => /home/cstansbu/miniconda3/lib/python3.9/site-packages/graph_tool/./../../../libboost_python39.so.1.78.0 (0x000014a374e07000)
        libboost_context.so.1.78.0 => /home/cstansbu/miniconda3/lib/python3.9/site-packages/graph_tool/./../../../libboost_context.so.1.78.0 (0x000014a374e02000)
        libexpat.so.1 => /home/cstansbu/miniconda3/lib/python3.9/site-packages/graph_tool/./../../../libexpat.so.1 (0x000014a374dd3000)
        libstdc++.so.6 => /home/cstansbu/miniconda3/lib/python3.9/site-packages/graph_tool/./../../../libstdc++.so.6 (0x000014a37248b000)
        libc.so.6 => /lib64/libc.so.6 (0x000014a3720c6000)
        libgcc_s.so.1 => /home/cstansbu/miniconda3/lib/python3.9/site-packages/graph_tool/./../../../libgcc_s.so.1 (0x000014a374da8000)
        libgomp.so.1 => /home/cstansbu/miniconda3/lib/python3.9/site-packages/graph_tool/./../../../libgomp.so.1 (0x000014a374d6f000)
        librt.so.1 => /lib64/librt.so.1 (0x000014a371ebe000)
        libz.so.1 => /home/cstansbu/miniconda3/lib/python3.9/site-packages/graph_tool/./../../.././libz.so.1 (0x000014a374d55000)
        libbz2.so.1.0 => /home/cstansbu/miniconda3/lib/python3.9/site-packages/graph_tool/./../../.././libbz2.so.1.0 (0x000014a374d3f000)
        liblzma.so.5 => /home/cstansbu/miniconda3/lib/python3.9/site-packages/graph_tool/./../../.././liblzma.so.5 (0x000014a374d16000)
        libzstd.so.1 => /home/cstansbu/miniconda3/lib/python3.9/site-packages/graph_tool/./../../.././libzstd.so.1 (0x000014a371dfa000)
        libm.so.6 => /lib64/libm.so.6 (0x000014a371a78000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x000014a371858000)
        libdl.so.2 => /lib64/libdl.so.2 (0x000014a371654000)
        libutil.so.1 => /lib64/libutil.so.1 (0x000014a371450000)
        /lib64/ld-linux-x86-64.so.2 (0x000014a374c31000)

And:

strings home/cstansbu/miniconda3/lib/python3.9/site-packages/graph_tool/./../../../libstdc++.so.6 | grep GLIBCXX_3.4.29

Returns:

GLIBCXX_3.4.29
GLIBCXX_3.4.29

If you use conda’s Python interpreter you should not have to change sys.path. It seems you are trying to use a different Python interpreter than the one installed via conda, which of course is not going to work.

In any case, please open an issue at the conda-forge project, since this is not an upstream problem with graph-tool: Issues · conda-forge/graph-tool-feedstock · GitHub