Skip to content

Commit

Permalink
Update for upstream merge of Miniforge and Mambaforge (#692)
Browse files Browse the repository at this point in the history
Make it possible to install the dependencies for pyarts into an
existing environment. Adapt the README.md accordingly.

Rename presets from *-mamba to *-conda
  • Loading branch information
olemke authored Oct 18, 2023
1 parent 885ff40 commit 30c3d99
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 39 deletions.
24 changes: 12 additions & 12 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
}
},
{
"name": "default-gcc-mamba",
"name": "default-gcc-conda",
"inherits": "base-default",
"generator": "Unix Makefiles",
"binaryDir": "${sourceDir}/build",
Expand All @@ -48,51 +48,51 @@
}
},
{
"name": "perf-gcc-mamba",
"inherits": "default-gcc-mamba",
"name": "perf-gcc-conda",
"inherits": "default-gcc-conda",
"environment": {
"CFLAGS": "-isystem $env{CONDA_PREFIX}/include -fno-omit-frame-pointer",
"CXXFLAGS": "$env{CFLAGS}"
}
},
{
"name": "default-clang-mamba",
"inherits": "default-gcc-mamba",
"name": "default-clang-conda",
"inherits": "default-gcc-conda",
"cacheVariables": {
"CMAKE_CXX_COMPILER": "$env{CONDA_PREFIX}/bin/clang++",
"CMAKE_C_COMPILER": "$env{CONDA_PREFIX}/bin/clang",
"CMAKE_Fortran_COMPILER": "$env{CONDA_PREFIX}/bin/gfortran"
}
},
{
"name": "mac-gcc13-hb-mamba",
"inherits": "default-gcc-mamba",
"name": "mac-gcc13-hb-conda",
"inherits": "default-gcc-conda",
"cacheVariables": {
"CMAKE_C_COMPILER": "gcc-13",
"CMAKE_CXX_COMPILER": "g++-13",
"CMAKE_Fortran_COMPILER": "gfortran-13"
}
},
{
"name": "macm1-clang-hb-mamba",
"inherits": "default-gcc-mamba",
"name": "macm1-clang-hb-conda",
"inherits": "default-gcc-conda",
"cacheVariables": {
"CMAKE_CXX_COMPILER": "/opt/homebrew/opt/llvm/bin/clang++",
"CMAKE_C_COMPILER": "/opt/homebrew/opt/llvm/bin/clang",
"CMAKE_Fortran_COMPILER": "gfortran-13"
}
},
{
"name": "macintel-clang-hb-mamba",
"inherits": "default-gcc-mamba",
"name": "macintel-clang-hb-conda",
"inherits": "default-gcc-conda",
"cacheVariables": {
"CMAKE_CXX_COMPILER": "/usr/local/opt/llvm/bin/clang++",
"CMAKE_C_COMPILER": "/usr/local/opt/llvm/bin/clang",
"CMAKE_Fortran_COMPILER": "gfortran-13"
}
},
{
"name": "levante-gcc-mamba",
"name": "levante-gcc-conda",
"inherits": "base-default",
"cacheVariables": {
"CMAKE_C_COMPILER": "/sw/spack-levante/gcc-11.2.0-bcn7mb/bin/gcc",
Expand Down
45 changes: 24 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ ARTS is free software. Please see the file COPYING for details.

If you use data generated by ARTS in a scientific publication, then please
mention this and cite the most appropriate of the ARTS publications that are

summarized on http://www.radiativetransfer.org/docs/

[CONTRIBUTING.md](CONTRIBUTING.md) provides information on contributing
Expand All @@ -22,7 +21,7 @@ For building and installation instructions please read below.
Dependencies
------------

Build Prerequisites (provided by mambaforge):
Build Prerequisites (provided by Miniforge3):

- gcc/g++ >=11 (or llvm/clang >=15)
- cmake (>=3.18)
Expand All @@ -31,7 +30,7 @@ Build Prerequisites (provided by mambaforge):
- libc++ (only for clang)
- libmicrohttpd (>=0.9, optional, for documentation server)
- netcdf (optional)
- Python3 (3.9, 3.10, 3.11)
- Python3 (3.9, 3.10, 3.11, 3.12)
- required modules:
docutils
lark-parser
Expand All @@ -56,29 +55,33 @@ To build the documentation you also need:
Building ARTS
-------------

The following instructions assume that you are using mambaforge as a build environment. The installer is available at
[the project's Github page](https://github.com/conda-forge/miniforge#mambaforge).
The following instructions assume that you are using Miniforge3 as a build environment. The installer is available at
[the project's Github page](https://github.com/conda-forge/miniforge#miniforge).

Use the provided `environment-dev-{linux,mac}.yml` files to install
all required dependencies into your current conda environment.

Use the provided `environment-dev-{linux,mac}.yml` files to create a conda
environment with all required dependencies. The environment will be called
`pyarts-dev`:
Optionally, a separate environment for development can be created, if you want to keep your current environment clean:

Linux:
```
mamba env create -f environment-dev-linux.yml
mamba create -n pyarts-dev python=3.10
mamba activate pyarts-dev
```

macOS:
Install dependencies on Linux:
```
mamba env create -f environment-dev-mac.yml
mamba env update -f environment-dev-linux.yml
```

Here are the steps to use `cmake` to build ARTS.
Install dependencies on macOS:
```
mamba env update -f environment-dev-mac.yml
```

Next, follow these steps to use `cmake` to build ARTS:
```
mamba activate pyarts-dev
cd arts
cmake --preset=default-gcc-mamba # On macOS use default-clang-mamba
cmake --preset=default-gcc-conda # On macOS use default-clang-conda
cmake --build build -jX
```

Expand Down Expand Up @@ -117,7 +120,7 @@ rm -rf build
To build with assertions and debugging symbols use:

```
cmake --preset=default-gcc-mamba -DCMAKE_BUILD_TYPE=RelWithDebInfo
cmake --preset=default-gcc-conda -DCMAKE_BUILD_TYPE=RelWithDebInfo
```

This configuration offers a good balance between performance and debugging
Expand All @@ -127,7 +130,7 @@ cases, the full debug configuration can be enabled. Note that ARTS runs a lot
slower in this configuration:

```
cmake --preset=default-gcc-mamba -DCMAKE_BUILD_TYPE=Debug
cmake --preset=default-gcc-conda -DCMAKE_BUILD_TYPE=Debug
```


Expand Down Expand Up @@ -164,7 +167,7 @@ is available in the same location as ARTS itself. If necessary, a custom path
can be specified.

```
cmake --preset=default-gcc-mamba -DARTS_XML_DATA_PATH=/home/myname/arts-xml-data
cmake --preset=default-gcc-conda -DARTS_XML_DATA_PATH=/home/myname/arts-xml-data
```

If arts-xml-data cannot be found, those tests are ignored.
Expand Down Expand Up @@ -261,7 +264,7 @@ Enable NetCDF: The basic matpack types can be read from NetCDF files, if NetCDF
support is enabled:

```
cmake --preset=default-gcc-mamba -DENABLE_NETCDF=1
cmake --preset=default-gcc-conda -DENABLE_NETCDF=1
```

Precompiled headers: PCH can speed up builds significantly. However, it hampers
Expand All @@ -270,7 +273,7 @@ increasing rebuild times. Tests have shown that it only speeds up the build
considerably for Clang, but not for GCC.

```
cmake --preset=default-clang-mamba -DENABLE_PCH=1 ..
cmake --preset=default-clang-conda -DENABLE_PCH=1 ..
```

If you enable PCH and also use ccache, you need to set the `CCACHE_SLOPPINESS`
Expand Down Expand Up @@ -347,7 +350,7 @@ pointers. This has minimal impact on performance. Use the following preset to
enable this setting:

```
cmake --preset=perf-gcc-mamba
cmake --preset=perf-gcc-conda
```

Prepend the perf command to your arts call to record callgraph information:
Expand Down
4 changes: 1 addition & 3 deletions environment-dev-linux.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
name: pyarts-dev
dependencies:
- python=3.10
- binutils
- build
- ccache
Expand All @@ -25,7 +23,7 @@ dependencies:
- pkg-config
- pytest
- scipy
- sphinx>=6
- sphinx
- sphinx_rtd_theme
- xarray
- zlib
Expand Down
4 changes: 1 addition & 3 deletions environment-dev-mac.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
name: pyarts-dev
dependencies:
- python=3.10
- build
- ccache
- clang
Expand All @@ -21,7 +19,7 @@ dependencies:
- pkg-config
- pytest
- scipy
- sphinx>=6
- sphinx
- sphinx_rtd_theme
- xarray
- zlib
Expand Down

0 comments on commit 30c3d99

Please sign in to comment.