Open3D icon indicating copy to clipboard operation
Open3D copied to clipboard

Conda Ubuntu 22.04 libstdc++.so.6: version `GLIBCXX_3.4.30' not found

Open yxlao opened this issue 2 years ago • 1 comments

Checklist

Steps to reproduce the issue

On Ubuntu 22.04 with Conda environment, the libstdc++.so that comes with Conda may be older than the system's libstdc++. When compiling Open3D with the system's gcc, the compilation will work, but the import of Open3D python package may not work due to missing symbols (GLIBCXX_3.4.30).

This is an upstream issue with the Conda environment. The proper fix is for Conda to include a newer libstdc++ in its distribution.

The temporary fix is to use the system's libstdc++ inside the Conda environment. We provide the temporary fix in the comments.

Error message

ImportError while importing test module '/home/user/repo/Open3D/python/test/data/test_data.py'.                                                       
Hint: make sure your test modules/packages have valid Python names.                                                                                     
Traceback:                                                                                                                                              
../../../miniconda3/envs/open3d/lib/python3.9/importlib/__init__.py:127: in import_module                                                               
    return _bootstrap._gcd_import(name[level:], package, level)                                                                                         
../python/test/data/test_data.py:27: in <module>                                                                                                        
    import open3d as o3d                                                                                                                                
../../../miniconda3/envs/open3d/lib/python3.9/site-packages/open3d/__init__.py:90: in <module>                                                          
    from open3d.cpu.pybind import (camera, data, geometry, io, pipelines,                                                                               
E   ImportError: /home/user/miniconda3/envs/open3d/bin/../lib/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by /home/user/repo/Open3D
/build/lib/RelWithDebInfo/libOpen3D.so)


### Open3D, Python and System information

```markdown
- Operating system: Ubuntu 22.04
- Python version: Python 3.8
- System architecture: x86_64

Additional information

No response

yxlao avatar Sep 17 '22 21:09 yxlao

  1. First, check your system's libstdc++.so version:
    ➜   strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBCXX                                  
    GLIBCXX_3.4
    GLIBCXX_3.4.1
    GLIBCXX_3.4.2
    GLIBCXX_3.4.3
    GLIBCXX_3.4.4
    GLIBCXX_3.4.5
    GLIBCXX_3.4.6
    GLIBCXX_3.4.7
    GLIBCXX_3.4.8
    GLIBCXX_3.4.9
    GLIBCXX_3.4.10
    GLIBCXX_3.4.11
    GLIBCXX_3.4.12
    GLIBCXX_3.4.13
    GLIBCXX_3.4.14
    GLIBCXX_3.4.15
    GLIBCXX_3.4.16
    GLIBCXX_3.4.17
    GLIBCXX_3.4.18
    GLIBCXX_3.4.19
    GLIBCXX_3.4.20
    GLIBCXX_3.4.21
    GLIBCXX_3.4.22
    GLIBCXX_3.4.23
    GLIBCXX_3.4.24
    GLIBCXX_3.4.25
    GLIBCXX_3.4.26
    GLIBCXX_3.4.27
    GLIBCXX_3.4.28
    GLIBCXX_3.4.29
    GLIBCXX_3.4.30
    GLIBCXX_DEBUG_MESSAGE_LENGTH
    
    We can see that GLIBCXX_3.4.30 is indeed there.
  2. Activate your Conda environment.
  3. Create symbolic link to the system's libstdc++.so.
    ➜ cd $CONDA_PREFIX/lib
    ➜ mv libstdc++.so.6 libstdc++.so.6.old
    ➜ ln -s /usr/lib/x86_64-linux-gnu/libstdc++.so.6 libstdc++.so.6
    
    Now, the libs should look like this:
    ➜ cd $CONDA_PREFIX/lib
    ➜ ls -alh libstdc++*
    libstdc++.so -> libstdc++.so.6.0.29
    libstdc++.so.6 -> /usr/lib/x86_64-linux-gnu/libstdc++.so.6
    libstdc++.so.6.0.29
    libstdc++.so.6.old -> libstdc++.so.6.0.29
    

Reference: https://stackoverflow.com/a/73708979/1255535.

yxlao avatar Sep 17 '22 21:09 yxlao

After changing I got a problem with undefined symbol: cusolverDnSetStream

JonathanLehner avatar Nov 01 '22 17:11 JonathanLehner

thanks, it works for me

VsWilson avatar Apr 04 '23 14:04 VsWilson

Thanks, worked for me too. Ubuntu 24.04, Anaconda 4.14.0

wb666greene avatar Apr 06 '23 19:04 wb666greene

  1. First, check your system's libstdc++.so version:

    ➜   strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBCXX                                  
    GLIBCXX_3.4
    GLIBCXX_3.4.1
    GLIBCXX_3.4.2
    GLIBCXX_3.4.3
    GLIBCXX_3.4.4
    GLIBCXX_3.4.5
    GLIBCXX_3.4.6
    GLIBCXX_3.4.7
    GLIBCXX_3.4.8
    GLIBCXX_3.4.9
    GLIBCXX_3.4.10
    GLIBCXX_3.4.11
    GLIBCXX_3.4.12
    GLIBCXX_3.4.13
    GLIBCXX_3.4.14
    GLIBCXX_3.4.15
    GLIBCXX_3.4.16
    GLIBCXX_3.4.17
    GLIBCXX_3.4.18
    GLIBCXX_3.4.19
    GLIBCXX_3.4.20
    GLIBCXX_3.4.21
    GLIBCXX_3.4.22
    GLIBCXX_3.4.23
    GLIBCXX_3.4.24
    GLIBCXX_3.4.25
    GLIBCXX_3.4.26
    GLIBCXX_3.4.27
    GLIBCXX_3.4.28
    GLIBCXX_3.4.29
    GLIBCXX_3.4.30
    GLIBCXX_DEBUG_MESSAGE_LENGTH
    

    We can see that GLIBCXX_3.4.30 is indeed there.

  2. Activate your Conda environment.

  3. Create symbolic link to the system's libstdc++.so.

    ➜ cd $CONDA_PREFIX/lib
    ➜ mv libstdc++.so.6 libstdc++.so.6.old
    ➜ ln -s /usr/lib/x86_64-linux-gnu/libstdc++.so.6 libstdc++.so.6
    

    Now, the libs should look like this:

    ➜ cd $CONDA_PREFIX/lib
    ➜ ls -alh libstdc++*
    libstdc++.so -> libstdc++.so.6.0.29
    libstdc++.so.6 -> /usr/lib/x86_64-linux-gnu/libstdc++.so.6
    libstdc++.so.6.0.29
    libstdc++.so.6.old -> libstdc++.so.6.0.29
    

Reference: https://stackoverflow.com/a/73708979/1255535.

Thanks, this works!

One thing worth noticed is that don't forget to install six for mujoco-based environments

glorgao avatar Dec 06 '23 11:12 glorgao

Thanks, it works for me!

55aalina avatar Mar 16 '24 05:03 55aalina