Skip to content

Commit 20fd570

Browse files
Document how to create a switch with some OCaml compiler configure-time options
Co-authored-by: Florian Angeletti <[email protected]>
1 parent a26654f commit 20fd570

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

doc/pages/Usage.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,18 @@ or set of opam packages.
121121
Creating a new switch requires re-compiling OCaml, unless you use the
122122
`ocaml-system` package, that relies on the global OCaml installation.
123123

124+
When using the default [opam-repository](https://github.com/ocaml/opam-repository/),
125+
if you want to tweak the configuration of the compiler, you can switch to the option variant with:
126+
```
127+
opam switch create <name> ocaml-variants.<ocaml-version>+options <option_list>...
128+
```
129+
130+
where `<option_list>` is a space separated list of `ocaml-option-*` packages.
131+
For instance, to create a switch with OCaml 5.4.0 with both `flambda` and `no-flat-float-array` enabled:
132+
```
133+
opam switch create 5.4.0+flambda+nffa ocaml-variants.5.4.0+options ocaml-option-flambda ocaml-option-no-flat-float-array
134+
```
135+
124136
### opam pin
125137

126138
This command allows one to pin a package to a specific version, but has been

master_changes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ users)
114114
## Github Actions
115115

116116
## Doc
117+
* Document how to create a switch with some OCaml compiler configure-time options [#6776 @kit-ty-kate - fix #6645]
117118

118119
## Security fixes
119120

0 commit comments

Comments
 (0)