caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* magic_numbers in config.ml
@ 2010-11-13 22:10 Jianzhou Zhao
  0 siblings, 0 replies; only message in thread
From: Jianzhou Zhao @ 2010-11-13 22:10 UTC (permalink / raw)
  To: caml-list

Hello,

I got an open source code (http://pho.ucsd.edu/liquid/dsolve.tar.gz),
which contains three files, config.mli. config.mlp and config.mlbuild.
After configuration, they generated a config.ml, something like

http://docs.camlcity.org/docs/godisrc/frama-c-Helium-20080701.tar.gz/frama-c-Helium-20080701/why/why-2.13/ml/utils/config.ml

with magic_numbers

let exec_magic_number = "Caml1999X008"
and cmi_magic_number = "Caml1999I010"
and cmo_magic_number = "Caml1999O006"
and cma_magic_number = "Caml1999A007"
and cmx_magic_number = "Caml1999Y011"
and cmxa_magic_number = "Caml1999Z010"
and ast_impl_magic_number = "Caml1999M011"
and ast_intf_magic_number = "Caml1999N010"

At runtime, the code checks if the magic_number matches my local
OCaml. The check fails and returns
   '/usr/lib/ocaml/pervasives.cmi is not a compiled interface'
at runtime.

I usually got this "...cmi is not a compiled interface'" while
compilation if some OCaml objects are compiled by old versions. and
'make clean; recompile' can always solve the problem. But I have no
idea how the number is used and checked at runtime. How can I know
which OCaml to use from these numbers?

-- 
Jianzhou


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-11-13 22:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-13 22:10 magic_numbers in config.ml Jianzhou Zhao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).