Skip to content

Commit 401c11d

Browse files
committed
Address further remarks, fix syntax
Signed-off-by: Michał Górny <mgorny@quansight.com>
1 parent 1e986a5 commit 401c11d

File tree

1 file changed

+58
-18
lines changed

1 file changed

+58
-18
lines changed

docs/maintainer/infrastructure.md

Lines changed: 58 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,16 @@ cxx_compiler_version:
560560
- 21
561561
```
562562

563+
Alternatively, the specific compiler name can be used as an argument to
564+
the `{{ compiler(...) }}` macro, e.g.:
565+
566+
```yaml
567+
requirements:
568+
build:
569+
- {{ compiler('clang') }}
570+
- {{ stdlib('c') }}
571+
```
572+
563573
### Installing standard compilers manually
564574

565575
While the primary use case for conda-forge compiler packages is to provide build tools
@@ -570,17 +580,37 @@ convenience packages to install the respective compilers. For example, [compiler
570580
C, C++ and Fortran compilers as normally used in build environments, along with their
571581
activation scripts.
572582

573-
For example, to install a C++ compiler, one could invoke:
583+
For example, to install these three compilers, one could invoke:
584+
585+
```bash
586+
conda install compilers
587+
```
588+
589+
Alternatively, specific compilers can be requested:
574590

575591
```bash
576-
conda install cxx-compiler
592+
conda install cxx-compiler fortran-compiler
577593
```
578594

579-
Please note that these packages must not be used in feedstock; instead the macros
580-
listed in `Using compilers in feedstocks`\_ must be used.
595+
Other available convenience packages are listed in the [platform-default
596+
compilers](#platform-default-compilers) list.
597+
598+
Please note that these packages must not be used in a feedstock; instead the macros
599+
listed in [Using compilers in feedstocks](#using-compilers-in-feedstocks) must be used.
600+
601+
### MSVC compiler on Windows
602+
603+
Conda-forge is not allowed to redistribute the MSVC compiler used on Windows,
604+
and therefore only provides the activation scripts for an externally installed
605+
compiler. Users who wish to compile code using MSVC, both for local use
606+
and feedstock builds, have to install Microsoft Visual Studio manually.
607+
For more information, see [Notes on native code](/docs/maintainer/knowledge_base/#notes-on-native-code)
608+
in Knowledge Base.
581609

582610
### Compilers supplied by conda-forge
583611

612+
#### Platform-default compilers
613+
584614
Currently conda-forge providers compilers for the following languages, that
585615
can be specified as arguments to the `{{ compiler(...) }}` macro:
586616

@@ -592,20 +622,6 @@ can be specified as arguments to the `{{ compiler(...) }}` macro:
592622
- `rust`; see [Rust packages](/docs/maintainer/example_recipes/rust/)
593623
- `go-cgo` and `go-nocgo`; see [Go packages](/docs/maintainer/example_recipes/go/)
594624

595-
There exists an alternative, MinGW-based, compiler stack on Windows:
596-
597-
- `m2w64_c` for the C compiler
598-
- `m2w64_cxx` for the C++ compiler
599-
- `m2w64_fortran` for the Fortran compiler
600-
601-
Along with these compilers, `stdlib('m2w64_c')` needs to be used. However, this stack is falling out
602-
of use now that most projects will natively support compilation also with MSVC, in addition
603-
to several complications arising from mixing compiler stacks.
604-
605-
Furthermore, compiler names can also be passed explicitly to the `compiler()` macro,
606-
for example `compiler('clang')` or `compiler('gcc')`, in which case they override
607-
the platform defaults.
608-
609625
The authoritative source of the current compilers and versions for various languages
610626
and platforms is the [conda_build_config.yaml](https://github.com/conda-forge/conda-forge-pinning-feedstock/blob/master/recipe/conda_build_config.yaml) file
611627
in the [conda-forge/conda-forge-pinning-feedstock](https://github.com/conda-forge/conda-forge-pinning-feedstock) repository
@@ -619,6 +635,30 @@ and Flang on Windows.
619635
Note that when used in conjunction with CUDA, the GCC version is restricted by the
620636
maximum version supported by nvcc (which is also reflected in the global pinning).
621637

638+
#### clang vs. clang-cl on Windows
639+
640+
The `clang` compiler package installs two frontends, and conda-forge
641+
provides separate activation scripts for Windows, for each of them. Therefore,
642+
the following arguments can be used in `recipe/conda_build_config.yaml`
643+
or passed to the `{{ compiler(...) }}` macro:
644+
645+
- `clang` to use the `clang` frontend using GCC argument syntax
646+
- `clang-cl` to use the `clang-cl` frontend with MSVC argument syntax
647+
648+
#### MinGW-based compiler stack for Windows
649+
650+
There exists an alternative, MinGW-based, compiler stack on Windows:
651+
652+
- `m2w64_c` for the C compiler
653+
- `m2w64_cxx` for the C++ compiler
654+
- `m2w64_fortran` for the Fortran compiler
655+
656+
Along with these compilers, `stdlib('m2w64_c')` needs to be used.
657+
658+
However, this stack is falling out of use now that most projects will natively
659+
support compilation also with MSVC, in addition to several complications
660+
arising from mixing compiler stacks.
661+
622662
### Compiler ABI stability policy
623663

624664
Compilers generally strive to maintain ABI-compatibility across versions, meaning that

0 commit comments

Comments
 (0)