From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 9E7DFBBAF for ; Sat, 13 Nov 2010 23:10:46 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Au4BAEqb3kxKfVK0k2dsb2JhbACUKyuNeAgVAQEBAQkJCgkRAx+kCIt4hBsjiGQBAQMFhUUEhFqFfYUQhBo X-IronPort-AV: E=Sophos;i="4.59,192,1288566000"; d="scan'208";a="86941977" Received: from mail-wy0-f180.google.com ([74.125.82.180]) by mail1-smtp-roc.national.inria.fr with ESMTP; 13 Nov 2010 23:10:46 +0100 Received: by wya21 with SMTP id 21so247227wya.39 for ; Sat, 13 Nov 2010 14:10:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=8tTrIm3K4UYuoUYOV3/lgbZ3qmdzJm7LmL4JBJxfj+Q=; b=tbvhAv82QFplltb3MrY9QLHw3GY98djLOofZj6pxeb4cNDKNdRF9nmC0qxFBk57RsK SZ27EkW3E9ouomtQ2bsImr6zxxcEr4N9iwLihX16XW4FdMtwcmpwq4xrx+8h/t45fcZw Udg9/VCUXm54rz8k9ZOZ/6OlIEXOS/Gtte9O0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; b=CWIozQEBaW+TyMTjsugPSKMfVmgUfOEl3oMB/UVIFgyDQ7mCzFj8Zsgw9H1P9JWqtm vXQ8p7LL9NUWt7U1VZ15uTwkWPRuv3SlRSqY8zqU4V2cQupfZhxUwjTGVUiGqVHNQDgR 57AfJgKozG4qbXek/7X7bBqYaG96IaCoCrxTU= MIME-Version: 1.0 Received: by 10.216.188.71 with SMTP id z49mr3411668wem.82.1289686245273; Sat, 13 Nov 2010 14:10:45 -0800 (PST) Sender: jianzhou.zh@gmail.com Received: by 10.216.239.132 with HTTP; Sat, 13 Nov 2010 14:10:45 -0800 (PST) Date: Sat, 13 Nov 2010 17:10:45 -0500 X-Google-Sender-Auth: n6RRCZK9qzRsOcySgIJQjhRB4hg Message-ID: Subject: magic_numbers in config.ml From: Jianzhou Zhao To: caml-list@yquem.inria.fr Content-Type: text/plain; charset=ISO-8859-1 X-Spam: no; 0.00; mli:01 mlp:01 utils:01 cmi:01 cmo:01 cmx:01 cmxa:01 impl:01 intf:01 runtime:01 ocaml:01 usr:01 lib:01 ocaml:01 pervasives:01 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