pystan: Compilation crashes with `undefined symbol: _ZSt28__throw_bad_array_new_lengthv` (Fedora 34, gcc 11)
After installing pystan and running the 8schools example, the compilation crashes with error message
ImportError: /home/solant/.cache/httpstan/4.4.2/models/sk7xw5y6/stan_services_model_sk7xw5y6.cpython-37m-x86_64-linux-gnu.so: undefined symbol: _ZSt28__throw_bad_array_new_lengthv
I’m running Fedora 34, I tried both the most recent python version and 3.7.10. Any idea what’s wrong? I couldn’t find anything by googling the above error.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 21 (5 by maintainers)
Commits related to this issue
- Use a sentinel for managing vectors' memory StdVectorSentinel makes a proper life-cycle management for std::vectors' buffers possible. Duplication seems needed as fused types can't be used as attrib... — committed to jjerphan/scikit-learn by jjerphan 3 years ago
- Use a sentinel for managing vectors' memory StdVectorSentinel makes a proper life-cycle management for std::vectors' buffers possible. Duplication seems needed as fused types can't be used as attrib... — committed to jjerphan/scikit-learn by jjerphan 3 years ago
@joshua-cogliati-inl’s work around is functional.
It’s probably better to make modification in the virtual environment one is using to back-up previous shared objects:
I think this is the GCC commit that is causing this problem: https://github.com/gcc-mirror/gcc/commit/f92a504fdd943527687faf9557e0b39ff7fe6125
And basically, conda has libstdc++.so.6.0.28 but fedora 34 has libstdc++.so.6.0.29:
A temporary workaround until conda gets an updated libstdc++ is to go into your miniconda directory and force it to use the system libstdc++:
Seems like people still come from Google over to this issue with conda-related compiler issues. Thus I wanted to give a piece of brief information on how to fix these problems.
libstdc++from your system. The version depends on which source for your package you choose. There are two main distributions using thecondapackage manager: Anaconda and conda-forge. They use a similar setup but vary in the versions of packages they provide.libstdc++should be newer than the one on your OS. Thus you would see a linker error when compiling compared to theImportErrorhere.conda install c-compiler cxx-compiler/mamba install c-compiler cxx-compiler. This will then set the environment variablesCCandCXXto the provided compiler and also setCFLAGS,CXXFLAGS,LDFLAGSto build and link against all libraries in the environment (including thelibstdc++).Thanks for the update. I’ll spin up a fedora 34 VM and see if I can find out what is wrong.