Closed lboeman closed 12 months ago
Hi @lboeman. PRs are welcome. A few things to keep in mind regarding this:
conda install -c conda-forge nceplibs-g2c
)I am looking to release v2.0.1 in the next week or so. I'd like to get this in for that if possible.
Hi @EricEngle-NOAA Thanks for the response.
I was unaware that the NCEPLIBS-g2c library was available via conda. I think that between G2C_DIR and conda availability of the libraries, my concerns are addressed since there are workarounds to installing from source/pip within a conda environment.
Considering your final point, this change may generate more problems than allowing users to work through the available options, especially for less experienced users on shared systems. I think that nudging conda users towards a conda installation and leaving G2C_DIR as an alternative is probably less problematic than making that assumption for the user.
When the
CONDA_PREFIX
envvar is set , setup.py attempts to find libg2c inside the directory atCONDA_PREFIX
. If the user has installed their dependencies at one of the typical non-conda locations, e.g./usr/local
then setup.py fails to find the library and throws an exception.Steps to reproduce:
This issue can be addressed using the
G2C_DIR
envvar, but this behavior seems unexpected.It seems that either a conda-supplied or manually built g2c library could be supported by adjusting this section: https://github.com/NOAA-MDL/grib2io/blob/b9053dc4c76be162bc2311949573a89fa3c06485/setup.py#L26-L29 to prepend the dir at
CONDA_PREFIX
to the list of common dirs to search.I'm happy to work up a PR for this issue if it's welcome.