Skip to content

Commit ed96720

Browse files
authored
Update README.md
added information on creating and using a conda environment
1 parent 2526c8f commit ed96720

1 file changed

Lines changed: 22 additions & 5 deletions

File tree

README.md

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ Further information about GOTM can be found [here](https://gotm.net).
88

99
### Manual build and install
1010

11+
Note these instruction are writen for the development version of GOTM and the cases described below will only work with this version.
12+
1113
GOTM being written in Fortran requires compilation before it can be used.
1214

1315
Below is provided a short description on how to obtain the code, configure, compile and install GOTM.
@@ -24,6 +26,7 @@ cd GOTM
2426
Now clone the code to the local machine:
2527
```
2628
git clone --recurse-submodules https://github.com/gotm-model/code.git
29+
cd code
2730
```
2831
#### Configuring the code for compilation
2932

@@ -35,7 +38,9 @@ Furthermore, a Fortran compiler must be installed and discoverable by CMake.
3538

3639
NetCDF has been - and maybe still will be a headache - but it is assumed that NetCDF is installed with Fortran support. For Windows we provide a prebuilt set of libraries.
3740

38-
Configuration is done with cmake - and example being:
41+
*As an alternative to use system installed programs (CMake, Ninja, Fortran and required libraries) scroll to the bottom of the page(**) and follow the instructions to create a Conda environment with everything required. Then return and continue from here.*
42+
43+
Configuration is done with cmake - an example being:
3944
```
4045
cmake -G Ninja -B build -S code
4146
```
@@ -44,25 +49,25 @@ This will create a new folder - build - with the necessary information for actua
4449
The build system for GOTM provides support for options to pass to the actual compilation. These are provided as extra arguments to the above cmake execution. As and example to include support for ice - use the following:
4550

4651
```
47-
cmake -B build -S code -DGOTM_USE_STIM
52+
cmake -G Ninja -B build -S code -DGOTM_USE_STIM
4853
```
49-
It is always safe to completely remove the build folder and start all over
54+
If something goes wrong it is always safe to completely remove the build folder and start all over.
5055

5156
#### Compiling the code
5257

5358
If the cmake command did not result in any errors we are ready to actually compile the code into an executable:
5459
```
5560
cmake --build build
5661
```
57-
This will take a little while but should en up in a compiled GOTM executable in the build/folder.
62+
This will take a little while but should en up in a compiled GOTM executable in the build folder.
5863
This executable is ready to run but for convinience you might install it in a folder in the PATH on your computer - in which case you can just type - gotm - in any folder.
5964

6065
#### Installing the GOTM executable
6166
The installation also is done by CMake:
6267
```
6368
cmake --install build --prefix <folder_in_your_path>
6469
```
65-
To test if it works open a new terminal window and execute - gotm.
70+
To test if it works open a new terminal window and execute - *gotm*.
6671

6772
#### GOTM test cases
6873
GOTM comes with a number of ready to run test cases. There are also in a Git repository and can be obtained like:
@@ -74,3 +79,15 @@ Entering any of the cases folders and just executing - gotm - should run the mod
7479
An older description is provided here [GOTM homepage](http://www.gotm.net/portfolio/software).
7580

7681
(*) For people who intend to contribute to the GOTM source code a 'fork' is a better solution.
82+
83+
(**) Create a Conda environment.
84+
If a Conda is not already available install [miniconda](https://www.anaconda.com/docs/getting-started/miniconda/main). Activate the base environment and do (note you must be in the root of the GOTM source code - where the *environment.yml* files is):
85+
```
86+
conda env create -f environment.yml
87+
```
88+
If successful activate the *gfortran* environment.
89+
```
90+
conda activate gfortran
91+
```
92+
Return to the configuration instructions give further up.
93+

0 commit comments

Comments
 (0)