NOAA-EMC / NCEPLIBS-bufr

The NCEPLIBS-bufr library contains routines and utilites for working with the WMO BUFR format.
Other
42 stars 19 forks source link

Python installation path #518

Closed AlexanderRichert-NOAA closed 11 months ago

AlexanderRichert-NOAA commented 11 months ago

I ran into a problem with installing bufr through spack. Basically, python/CMakeLists.txt points to CMAKE_INSTALL_FULL_LIBDIR to determine the installation path. On most systems, this will be a path that includes 'lib64/'. Typically, python packages are installed to a path whose value depends on the configuration of the python installation itself, specifically, it may use 'lib/' or 'lib64/'. The issues I encountered were the result of the python component being installed into lib64/, but when spack goes to write out the modulefile for bufr, it adds a path with lib/ when prepending to $PYTHONPATH, so the python module can't be found at run time.

Ideally, python/CMakeLists.txt would point to the installation path that is consistent with the python configuration. This can be a bit tricky, but theoretically it could be done based on the python configuration (using the output of "python -m sysconfig" or something to that effect), or the easiest route is probably to have an override variable that could be used by the spack recipe, but leave the default behavior as using CMAKE_INSTALL_FULL_LIBDIR. I'm happy to make the changes once we land on a solution.

jbathegit commented 11 months ago

@AlexanderRichert-NOAA

I don't have a strong background in python, and in fact most of that wrapper content was added to NCEPLIBS-bufr by others who have since moved on or who have just never bothered to respond when we've gone back and asked them for help to keep it maintained. And I have even less knowledge about spack.

So bottom line - if you have an idea that will work for what you need in spack and will still pass the existing CI testing for the library, then please go ahead and code it up and open a PR for it.

AlexanderRichert-NOAA commented 11 months ago

I'm going to close this. It looks like the easiest solution is the tweak the spack recipe, so I'd rather do that to accommodate the quirks/difficulties of python/spack than to change the package itself.