-
Notifications
You must be signed in to change notification settings - Fork 2
/
myocamlbuild.ml
38 lines (31 loc) · 1.46 KB
/
myocamlbuild.ml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
open Ocamlbuild_plugin
let parmap = ref false;;
let () = dispatch (function
| Before_options ->
Options.use_ocamlfind := true;
Options.make_links := false;
| After_options ->
(try
ignore (Findlib.query "parmap");
Printf.printf "Parmap parallelization enabled.\n";
tag_any ["package(parmap)"];
parmap := true
with Findlib.Findlib_error _ ->
Printf.printf "Parallelization unavailable (Parmap is not installed on your system).\n")
| After_rules ->
rule "genetipe: ArrayIter implementation selection"
~deps:["core/ArrayIter_parmap.ml";"core/ArrayIter_vanilla.ml"]
~prod:"core/ArrayIter.ml"
( fun _ _ ->
let file = if !parmap then "core/ArrayIter_parmap.ml" else "core/ArrayIter_vanilla.ml" in
cp file "core/ArrayIter.ml"
);
pflag ["ocaml";"ocamldep"] "searchdir" (function path -> S [A "-I"; P path]);
pflag ["ocaml";"doc"] "searchdir" (function path -> S [A "-I"; P path]);
pflag ["ocaml";"compile"] "searchdir" (function path -> S [A "-I"; P path]);
ocaml_lib ~dir:"core" ~tag_name:"use_genetipe" "core/GeneTipe";
ocaml_lib ~dir:"lib" ~tag_name:"use_randutil" "lib/RandUtil";
ocaml_lib ~dir:"lib/regexp" ~tag_name:"use_regexp" "lib/regexp/Regexp";
ocaml_lib ~dir:"lib/math" ~tag_name:"use_mathutil" "lib/math/MathUtil";
| _ -> ()
);;