OSError: /home/ryb2kor/miniconda3/envs/modelinterpret/bin/../lib/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by /home/ryb2kor/tvm/build/libtvm.so)

Hi, I have a miniconda environment and I a trying to build my demo (python demo). When i do python3 build.py -bv, I am presented with an error. An excerpt containing the prime issue has been presented.

Traceback (most recent call last): File “/home/name_folder/Jetson-files/gpgpu_model_interpretability-share-tvm_interpret@37992f4032a/demo/tvm/model_lib_generator.py”, line 3, in import tvm File “/home/name/tvm/python/tvm/init.py”, line 26, in from ._ffi.base import TVMError, version, _RUNTIME_ONLY File “/home/name_folder/tvm/python/tvm/_ffi/init.py”, line 28, in 6from .base import register_error File “/home/name_folder/tvm/python/tvm/_ffi/base.py”, line 78, in _LIB, _LIB_NAME = _load_lib() [00:04:45.674 File “/home/name_folder/tvm/python/tvm/_ffi/base.py”, line 64, in _load_lib lib = ctypes.CDLL(lib_path[0], ctypes.RTLD_GLOBAL) self._handle = _dlopen(self._name, mode) OSError: /home/name_folder/miniconda3/envs/modelinterpret/bin/…/lib/libstdc++.so.6: version `GLIBCXX_3.4.30’ not found (required by /home/name_folder/tvm/build/libtvm.so)

The main issue seems to be with the tvm import. The version of tvm I’m using is 0.15.dev0 and the environment is built using miniconda. Can someone please help me in analyzing this error and further help me figure out how to solve this? TIA.

@tqchen @jwfromm @thierry

Hi, I have exactly the same issue with Anaconda. I saw the following post:

and did sudo apt-get install libstdc++6 as advised but got following message: libstdc++6 is already the newest version (12.3.0-1ubuntu1~22.04).

Thanks for your advices, Gilles

FYI, it seems to be due to gcc/g++ versions but not 100% sure given I worked on 2 different environments:

  • 1/ Python3.8 native (w/o conda) on Ubuntu 20.04 and gcc/g++ 9.4.0 that is OK.
  • 2/ Python3.8 with Anaconda on Ubuntu 22.04 and gcc/g++ 11.4.0 that is failing.

On environment 2/, I did the following:

I tried to update gcc/g++ using method 2 of How to Install GCC Compiler on Ubuntu {3 Simple Methods} and choose gcc/g++ version 9 (it installed 9.5.0 which I guess should work like 9.4.0).

So I could have gcc/g++ 9 natively on Ubuntu 22.04 (w/o conda) However I could not change gcc version as seen by my conda environment.

I could update to gcc-9.5.0 by creating again tvm-build conda environment. However despite this and despite another try with PKG_LDFLAGS = -static-libstdc++ in Makefile, I still fall into the same issue. External help would be more than welcome.