Skip to content

Commit 1994b20

Browse files
committed
Actually rewrite some of the text to fit better
Signed-off-by: Michał Górny <mgorny@quansight.com>
1 parent 6d7a555 commit 1994b20

File tree

1 file changed

+102
-59
lines changed

1 file changed

+102
-59
lines changed

docs/maintainer/infrastructure.md

Lines changed: 102 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -524,12 +524,43 @@ requirements:
524524
- {{ stdlib('c') }}
525525
```
526526
527-
<!-- TODO: explain stdlib -->
528-
529527
The possible parameter values are listed in the [compilers supplied by conda-forge
530528
](#compilers-supplied-by-conda-forge) section.
531529
532-
### Installing compilers manually
530+
Almost always, in addition to a compiler of any programming language, you will
531+
also need to depend on the C standard library via the `stdlib('c')` macro.
532+
Note that currently this macro is only used to refer to the C standard library
533+
and in the vast majority of cases all programming languages use that library,
534+
therefore the macro is always used with the `'c'` parameter. For example,
535+
a regular Rust package would use:
536+
537+
```yaml
538+
requirements:
539+
build:
540+
- {{ compiler('rust') }}
541+
- {{ stdlib('c') }}
542+
```
543+
544+
### Using non-default compilers in feedstocks
545+
546+
Our default compiler stack is made up very differently on each platform; each platform
547+
has its own default compiler, with its own set of feedstocks that provide them.
548+
However, it is often possible to use a different compiler if necessary. For example,
549+
to use Clang 21 as the C and C++ compiler, one would additionally specify
550+
in `recipe/conda_build_config.yaml`:
551+
552+
```yaml
553+
c_compiler:
554+
- clang
555+
c_compiler_version:
556+
- 21
557+
cxx_compiler:
558+
- clangxx
559+
cxx_compiler_version:
560+
- 21
561+
```
562+
563+
### Installing standard compilers manually
533564

534565
While the primary use case for conda-forge compiler packages is to provide build tools
535566
for feedstocks, we try to keep the compilers in their various versions
@@ -544,7 +575,6 @@ For example, to install a C++ compiler, one could invoke:
544575
conda install cxx-compiler
545576
```
546577

547-
548578
### Compilers supplied by conda-forge
549579

