cmor icon indicating copy to clipboard operation
cmor copied to clipboard

arm64 build

Open durack1 opened this issue 1 year ago • 11 comments

There are now a number of conda variants that are supporting the Apple M1/arm64 architecture natively. As a low priority item, it would be interesting to investigate how easy/hard native CMOR builds would be to generate and support - does the CI environments support this architect natively yet?

Label CMOR 4.x for this one

durack1 avatar Aug 17 '22 01:08 durack1

@durack1 Has there been any demand for Arm builds of CMOR? CircleCI does support Arm.

I agree that this will be a low priority feature that will likely only appear in CMOR 4.x.

mauzey1 avatar Aug 17 '22 17:08 mauzey1

@mauzey1 I have just switched across to M1 for my personal laptop, and so while I could create an x86-64 anaconda/miniconda/mambaforge parallel install to my native arm64 I would prefer to keep everything native if possible

durack1 avatar Aug 17 '22 17:08 durack1

I am using my M1 (macOS) with the arm64 version as well and was not able to install CMOR, neither, not knowing why, until I found this issue.

fabrivelas avatar Sep 09 '22 10:09 fabrivelas

@fabrivelas, thanks for contributing. It is unlikely that CMOR3 will be supporting a native osx-arm64 build. We have started early-stage CMOR4 planning, and this is a priority item.

You are able to run CMOR3 in x86-64 emulation on the M1 chips, using the osx-64 CMOR builds. While we have not tested this path, it appears that you can install the osx-64 anaconda/miniconda etc variants, and then run the osx-64 CMOR3.7.0 version alongside your native osx-arm64 code - see for e.g. https://betterprogramming.pub/switching-between-multiple-conda-distributions-on-macos-b78b6b21720

durack1 avatar Sep 09 '22 14:09 durack1

Great, thank you @durack1, It worked great, I now have a x84-64 miniconda with CMOR alongside my arm64 mambaforge.

fabrivelas avatar Sep 09 '22 14:09 fabrivelas

@fabrivelas excellent, glad that you're back in action!

durack1 avatar Sep 11 '22 16:09 durack1

Just noting some of the library dependencies available as native osx-arm64: https://anaconda.org/conda-forge/libnetcdf https://anaconda.org/conda-forge/json-c https://anaconda.org/conda-forge/udunits2

ping @sashakames @mauzey1

durack1 avatar Aug 28 '23 17:08 durack1

Rust ran into this issue today with my M3 (cmor not found during conda search). However, i can built cmor following the installation guide but setting:

export CONDA_COMPILERS="clang_osx-arm64 gfortran_osx-arm64"

and forcing the config.sub with

echo 'echo arm64-apple-darwin' > config.sub

The configure runs as usual:

./configure --prefix=$PREFIX --with-python --with-uuid=$PREFIX --with-json-c=$PREFIX --with-udunits2=$PREFIX --with-netcdf=$PREFIX  --enable-verbose-test

This compiles and passes all tests.

larsbuntemeyer avatar Mar 15 '24 12:03 larsbuntemeyer

@larsbuntemeyer thanks for this feedback. We have been hitting some administrative issues getting access to GitHub Mx machines that we'd hoped to use for these osx-arm64 native builds, if what you describe above https://github.com/PCMDI/cmor/issues/663#issuecomment-1999550646 is a work around for this issue that would be good to know. Surely for this to work, you'd require access to an Mx machine running osx-arm64 natively, no?

durack1 avatar Mar 15 '24 12:03 durack1

Yes, i ran this on my laptop!

larsbuntemeyer avatar Mar 15 '24 12:03 larsbuntemeyer

Yes, i ran this on my laptop!

Ah ha. We've been using the build services of CircleCI to test and package up the conda builds, and haven't ascertained a clear path as to how to do that (or alternatively using GitHub infrastructure) to replace our current workflows... Hopefully soon...

durack1 avatar Mar 15 '24 22:03 durack1