Skip to content

Commit CRTMv3 configuration (backward compatible with 2.4) #19

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 36 commits into
base: master
Choose a base branch
from

Conversation

karpob
Copy link
Collaborator

@karpob karpob commented May 8, 2025

Description

Adds CRTMv3 capability while maintaining 2.4 compatibility. Also modernizes setup removing deprecated (or soon to be deprecated) "python setup.py install" method in favor of "pip install . " method. Adds helper scripts to install CRTMv3 + pyCRTM, along with dependencies using miniconda.

Also resolves #17 fixing issues related to setuptools version changes, along with f2py issues. This is done by replacing f2py executable which has bug related to passing preprocessor directives with "python -m numpy.f2py" which passes preprocessor directives correctly.

Issue(s) addressed

Resolves #17

Dependencies

List the other PRs that this PR is dependent on:

  • none

Impact

Expected impact on downstream repositories:
None

Checklist

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have run the unit tests before creating the PR

karpob and others added 30 commits June 29, 2023 16:12
…_library_path load, throw breadcrumbs to user to set dyld_library_path, because you that is a no-no to do automatically.
…only build option vs distutil) bug that ignores any directive flags for #ifdef. Force the issue by putting it into f90flags.
karpob and others added 3 commits May 7, 2025 12:12
…default in miniconda, and modernize the install process to use pip install ., instead of python setup.py install."
@karpob karpob self-assigned this May 8, 2025
for root,dirs,filez in os.walk(searchPath):
for name in filez:
srcPath = os.path.join(root,name)
if(not ('ODAS' in srcPath or 'Big_Endian' in srcPath)):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@karpob as an FYI: future CRTMv3 after v3.2.x will be netCDF only.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah my thought is when it's netcdf only to move all of that out of setup.py into something like cartopy does for higher resolution maps where it downloads on request when it doesn't find anything. Also, at some point figure out how to remove setup.py completely.

@karpob karpob changed the title Commit CRTMv3 configuration (backward compatible with 2.7) Commit CRTMv3 configuration (backward compatible with 2.4) May 10, 2025
@chengdang
Copy link

chengdang commented May 16, 2025

Hello Bryan, This is cool! I like make_it_so.sh very much. I used ./make_it_so.sh apple_silicon with M2 chip

There are a few hiccups though that I had to manually install some libraries, which seems to be caused by the failure of activating a virtual environment with the following command.

export CONDA_VENV='pycrtm'
conda create --name ${CONDA_VENV} python scikit-build h5py netcdf4 gfortran libnetcdf netcdf-fortran meson cmake git git-lfs matplotlib
Channels:w
 - defaults
Platform: osx-arm64
Collecting package metadata (repodata.json): done
Solving environment: failed

PackagesNotFoundError: The following packages are not available from current channels:

  - netcdf-fortran

Current channels:

  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r

To search for alternate channels that may provide the conda package you're
looking for, navigate to

    https://anaconda.org

and use the search bar at the top of the page.

I'm able to install netcdf-fortran with conda forge though:

conda install conda-forge::netcdf-fortran

All other libs work with conda create.

@karpob
Copy link
Collaborator Author

karpob commented May 17, 2025

@chengdang Good catch! I forgot to move my .condarc when I was testing this (I usually just put conda-forge by default by habit to avoid licensing issues.) I added a line conda config --add channels conda-forge that seems to take care of it when I ran a test (duplicating your issue, then fixing it with the extra line).

Copy link

@chengdang chengdang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick fix! Everything works as expected now. I am able to create pycrtm, and run the example. Thank you!

@karpob
Copy link
Collaborator Author

karpob commented May 19, 2025

I added back the --fcompiler switch as it's necessary for older builds (spack 1.6.0, trying to build with intel, for example). Hopefully we don't get to a point where they update f2py to throw an error instead of a warning.

@karpob
Copy link
Collaborator Author

karpob commented May 20, 2025

Also added fix per #20 where LD_LIBRARY_PATH wasn't set automatically as designed, when using shared libraries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

weird scikit builld problem with python versions >3.11
3 participants