From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 75887823D7 for ; Thu, 8 Mar 2018 17:01:44 +0100 (CET) Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=Jocelyn.SEROT@univ-bpclermont.fr; spf=None smtp.mailfrom=Jocelyn.SEROT@univ-bpclermont.fr; spf=None smtp.helo=postmaster@mta02.udamail.fr Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of Jocelyn.SEROT@univ-bpclermont.fr) identity=pra; client-ip=193.49.117.21; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="Jocelyn.SEROT@univ-bpclermont.fr"; x-sender="Jocelyn.SEROT@univ-bpclermont.fr"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of Jocelyn.SEROT@univ-bpclermont.fr) identity=mailfrom; client-ip=193.49.117.21; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="Jocelyn.SEROT@univ-bpclermont.fr"; x-sender="Jocelyn.SEROT@univ-bpclermont.fr"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mta02.udamail.fr) identity=helo; client-ip=193.49.117.21; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="Jocelyn.SEROT@univ-bpclermont.fr"; x-sender="postmaster@mta02.udamail.fr"; x-conformance=sidf_compatible IronPort-PHdr: =?us-ascii?q?9a23=3AfaZHcxVPV/Nizkn2TNSZAaQQ6DjV8LGtZVwlr6E/?= =?us-ascii?q?grcLSJyIuqrYbBaDt8tkgFKBZ4jH8fUM07OQ7/i7HzRYqb+681k6OKRWUBEEjc?= =?us-ascii?q?hE1ycBO+WiTXPBEfjxciYhF95DXlI2t1uyMExSBdqsLwaK+i764jEdAAjwOhRo?= =?us-ascii?q?LerpBIHSk9631+ev8JHPfglEnjWwba98IRmssQndqtQdjJd/JKo21hbHuGZDdf?= =?us-ascii?q?5MxWNvK1KTnhL86dm18ZV+7SleuO8v+tBZX6nicKs2UbJXDDI9M2Ao/8LrrgXM?= =?us-ascii?q?TRGO5nQHTGoblAdDDhXf4xH7WpfxtTb6tvZ41SKHM8D6Uaw4VDK/5KptVRTmij?= =?us-ascii?q?oINyQh/W7LhcN+kaJVrxCvqRJwwIDUbp+bOv1lc6PBZNMaQHZNXsZNWyBcBI63?= =?us-ascii?q?cosBD/AGPeZdt4Tzo1wOogegCgmoBOLvzCdHiGLs2q0g1OQhDRzN0QskEdIJrH?= =?us-ascii?q?vbstH1NacUUeyv0afGwinNYepI1zrm9YjIdBEhoe+VUb1racre1U0vGB3fjlWV?= =?us-ascii?q?rozlOS+V2v4Ds2iB9udtU/+khWAgqwF0uDevx8Esh5HViYIQy1DI7z52z5guJd?= =?us-ascii?q?2kTkNwfN2qEINIui2HM4Z7TNkuTm5stSog17EKpJy2cDIUxJg63xLSaP+Kf5KV?= =?us-ascii?q?7h/iW+udOzN1iGx/dL6hhxu+7U6twfDmWMauylZFtC9Fn8HMtn8T0xzT7dCKSv?= =?us-ascii?q?5h/ki7xTqDyRrf6vxZLk8ukKrUMZ8hwroqmpodq0TPBi72mEPog6+Kbkgo5+yl?= =?us-ascii?q?5ur9brjpopKQLZJ4hhz8P6g0hMCzHPw0Mg0UUGia/eS82qfj/Ur8QLhSivM2lb?= =?us-ascii?q?XWv47eJcUboK61GRJb3Ik/5RimETmry8kYnX8GLFJbYR6IlJDpNE3KIP/mF/e/?= =?us-ascii?q?hlOskDF3x/zcML3hGI3BLmLfn7f5YbZ990lcxRIvwt9F4pJUDqgNIPbyWk/qqN?= =?us-ascii?q?zVFQQ5Mgyxw+b/EtpxzIIeWWSVAq+YKqzeq1GI5vh8a9WLMYQcvTK1NuMo/eWm?= =?us-ascii?q?2XQwnFtYeaiywbMWbmq5F7JoORPKT2Drh4IjFmwHuhs4e9drklqeGWpxYH2/W7?= =?us-ascii?q?M6oAoWMqWaJZrFR57oiqSK2CqhG5pQeiZIEAbfQj/Ta4yYVqJUO2qpKch7n2lc?= =?us-ascii?q?DOnze8oazRir8TTC5f9iJ+vQ9DcfsMi7hsVz5vOWnwk58TFuCsObzyeDVTMsxz?= =?us-ascii?q?9ad3oNxKl65HdF5BKby6Ei265FE91NovlRWQM3L5vbyfA8BcqgAlucLOfMc06v?= =?us-ascii?q?R5CdOR90Tt81xIZeMUNhEo34yA3P1i+jArtTmabZXJE=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0DHqAD9XKFahxV1McFdHQEBBQELAYQmE?= =?us-ascii?q?ANsKI5hjQSBJjUngRaUPYIBChuFCgKDChkGBjQUAQIBAQEBAQEBAQESAQEBCgs?= =?us-ascii?q?JCCguQg4BgWcigkkBAQEDAX4LCxguHzgGE4URDAGtNoRxg3eCHYU1gi6DZQyCe?= =?us-ascii?q?IRpOIM5gjIEmk8JGWGFT5MphVeOXYJqgSoCNYFzdEsqAYIYCTWCA4IIdgGCHol?= =?us-ascii?q?HAQEB?= X-IPAS-Result: =?us-ascii?q?A0DHqAD9XKFahxV1McFdHQEBBQELAYQmEANsKI5hjQSBJjU?= =?us-ascii?q?ngRaUPYIBChuFCgKDChkGBjQUAQIBAQEBAQEBAQESAQEBCgsJCCguQg4BgWcig?= =?us-ascii?q?kkBAQEDAX4LCxguHzgGE4URDAGtNoRxg3eCHYU1gi6DZQyCeIRpOIM5gjIEmk8?= =?us-ascii?q?JGWGFT5MphVeOXYJqgSoCNYFzdEsqAYIYCTWCA4IIdgGCHolHAQEB?= X-Spam-Status: Yes X-IronPort-AV: E=Sophos;i="5.47,441,1515452400"; d="scan'208";a="317077509" Received: from mta02.udamail.fr ([193.49.117.21]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Mar 2018 17:01:43 +0100 Received: from mta02.udamail.fr (localhost.localdomain [127.0.0.1]) by mta02.udamail.fr (Postfix) with ESMTPS id 773751600B2 for ; Thu, 8 Mar 2018 17:01:43 +0100 (CET) Received: from localhost (localhost.localdomain [127.0.0.1]) by mta02.udamail.fr (Postfix) with ESMTP id 69176160074 for ; Thu, 8 Mar 2018 17:01:43 +0100 (CET) X-Virus-Scanned: amavisd-new at mta02.udamail.fr Received: from mta02.udamail.fr ([127.0.0.1]) by localhost (mta02.udamail.fr [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id Fjn_WSHEUaL2 for ; Thu, 8 Mar 2018 17:01:43 +0100 (CET) Received: from proxy01.udamail.fr (unknown [193.49.117.26]) by mta02.udamail.fr (Postfix) with ESMTPS id 4D117160072 for ; Thu, 8 Mar 2018 17:01:43 +0100 (CET) Received: from localhost (localhost.localdomain [127.0.0.1]) by proxy01.udamail.fr (Postfix) with ESMTP id 432E515E043 for ; Thu, 8 Mar 2018 17:01:43 +0100 (CET) Received: from proxy01.udamail.fr ([127.0.0.1]) by localhost (proxy01.udamail.fr [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id rAJrwYpfymv6 for ; Thu, 8 Mar 2018 17:01:39 +0100 (CET) Received: from localhost (localhost.localdomain [127.0.0.1]) by proxy01.udamail.fr (Postfix) with ESMTP id A100D15E047 for ; Thu, 8 Mar 2018 17:01:39 +0100 (CET) X-Virus-Scanned: amavisd-new at proxy01.udamail.fr Received: from proxy01.udamail.fr ([127.0.0.1]) by localhost (proxy01.udamail.fr [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id pc9sD1VUUD0r for ; Thu, 8 Mar 2018 17:01:39 +0100 (CET) Received: from [192.168.0.38] (lav63-2-88-164-92-250.fbx.proxad.net [88.164.92.250]) by proxy01.udamail.fr (Postfix) with ESMTPSA id 54DE715E043 for ; Thu, 8 Mar 2018 17:01:39 +0100 (CET) Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) From: =?iso-8859-1?Q?Jocelyn_S=E9rot?= In-Reply-To: Date: Thu, 8 Mar 2018 17:01:37 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <8ED11F3D-8709-4A15-A889-E507D59B2BAE@univ-bpclermont.fr> References: To: caml users X-Mailer: Apple Mail (2.1878.6) Subject: Re: [Caml-list] A question about custom toplevels Dear Nicol=E0s, Thank for your very clear answer.=20 I should have guessed this from the fact that the .cmi files were not avail= able indeed .. Best wishes Jocelyn Le 8 mars 2018 =E0 15:18, Nicol=E1s Ojeda B=E4r a =E9crit : > Dear Jocely, >=20 > I do not think this is currently possible. >=20 > When you enter a phrase into the toplevel (custom or otherwise), it is > compiled much the same way as if it had been written in a file and > passed to ocamlc. > To do so the compiler needs access to the signature information stored > in the .cmi files of all referenced modules. This is completely > independent of whether the code of those modules is linked into the > toplevel or loaded separately which is what ocamlmktop is about. >=20 > Note that it works the same way even for modules of the stdlib. The > reason "it just works" in that case is because a flag "-I " > is added implicitly. But if you pass the -nostdlib flag to the > toplevel, this implicit flag is not added, and the toplevel will not > be able to find the .cmi files of the stdlib in much the same way in > cannot find foo.cmi. >=20 > Best wishes, > Nicol=E1s >=20 > On Thu, Mar 8, 2018 at 9:19 AM, Jocelyn S=E9rot > wrote: >> Hello, >>=20 >> I recently stumbled on a problem and am wondering whether it comes from a >> misunderstanding or a bad usage. >>=20 >> When a custom toplevel is built using the [ocamlmktop] program, it seems >> that the modules which are =AB included =BB must be present in the path = when the >> so-built toplevel is executed afterwards. >>=20 >> For example, suppose that directory =AB bar =BB contains a file foo.ml,= with, >> let say the definition =AB let v=3D100 =BB. >> Then, making >>=20 >> ocamlfind ocamlc -c -o foo.cmo foo.ml >> ocamlfind ocamlc -a -o foo.cma foo.cmo >> ocamlfind ocamlmktop -o foo.top foo.cma >>=20 >> creates foo.top, which, when executed, behaves has expected. >>=20 >> $ ./foo.top >> OCaml version 4.06.0 >>=20 >> # Foo.v;; >> - : int =3D 100 >>=20 >> But, when trying to execute foo.top from another directory, for ex from >> ../bar, i get the following error : >>=20 >> $ ./bar/foo.top >> OCaml version 4.06.0 >>=20 >> # Foo.v;; >> Error: Unbound module Foo >>=20 >> The error disappears if i add option =AB -I ./bar =BB when lauching foo.= top (or, >> equivently execute the directive =AB #directory ./bar =BB). >>=20 >> Is there a way to build a =AB self-contained =BB custom toplevel which c= ould be >> executed without any explicit reference to the modules it included at >> creation ? >>=20 >> Jocelyn >>=20 >> ps : i tried the -custom option but, not surprisingly, it does not solve= the >> pb since it only refers to external C code.