nasa / HyperCP

Other
41 stars 23 forks source link

sixs_json fails to build on mac #235

Closed oceancolorcoder closed 1 week ago

oceancolorcoder commented 2 months ago

@raphidoc

After PR #232, I was able to update the environment and run on linux. On mac, I first tried to merge dev into 6S_json branch which overwrote the PR changes (!) Once I had restored them (yml file and PL1B_FRM), I tried to update the environment, but was unable to:

conda env update --file environment.yml --prune
Channels:
 - conda-forge
 - ocdb
 - defaults
Platform: osx-arm64
Collecting package metadata (repodata.json): done
Solving environment: failed

LibMambaUnsatisfiableError: Encountered problems while solving:
  - nothing provides sixs_json needed by j6s-1.0.0-pyhd8ed1ab_0

Could not solve for environment specs
The following package could not be installed
└─ j6s is not installable because it requires
   └─ sixs_json, which does not exist (perhaps a missing channel).

Odd that -defaults is restored here; it is not in the yml file.

raphidoc commented 2 months ago

It's weird that it says it doesn't exist. Everything was built successfully on conda-forge for osx_64 and the installer for osx-64 does exist here: https://anaconda.org/conda-forge/sixs_json. I'll try to get access to a Mac and test it on my end.

This could be related to the defaults channel still appearing even if not specified in the yaml file. @oceancolorcoder, do you have a .condarc file? If so, could you paste its content here?

oceancolorcoder commented 2 months ago

My ~/.condarc has defaults. I will take it out and try again.

channels:
  - defaults
oceancolorcoder commented 2 months ago

@raphidoc I removed ~/.condarc and got the same result.

raphidoc commented 2 months ago

Could you try this command on a test environment: conda install conda-forge::sixs_json ?

oceancolorcoder commented 2 months ago

(with .condarc removed)

(base) daurin@pcp513347pcs:~/GitRepos/HyperCP$ conda install conda-forge::sixs_json Channels:

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

Current channels:

oceancolorcoder commented 2 months ago

Btw. conda-forge at that url above is very, very slow to respond

raphidoc commented 2 months ago

So, I likely found the problem here. Your architecture is osx-arm64, which is different from osx-64. This architecture is not supported by default on conda-forge. I'm adding support for it and come back to you when it's done.

For reference, see: https://conda-forge.org/blog/2020/10/29/macos-arm64/#how-to-add-a-osx-arm64-build-to-a-feedstock

raphidoc commented 2 months ago

Hi @oceancolorcoder, the build was successful on osx-arm64, and the installer is now available on https://anaconda.org/conda-forge/sixs_json . Give it a try when you have the time!

oceancolorcoder commented 2 months ago

Excellent! I will try it asap. Thanks.

oceancolorcoder commented 1 month ago

@raphidoc I was able to update the environment with with sixs_json on mac M3 architecture. However, this somehow created an environment problem with scipy that I have not yet resolved:

File "/Users/daurin/GitRepos/HyperCP/Source/Utilities.py", line 15, in <module>
    import scipy.interpolate
  File "/opt/anaconda3/envs/hypercp/lib/python3.11/site-packages/scipy/interpolate/__init__.py", line 167, in <module>
    from ._interpolate import *
  File "/opt/anaconda3/envs/hypercp/lib/python3.11/site-packages/scipy/interpolate/_interpolate.py", line 8, in <module>
    import scipy.special as spec
  File "/opt/anaconda3/envs/hypercp/lib/python3.11/site-packages/scipy/special/__init__.py", line 663, in <module>
    from . import _ufuncs
ImportError: dlopen(/opt/anaconda3/envs/hypercp/lib/python3.11/site-packages/scipy/special/_ufuncs.cpython-311-darwin.so, 0x0002): Library not loaded: @rpath/liblapack.3.dylib
  Referenced from: <21AC3461-B250-3669-9F35-014B5287395D> /opt/anaconda3/envs/hypercp/lib/python3.11/site-packages/scipy/special/_ufuncs.cpython-311-darwin.so
  Reason: tried: '/opt/anaconda3/envs/hypercp/lib/python3.11/site-packages/scipy/special/liblapack.3.dylib' (no such file), '/opt/anaconda3/envs/hypercp/lib/python3.11/site-packages/scipy/special/../../../../liblapack.3.dylib' (no such file), '/opt/anaconda3/envs/hypercp/lib/python3.11/site-packages/scipy/special/liblapack.3.dylib' (no such file), '/opt/anaconda3/envs/hypercp/lib/python3.11/site-packages/scipy/special/../../../../liblapack.3.dylib' (no such file), '/opt/anaconda3/envs/hypercp/bin/../lib/liblapack.3.dylib' (no such file), '/opt/anaconda3/envs/hypercp/bin/../lib/liblapack.3.dylib' (no such file), '/usr/local/lib/liblapack.3.dylib' (no such file), '/usr/lib/liblapack.3.dylib' (no such file, not in dyld cache)
oceancolorcoder commented 1 month ago

I will be reverting my environment until after OOXXVI when we can do more testing.

raphidoc commented 1 month ago

Yes, we will check that later.

First, I would install in a fresh new environment. It could explain the broken link to dynamic libraries if you tried to update your existing environment (with the former dependency installed).

If it still doesn't work, I would try to uninstall and reinstall just scipy. It seems to work as reported here: https://github.com/scikit-learn/scikit-learn/issues/22522 https://forums.developer.apple.com/forums/thread/693696

If ever needed, this might be useful to deal with arm64 and intel architecture on mac os with conda: https://stackoverflow.com/questions/65415996/how-to-specify-the-architecture-or-platform-for-a-new-conda-environment-apple

oceancolorcoder commented 3 weeks ago

@raphidoc I merged nasa:dev into nasa:6S_json and I have successfully built the new environment for that branch. The code runs, but the res_py6s is always populated by all zeroes. Tested on sample pySAS and TriOS for all regimes. image

oceancolorcoder commented 3 weeks ago

@raphidoc I've renamed all instances of "py6s" with "sixS" (varying cases). Please update your fork with pull from nasa:6S_json

oceancolorcoder commented 1 week ago

@raphidoc as this is no longer an environment/build issue. I am going to close this and open a new issue for the zeroes.