-
Notifications
You must be signed in to change notification settings - Fork 414
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[coq] Add support for native-mode compilation.
We add a `(mode ...)` field to the `(coq.theory ...)` stanza that when set to `native` will have the Coq compiler to generate and install "native" objects, that is to say, `.cmxs` libraries containing an ML-level version of the corresponding Coq module. As of today, Coq itself does call the `ocamlfind ocaml` to compile the object files, this restriction may be lifted in the future however it is not easy as tactics do have access to "Just-In-Time" native compilation too. The patch itself is straightforward, except for a hack to handle native compilation targets. By default, `coqc -native-compute on` will generate the OCaml-level objects files under `.coq-native/`, and the regular `.vo` object in the build dir. This scheme doesn't work well with the restriction than a rule can only produce targets in the same directory. We workaround that by passing a special flag to Coq so `.coq-native` is dropped from the output path; at install time we do set the rules up so indeed the objects will be installed under `.coq-native` for compatibility. TODO: - update doc - disable on dev profile Signed-off-by: Emilio Jesus Gallego Arias <[email protected]>
- Loading branch information
Showing
10 changed files
with
116 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
(* This file is licensed under The MIT License *) | ||
(* (c) MINES ParisTech 2018-2019 *) | ||
(* (c) INRIA 2020 *) | ||
(* Written by: Emilio Jesús Gallego Arias *) | ||
|
||
type t = | ||
| VoOnly | ||
| Native | ||
|
||
let decode = Dune_lang.Decoder.(enum [ ("vo", VoOnly); ("native", Native) ]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
(* This file is licensed under The MIT License *) | ||
(* (c) MINES ParisTech 2018-2019 *) | ||
(* (c) INRIA 2020 *) | ||
(* Written by: Emilio Jesús Gallego Arias *) | ||
|
||
type t = | ||
| VoOnly | ||
| Native | ||
|
||
val decode : t Dune_lang.Decoder.t | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters