Problems installing yt with non-standard library locations

Hi yt community, I’m encountering errors when running python -c “import yt”. Background: I’m working in a python set-up on a shared linux system to which I do not have root access and the system wide python installation is older than what I need for the version of yt I’d like to run. So, I’m working with a set-up in a non-standard location and I think this may be the cause of the problems, but I don’t know how to proceed to fix it. My first approach was to pip install, as described on the yt install page. That failed with "segmentation fault (core dumped)” error, when testing the installation (python -c “import yt”). I tried all possible combinations of Python 3.11.4, Python 3.10.12 and yt 4.2.1 and yt 4.2.0, they all caused this issue. (Including when installing yt[full]). Because my other python libraries work without problems and the path to the yt executable is on the search PATH, I figure this is perhaps related to some non-python libraries required by yt. My next step was to install yt from source, which seems to confirm my suspicion: in this case python -c “import yt” yields a more informative error message: < Leaving out a long traceback > File "yt/geometry/selection_routines.pyx", line 1, in init yt.geometry.selection_routines # distutils: include_dirs = LIB_DIR ImportError: /lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /PATH/TO/YT/yt/utilities/lib/image_samplers.cpython-310-x86_64-linux-gnu.so) I checked that CXXABI_1.3.9 does indeed exist on the system and the path to it is included in the LD_LIBRARY_PATH in .bash_profile, however yt seems to look for it in the system wide folder (/lib64/) and not my local library folder ($HOME/GCC/lib64/). I would be grateful if someone has any ideas about how to get yt to use the correct (local) library path instead of the standard system wide path it is currently using. Sincerely Anne

Hi Anne, Ah, this sounds very frustrating! To be honest, the C++ linking was always the hardest thing for me, personally, whenever something went wrong with compiling. I'm happy to debug this over the mailing list, but if we end up getting too deep we might want to take it somewhere like Slack or GitHub so it can have faster iterations. The first things I'd suggest: - Look at the output of ldd on the specific .so file that was generated from the compilation. - Force a recompilation of the specific .so file, with something like "touch yt/utilities/lib/*.pyx" and then save the output of the recompilation. We'll want to look at the flags that get used in it, to see if they have anything odd. If I remember correctly, the compilation flags are usually inherited from the Python installation and match how that was built. - See if you can (momentarily at least) make it work by using LD_PRELOAD and pointing. None of these are going to fix it, I think, but they may provide some diagnostics to move forward. Sorry it has been tricky for you! -Matt On Thu, Jul 20, 2023 at 1:58 PM Anne Noer Kolborg via yt-users < yt-users@python.org> wrote:

Hi Anne, another quick thing you may want to try is to install as python -m pip install yt --no-binary yt This will force compilation for your specific platform. Best of luck Sent from Proton Mail for iOS On Thu, Jul 20, 2023 at 23:09, Matthew Turk <[matthewturk@gmail.com](mailto:On Thu, Jul 20, 2023 at 23:09, Matthew Turk <<a href=)> wrote:

Hi Anne, Ah, this sounds very frustrating! To be honest, the C++ linking was always the hardest thing for me, personally, whenever something went wrong with compiling. I'm happy to debug this over the mailing list, but if we end up getting too deep we might want to take it somewhere like Slack or GitHub so it can have faster iterations. The first things I'd suggest: - Look at the output of ldd on the specific .so file that was generated from the compilation. - Force a recompilation of the specific .so file, with something like "touch yt/utilities/lib/*.pyx" and then save the output of the recompilation. We'll want to look at the flags that get used in it, to see if they have anything odd. If I remember correctly, the compilation flags are usually inherited from the Python installation and match how that was built. - See if you can (momentarily at least) make it work by using LD_PRELOAD and pointing. None of these are going to fix it, I think, but they may provide some diagnostics to move forward. Sorry it has been tricky for you! -Matt On Thu, Jul 20, 2023 at 1:58 PM Anne Noer Kolborg via yt-users < yt-users@python.org> wrote:

Hi Anne, another quick thing you may want to try is to install as python -m pip install yt --no-binary yt This will force compilation for your specific platform. Best of luck Sent from Proton Mail for iOS On Thu, Jul 20, 2023 at 23:09, Matthew Turk <[matthewturk@gmail.com](mailto:On Thu, Jul 20, 2023 at 23:09, Matthew Turk <<a href=)> wrote:
participants (3)
-
Anne Noer Kolborg
-
Clément Robert
-
Matthew Turk