nixpkgs/pkgs/applications/science/logic/hol_light/start_hol.ml
Marco Maggesi df21c86e08 Improve hol_light:
*   Upgrade hol_light to the latest svn version on google code (r57).

  *   Improve and semplify the mechanism for the generation of checkpointed binaries.

  *   Make hol to work with camlp5 and thus with recent version of ocaml (>=3.10, <=3.11).

  *   Remove ocaml_with_sources which is not needed anymore.

svn path=/nixpkgs/trunk/; revision=23685
2010-09-08 13:07:45 +00:00

38 lines
1.7 KiB
OCaml

(* ========================================================================= *)
(* Create a standalone HOL image. Assumes that we are running under Linux *)
(* and have the program "dmtcp" available to create checkpoints. *)
(* *)
(* (c) Copyright, John Harrison 1998-2007 *)
(* (c) Copyright, Marco Maggesi 2010 *)
(* ========================================================================= *)
(* Use this instead of #use "make.ml";; for quick tests. *)
(*
let a = 1;
#load "unix.cma";;
let startup_banner = "Bogus banner\n";;
Format.print_string "Hello!"; Format.print_newline();;
*)
#use "make.ml";;
(* ------------------------------------------------------------------------- *)
(* Checkpoint using DMTCP. *)
(* dmtcp_selfdestruct is similar to dmtcp_checkpoint but terminates *)
(* HOL Light and shuts down the dmtcp coordinator. *)
(* ------------------------------------------------------------------------- *)
let dmtcp_checkpoint, dmtcp_selfdestruct =
let call_dmtcp opts bannerstring =
let longer_banner = startup_banner ^ " with DMTCP" in
let complete_banner =
if bannerstring = "" then longer_banner
else longer_banner^"\n "^bannerstring in
(Gc.compact(); Unix.sleep 4;
Format.print_string "Checkpointing..."; Format.print_newline();
try ignore(Unix.system ("dmtcp_command -bc " ^ opts)) with _ -> ();
Format.print_string complete_banner;
Format.print_newline(); Format.print_newline())
in
call_dmtcp "", call_dmtcp "-q";;