aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmilio Jesus Gallego Arias2018-10-04 11:50:11 +0200
committerEmilio Jesus Gallego Arias2018-10-09 22:18:57 +0200
commitb70c5fd9cc29f32c87d72a6da3f731be25c42d85 (patch)
tree5b8610aa38eee1eddffec112926ef8274de43a1a
parent59de2827b63b5bc475452bef385a2149a10a631c (diff)
[dune] Provide an optimized build profile with inlining reports.
This satisfies a wish by @ppedrot
-rw-r--r--Makefile.dune9
-rw-r--r--dev/doc/build-system.dune.md11
-rw-r--r--dev/dune-workspace.all4
-rw-r--r--dune7
4 files changed, 24 insertions, 7 deletions
diff --git a/Makefile.dune b/Makefile.dune
index 6733c485fa..d9c1452cae 100644
--- a/Makefile.dune
+++ b/Makefile.dune
@@ -1,7 +1,7 @@
# -*- mode: makefile -*-
# Dune Makefile for Coq
-.PHONY: voboot states world watch release apidoc ocheck clean help
+.PHONY: voboot states world watch release apidoc ocheck ireport clean help
# use DUNEOPT=--display=short for a more verbose build
# DUNEOPT=--display=short
@@ -16,6 +16,7 @@ help:
@echo " - release: build Coq in release mode"
@echo " - apidoc: build ML API documentation"
@echo " - ocheck: build for all supported OCaml versions [requires OPAM]"
+ @echo " - ireport: build with optimized flambda settings and emit an inline report"
@echo " - clean: remove build directory and autogenerated files"
@echo " - help: show this message"
@@ -41,6 +42,12 @@ apidoc: voboot
ocheck: voboot
dune build $(DUNEOPT) @install --workspace=dev/dune-workspace.all
+ireport:
+ dune clean
+ dune build $(DUNEOPT) @vodeps --profile=ireport
+ dune exec coq_dune $(BUILD_CONTEXT)/.vfiles.d --profile=ireport
+ dune build $(DUNEOPT) @install --profile=ireport
+
clean:
dune clean
diff --git a/dev/doc/build-system.dune.md b/dev/doc/build-system.dune.md
index 7349360be8..91ab57f1e9 100644
--- a/dev/doc/build-system.dune.md
+++ b/dev/doc/build-system.dune.md
@@ -107,6 +107,17 @@ global options --- such as flags --- on all packages, or build Coq
with different OPAM switches simultaneously [for example to test
compatibility]; for more information, please refer to the Dune manual.
+## Inlining reports
+
+The `ireport` profile will produce standard OCaml [inlining
+reports](https://caml.inria.fr/pub/docs/manual-ocaml/flambda.html#sec488). These
+are to be found under `_build/default/$lib/$lib.objs/$module.$round.inlining.org`
+and are in Emacs `org-mode` format.
+
+Note that due to https://github.com/ocaml/dune/issues/1401 , we must
+perform a full rebuild each time as otherwise Dune will remove the
+files. We hope to solve this in the future.
+
## Documentation and test targets
The documentation and test suite targets for Coq are still not
diff --git a/dev/dune-workspace.all b/dev/dune-workspace.all
index 1a8a816aaa..93b807d5e3 100644
--- a/dev/dune-workspace.all
+++ b/dev/dune-workspace.all
@@ -1,10 +1,6 @@
(lang dune 1.2)
; Add custom flags here. Default developer profile is `dev`
-(env
- (dev (flags :standard -rectypes -w -9-27-50+60))
- (release (flags :standard -rectypes)))
-
(context (opam (switch 4.05.0)))
(context (opam (switch 4.05.0+32bit)))
(context (opam (switch 4.07.0)))
diff --git a/dune b/dune
index b3073493ea..240550cf94 100644
--- a/dune
+++ b/dune
@@ -1,7 +1,10 @@
; Default flags for all Coq libraries.
(env
- (dev (flags :standard -rectypes -w -9-27-50+60))
- (release (flags :standard -rectypes)))
+ (dev (flags :standard -rectypes -w -9-27-50+40+60))
+ (release (flags :standard -rectypes))
+ (ireport
+ (flags :standard -rectypes -w -9-27-50+40+60)
+ (ocamlopt_flags :standard -O3 -unbox-closures -inlining-report)))
; Rules for coq_dune
(rule