550580
Currently conda-forge providers compilers for the following languages, that
@@ -554,60 +584,22 @@ can be specified as arguments to the `{{ compiler(...) }}` macro:
554584
- `cxx` (C++), also provided by `cxx-compiler`
555585
- `fortran`, also provided by `fortran-compiler`
556586
- `cuda`, also provided by `cuda-compiler`; see also [Guide for Maintainers of
557-
Recipes That Use CUDA](https://github.com/conda-forge/cuda-feedstock/blob/main/recipe/doc/recipe_guide.md)
587+
Recipes That Use CUDA](https://github.com/conda-forge/cuda-feedstock/blob/main/recipe/doc/recipe_guide.md)
558588
- `rust`; see [Rust packages](/docs/maintainer/example_recipes/rust/)
559589
- `go-cgo` and `go-nocgo`; see [Go packages](/docs/maintainer/example_recipes/go/)
560590

561-
Our default compiler stack is made up very differently on each platform; each platform
562-
has its own default compiler, with its own set of feedstocks that provide them. Due to historical
563-
reasons (the way compilers are integrated with their OS, and the amount of
564-
software written in them, etc.), the most impactful languages are C & C++ (though
565-
Fortran is considered part of the default, not least because GCC compiles all three).
566-
567-
Linux (GCC):
568-
569-
- [C, C++, Fortran] Activation: https://github.com/conda-forge/ctng-compiler-activation-feedstock/
570-
- [C, C++, Fortran] Implementation: https://github.com/conda-forge/ctng-compilers-feedstock
571-
- Note that when used in conjunction with CUDA, compiler versions are restricted by the
572-
maximum GCC version supported by nvcc (which is also reflected in the global pinning).
573-
574-
OSX (Clang):
575-
576-
- [C, C++] Activation: https://github.com/conda-forge/clang-compiler-activation-feedstock/
577-
- [C, C++] Required feedstocks:
578-
[llvmdev](https://github.com/conda-forge/llvmdev-feedstock),
579-
[clangdev](https://github.com/conda-forge/clangdev-feedstock),
580-
[compiler-rt](https://github.com/conda-forge/compiler-rt-feedstock),
581-
[libcxx](https://github.com/conda-forge/libcxx-feedstock),
582-
[openmp](https://github.com/conda-forge/openmp-feedstock),
583-
[lld](https://github.com/conda-forge/lld-feedstock),
584-
[cctools](https://github.com/conda-forge/cctools-and-ld64-feedstock)
585-
- [Fortran] Activation: https://github.com/conda-forge/gfortran_osx-64-feedstock/
586-
- [Fortran] Implementation: https://github.com/conda-forge/gfortran_impl_osx-64-feedstock/
587-
588-
Windows (MSVC):
589-
590-
- [C, C++] Activation: https://github.com/conda-forge/vc-feedstock
591-
(we cannot redistribute the actual MSVC compilers due to licensing constraints)
592-
- [Fortran] Activation & Implementation: https://github.com/conda-forge/flang-feedstock
593-
594-
There exists an alternative, MinGW-based, compiler stack on Windows, which is available
595-
with a `m2w64_` prefix (e.g. `{{ compiler('m2w64_c') }}`). However, it is falling out
596-
of use now that most projects will natively support compilation also with MSVC, in addition
597-
to several complications arising from mixing compiler stacks.
598-
599-
Additionally, there is a possibility to use `clang` as a compiler on Linux & Windows:
600-
601-
- Activation (Linux): https://github.com/conda-forge/ctng-compiler-activation-feedstock/
602-
- Activation (Windows): https://github.com/conda-forge/clang-win-activation-feedstock/
591+
The authoritative source of the current compilers and versions for various languages
592+
and platforms is the [conda_build_config.yaml](https://github.com/conda-forge/conda-forge-pinning-feedstock/blob/master/recipe/conda_build_config.yaml)
593+
in the [conda-forge/conda-forge-pinning-feedstock](https://github.com/conda-forge/conda-forge-pinning-feedstock)
594+
as described in [Globally pinned packages](pinning_deps.md#globally-pinned-packages).
603595

604-
Aside from the main C/C++/Fortran compilers, these are the feedstocks for the other compilers:
596+
The default C and C++ compilers are GCC on Linux, Clang on macOS and VS2022
597+
on Windows. Clang can also be used as the compiler on Linux and Windows.
598+
The default Fortran compiler is the GNU Fortran compiler on Linux and macOS,
599+
and Flang on Windows.
605600

606-
- [CUDA] [CUDA 12.0+](https://github.com/conda-forge/cuda-nvcc-feedstock) & [CUDA <12](https://github.com/conda-forge/nvcc-feedstock) (legacy)
607-
- [Rust] [Activation](https://github.com/conda-forge/rust-activation-feedstock)
608-
and [Implementation](https://github.com/conda-forge/rust-feedstock)
609-
- [Go] [Activation](https://github.com/conda-forge/go-activation-feedstock)
610-
and [Implementation](https://github.com/conda-forge/go-feedstock)
601+
Note that when used in conjunction with CUDA, the GCC version is restricted by the
602+
maximum version supported by nvcc (which is also reflected in the global pinning).
611603

612604
### Compiler ABI stability policy
613605

@@ -634,10 +626,6 @@ While we do not have any formal promises of support for a generation of ABI-comp
634626
compilers, we have historically maintained them according to the following (non-binding)
635627
principles.
636628

637-
- The authoritative source of the current compilers and versions for various languages
638-
and platforms is the [conda_build_config.yaml](https://github.com/conda-forge/conda-forge-pinning-feedstock/blob/master/recipe/conda_build_config.yaml)
639-
in the [conda-forge/conda-forge-pinning-feedstock](https://github.com/conda-forge/conda-forge-pinning-feedstock)
640-
as described in [Globally pinned packages](pinning_deps.md#globally-pinned-packages).
641629
- We provide no support of any kind in terms of the long-term stability/support of a given compiler generation.
642630
- We upgrade them in an ad-hoc manner on a periodic basis as we have the time and energy to do so.
643631
Note that because of the way we enforce runtime constraints, these compiler upgrades will not break
@@ -662,13 +650,68 @@ feedstocks get rerendered.
662650

663651
For such ABI-compatible upgrades, similar but looser principles apply:
664652

665-
- The pins are similarly defined in the global pinning, see [Globally Pinned Packages](pinning_deps.md#globally-pinned-packages).
666653
- We provide no support of any kind in terms of the long-term availability of a given compiler version.
667654
- We generally provide notice in the form of an announcement when a compiler is going to be upgraded.
668655
- Without promising any timelines, our compilers on Linux and OSX are normally
669656
very recent; on Windows, we generally use the last supported VS version.
670657

671-
### More on compiler activation feedstocks
658+
### More on compiler feedstocks
659+
660+
The compiler activation and implementation packages are built by two separate
661+
feedstocks, with a few exceptions. The activation packages install scripts
662+
into `/etc/conda/activate.d` and `/etc/conda/deactivate.d` directories. These
663+
scripts are then used by the build tool to respectively prepare for building
664+
with the given compiler, and clean up afterwards. The implementation packages
665+
install the compilers themselves. More details can be found in the [Anaconda compiler tools
666+
section of conda-build documentation](https://docs.conda.io/projects/conda-build/en/latest/resources/compiler-tools.html).
667+
668+
Due to historical
669+
reasons (the way compilers are integrated with their OS, and the amount of
670+
software written in them, etc.), the most impactful languages are C & C++ (though
671+
Fortran is considered part of the default, not least because GCC compiles all three).
672+
673+
Linux (GCC):
674+
675+
- [C, C++, Fortran] Activation: https://github.com/conda-forge/ctng-compiler-activation-feedstock/
676+
- [C, C++, Fortran] Implementation: https://github.com/conda-forge/ctng-compilers-feedstock
677+
678+
OSX (Clang + GNU Fortran):
679+
680+
- [C, C++] Activation: https://github.com/conda-forge/clang-compiler-activation-feedstock/
681+
- [C, C++] Required feedstocks:
682+
[llvmdev](https://github.com/conda-forge/llvmdev-feedstock),
683+
[clangdev](https://github.com/conda-forge/clangdev-feedstock),
684+
[compiler-rt](https://github.com/conda-forge/compiler-rt-feedstock),
685+
[libcxx](https://github.com/conda-forge/libcxx-feedstock),
686+
[openmp](https://github.com/conda-forge/openmp-feedstock),
687+
[lld](https://github.com/conda-forge/lld-feedstock),
688+
[cctools](https://github.com/conda-forge/cctools-and-ld64-feedstock)
689+
- [Fortran] Activation: https://github.com/conda-forge/gfortran_osx-64-feedstock/
690+
- [Fortran] Implementation: https://github.com/conda-forge/gfortran_impl_osx-64-feedstock/
691+
692+
Windows (MSVC + Flang):
693+
694+
- [C, C++] Activation: https://github.com/conda-forge/vc-feedstock
695+
(we cannot redistribute the actual MSVC compilers due to licensing constraints)
696+
- [Fortran] Activation & Implementation: https://github.com/conda-forge/flang-feedstock
697+
698+
There exists an alternative, MinGW-based, compiler stack on Windows, which is available
699+
with a `m2w64_` prefix (e.g. `{{ compiler('m2w64_c') }}`). However, it is falling out
700+
of use now that most projects will natively support compilation also with MSVC, in addition
701+
to several complications arising from mixing compiler stacks.
702+
703+
Additionally, there is a possibility to use `clang` as a compiler on Linux & Windows:
704+
705+
- Activation (Linux): https://github.com/conda-forge/ctng-compiler-activation-feedstock/
706+
- Activation (Windows): https://github.com/conda-forge/clang-win-activation-feedstock/
707+
708+
Aside from the main C/C++/Fortran compilers, these are the feedstocks for the other compilers:
709+
710+
- [CUDA] [CUDA 12.0+](https://github.com/conda-forge/cuda-nvcc-feedstock) & [CUDA <12](https://github.com/conda-forge/nvcc-feedstock) (legacy)
711+
- [Rust] [Activation](https://github.com/conda-forge/rust-activation-feedstock)
712+
and [Implementation](https://github.com/conda-forge/rust-feedstock)
713+
- [Go] [Activation](https://github.com/conda-forge/go-activation-feedstock)
714+
and [Implementation](https://github.com/conda-forge/go-feedstock)
672715

673716
### Conda-forge compiler maintenance
674717

0 commit comments

Comments
 (0)