ACCESS-NRI / amami

Apache License 2.0
0 stars 0 forks source link

Write documentation for developers on how to install #13

Open truth-quark opened 2 months ago

truth-quark commented 2 months ago

This issue details a development install of amami on MacOS. Add this to the README...

Assuming homebrew has been installed in /opt/homebrew, some default paths need to be fixed to allow a MacOS install. in a fresh terminal:

# create a new conda environment
conda create -n amami-env
activate amami-env
conda install pip

# set up non standard cf-unit paths
export UDUNITS2_XML_PATH=/opt/homebrew/Cellar/udunits/2.2.28/share/udunits/udunits2.xml
export UDUNITS2_LIBDIR=/opt/homebrew/lib
export UDUNITS2_INCDIR=/opt/homebrew/Cellar/udunits/2.2.28/include

cd <your-amami-project-dir>
pip install -e .

# test run
amami -V

Hopefully this completes without errors & prints the amami version.

atteggiani commented 2 months ago

Minor changes:

truth-quark commented 2 months ago

For reference, these 2 links provided hints for the fix:

atteggiani commented 2 months ago

I think for now the development should be carried out with Python version 3.9.17 (the one I am using for the development) for consistency. So maybe it is better to specify that when you create the python environment:

conda create -n amami-env python=3.9.17

And I don't think cf-units has any issues with python 3.9.

truth-quark commented 2 months ago

I think for now the development should be carried out with Python version 3.9.17 (the one I am using for the development) for consistency. So maybe it is better to specify that when you create the python environment:

conda create -n amami-env python=3.9.17

I think we should target running against the major active versions of Python. There's currently 5 versions: https://devguide.python.org/versions/. This gets into a separate issue of CI/CD & using GitHub actions to run tests against multiple python versions.

And I don't think cf-units has any issues with python 3.9.

cf-units has hard coded paths which caused build breakages on MacOS (for headers, objs etc). The env variable fix solved it, so worth documenting for others :-)

atteggiani commented 2 months ago

Ok makes sense