-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update installation instructions (#9)
- Loading branch information
Showing
4 changed files
with
174 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -82,9 +82,74 @@ Covering those functions is a future goal of this project. | |
The current code in this repo are early experiments with the goal of exploring details fo the Fortran works and testing different options for creating an interface with C. | ||
Later on, we will use this knowledge to bind it with Python | ||
|
||
### Usage | ||
## Prerequisites | ||
|
||
* Make sure you have all the sources: | ||
pyRTE-RRTMGP is currently only tested on x86_64 architecture with Linux and MacOS. The package might also work with other architectures (such as Apple Silicone or Linux ARM), but this is not tested. | ||
|
||
To build and install the package, you need the conda package manager. If you don't have conda installed, you can install it from [here](https://docs.conda.io/en/latest/miniconda.html). | ||
|
||
The package source code is hosted [on GitHub](https://github.com/earth-system-radiation/pyRTE-RRTMGP) and uses git submodules to include the [RTE+RRTMGP Fortran software](https://earth-system-radiation.github.io/rte-rrtmgp/). The easiest way to install pyRTE-RRTMGP is to use `git`. You can install git from [here](https://git-scm.com/downloads). | ||
|
||
### Installation with conda (recommended) | ||
|
||
1. Clone the repository: | ||
|
||
```bash | ||
git clone [email protected]:earth-system-radiation/pyRTE-RRTMGP.git | ||
``` | ||
|
||
or | ||
|
||
```bash | ||
git clone https://github.com/earth-system-radiation/pyRTE-RRTMGP.git | ||
``` | ||
|
||
After cloning the repository, enter the repository directory: | ||
|
||
```bash | ||
cd pyRTE-RRTMGP | ||
``` | ||
|
||
2. Update the submodules: | ||
|
||
```bash | ||
git submodule update --init --recursive | ||
``` | ||
|
||
3. Make sure you have conda installed. If not, you can install it from [here](https://docs.conda.io/en/latest/miniconda.html). | ||
To make sure your conda setup is working, run the command below: | ||
|
||
```bash | ||
conda --version | ||
``` | ||
|
||
If this runs without errors, you are good to go. | ||
|
||
4. Install the conda build requirements (if you haven't already): | ||
```bash | ||
conda install conda-build conda-verify | ||
``` | ||
5. Build the conda package locally: | ||
```bash | ||
conda build conda.recipe | ||
``` | ||
6. Install the package in your current conda environment: | ||
```bash | ||
conda install -c ${CONDA_PREFIX}/conda-bld/ pyrte | ||
``` | ||
Note: This will install the package in your current conda environment. If you want to install the package in a different environment, activate your environment before running the `conda install` command above. | ||
### Installation with pip | ||
You also have the option to build and install the package with pip. However, this is not recommended as it requires you to have a working Fortran compiler and other prerequisites installed on your system. | ||
To install with pip, you first need to clone the repo (``git clone [email protected]:earth-system-radiation/pyRTE-RRTMGP.git``) and update the submodules (``git submodule update --init --recursive``) as described in the conda installation instructions above. | ||
``` bash | ||
git submodule update --init --recursive | ||
|
@@ -112,9 +177,6 @@ Once built, the module will be located in a folder called `pyrte` | |
## Pytest Setup Instructions | ||
* Run `pip3 install pytest` | ||
|
||
### Pytest Usage | ||
* Run `cd test/` | ||
* Create/update env (if you haven't already) by running `pip3 install -r requirements-test.txt` | ||
* Go to the 'tests' folder: `cd tests/` | ||
* Install the test prerequisites (if you haven't already) by running `pip3 install -r requirements-test.txt` | ||
* Run `pytest` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
# Installation and Setup | ||
|
||
pyRTE-RRTMGP is currently in early stages of development and is not yet available on conda forge. | ||
|
||
To install the package, you can clone the repository and build and install the conda package locally. | ||
|
||
## Prerequisites | ||
|
||
pyRTE-RRTMGP is currently only tested on x86_64 architecture with Linux and MacOS. | ||
The package might also work with other architectures (such as Apple Silicone or Linux ARM), but this is not tested. | ||
|
||
To build and install the package, you need the conda package manager. If you don't have conda installed, you can install it from [here](https://docs.conda.io/en/latest/miniconda.html). | ||
|
||
The package source code is hosted [on GitHub](https://github.com/earth-system-radiation/pyRTE-RRTMGP) and uses git submodules to include the [RTE+RRTMGP Fortran software](https://earth-system-radiation.github.io/rte-rrtmgp/). The easiest way to install pyRTE-RRTMGP is to use `git`. You can install git from [here](https://git-scm.com/downloads). | ||
|
||
## Installation with conda (recommended) | ||
|
||
1. Clone the repository: | ||
|
||
```bash | ||
git clone [email protected]:earth-system-radiation/pyRTE-RRTMGP.git | ||
``` | ||
|
||
or | ||
|
||
```bash | ||
git clone https://github.com/earth-system-radiation/pyRTE-RRTMGP.git | ||
``` | ||
|
||
After cloning the repository, enter the repository directory: | ||
|
||
```bash | ||
cd pyRTE-RRTMGP | ||
``` | ||
|
||
2. Update the submodules: | ||
|
||
```bash | ||
git submodule update --init --recursive | ||
``` | ||
|
||
3. Make sure you have conda installed. If not, you can install it from [here](https://docs.conda.io/en/latest/miniconda.html). | ||
To make sure your conda setup is working, run the command below: | ||
|
||
```bash | ||
conda --version | ||
``` | ||
|
||
If this runs without errors, you are good to go. | ||
|
||
4. Install the conda build requirements (if you haven't already): | ||
```bash | ||
conda install conda-build conda-verify | ||
``` | ||
5. Build the conda package locally: | ||
```bash | ||
conda build conda.recipe | ||
``` | ||
6. Install the package in your current conda environment: | ||
```bash | ||
conda install -c ${CONDA_PREFIX}/conda-bld/ pyrte | ||
``` | ||
Note: This will install the package in your current conda environment. If you want to install the package in a different environment, activate your environment before running the `conda install` command above. | ||
## Installation with pip | ||
You also have the option to build and install the package with pip. However, this is not recommended as it requires you to have a working Fortran compiler and other prerequisites installed on your system. | ||
To install with pip, you first need to clone the repo (``git clone [email protected]:earth-system-radiation/pyRTE-RRTMGP.git``) and update the submodules (``git submodule update --init --recursive``) as described in the conda installation instructions (above)[#installation-with-conda-recommended]. | ||
Then, make sure you have the necessary dependencies installed: | ||
```bash | ||
Then, make sure you have the necessary dependencies installed: | ||
```bash | ||
sudo apt install -y \ | ||
libnetcdff-dev \ | ||
gfortran-10 \ | ||
python3-dev \ | ||
cmake | ||
``` | ||
Next, run pip to compile the Fortran code, build, and install the package: | ||
``` bash | ||
pip install -e . | ||
``` | ||
Once built, the module will be located in a folder called `pyrte`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
numpy>=1.21.1 | ||
pytest>=7.4.0 | ||
pytest>=7.4.0 |