Farama-Foundation / Arcade-Learning-Environment

The Arcade Learning Environment (ALE) -- a platform for AI research.
https://ale.farama.org/
GNU General Public License v2.0
2.18k stars 424 forks source link

undefined symbol: _ZNKSt10filesystem7__cxx114path17_M_find_extensionEv #406

Closed mcguiremichael closed 3 years ago

mcguiremichael commented 3 years ago

The full error message,

ImportError: /usr/local/lib/python3.6/dist-packages/ale_py.cpython-36m-x86_64-linux-gnu.so: undefined symbol: _ZNKSt10filesystem7__cxx114path17_M_find_extensionEv

occurs when I try to import ale_py after running

pip3 install .

in the Arcade-Learning-Environment directory. The installation finishes with no appearance of errors. I searched around, and mention of _ZNKSt10filesystem7__cxx114path17_M_find_extensionEv is returning no useful results anywhere else on the web. I wonder what could be causing this. The presence of 14 and 17 in that symbol suggests to me that it may be specific to c++14 or c++17, both of which I have used to compile other code on this machine and are still functioning.

I have installed vcpkg and the recommended libraries in a separate folder from Arcade-Learning-Environment.

Environment info: kernel: 4.15.0-135-generic OS: Ubuntu 18.04 Cmake: 3.19.4 gcc/g++: 8.4.0

JesseFarebro commented 3 years ago

So you're using an older version of libstdc++ that doesn't contain the filesystem symbols. I'd recommend either updating to Ubuntu 20.04 OR using the PPA ppa:ubuntu-toolchain-r/test and installing gcc-9 or gcc-10 which will solve this issue. If this isn't an option you can manually link against stdc++fs, i.e., add -lstdc++fs here:

https://github.com/mgbellemare/Arcade-Learning-Environment/blob/d7f80bd0e566e48ab5a783907da10a7cc42c499f/src/CMakeLists.txt#L28-L31

mcguiremichael commented 3 years ago

Solved via installing gcc-9. Thank you!