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 concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 09672BB83 for ; Fri, 21 Jul 2006 14:39:08 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id k6LCd78n020103 for ; Fri, 21 Jul 2006 14:39:07 +0200 Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id OAA20069 for ; Fri, 21 Jul 2006 14:39:06 +0200 (MET DST) Received: from osiris.uid0.sk ([62.168.97.100]) by nez-perce.inria.fr (8.13.6/8.13.6) with ESMTP id k6LCd6Na027694 for ; Fri, 21 Jul 2006 14:39:06 +0200 Received: from osiris.uid0.sk (localhost [127.0.0.1]) by nod32.uid0.sk (Postfix) with ESMTP id 4FE5C87C40A; Fri, 21 Jul 2006 14:42:47 +0200 (CEST) Received: from osiris.uid0.sk (localhost [127.0.0.1]) by osiris (nod32smtp); Fri, 21 Jul 2006 14:42:47 +0200 X-Virus-Scanner: This message was checked by NOD32 Antivirus system for Linux/BSD Server. For more information on NOD32 Antivirus System, please, visit our website: http://www.eset.com/. Received: by osiris.uid0.sk (Postfix, from userid 1002) id 4A35C87C408; Fri, 21 Jul 2006 14:42:47 +0200 (CEST) Date: Fri, 21 Jul 2006 14:42:47 +0200 From: Jozef Kosoru To: Jean-Christophe Filliatre Cc: caml-list@inria.fr Subject: Re: [Caml-list] How to define submodules Message-ID: <20060721124247.GT3653@osiris.uid0.sk> References: <20060721115325.GS3653@osiris.uid0.sk> <17600.49686.673895.1832@pc9-152.lri.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <17600.49686.673895.1832@pc9-152.lri.fr> User-Agent: Mutt/1.4.2.1i X-NOD32Result: clean X-Miltered: at concorde with ID 44C0CAEB.002 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 44C0CAEA.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; submodules:01 filliatre:01 ocamlc:01 parser:01 ocamlc:01 parser:01 cmo:01 compiler:01 cmi:01 ocaml:01 -pack:01 -for-pack:01 compiler:01 submodules:01 -for-pack:01 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 On Fri, Jul 21, 2006 at 14:01:26 +0200, Jean-Christophe Filliatre wrote: > Jozef Kosoru writes: > > OK, and then I want to compile it (within a root directory): > > > > $ ocamlc -c Kernel/Parser/pdf.ml > > $ ocamlc -I . Kernel/Parser/pdf.cmo main.ml -o app > > > > File "main.ml", line 1, characters 0-22: > > Unbound value Kernel.Parser.Pdf.init > > > > Is this supposed to work somehow? > > No. > > First, to compile main.ml you need to pass "-I Kernel/Parser" to the > compiler, because it needs to find the file pdf.cmi. > > Second, in main.ml you have to write "Pdf.init" instead of > "Kernel.Parser.Pdf.init" because the directory structure is not turned > into a module structure in ocaml. Yes, that was my second example. That's not exactly what I want. > However, you can use the option -pack and -for-pack of the compiler to > pack several files as submodules of a new module; see the manual at > http://caml.inria.fr/pub/docs/manual-ocaml/manual025.html Thank you! For the above example it's: $ ocamlc -for-pack Kernel.Parser -c Kernel/Parser/pdf.ml $ ocamlc -pack -o Parser.cmo -for-pack Kernel Kernel/Parser/pdf.cmo $ ocamlc -pack -o Kernel.cmo Parser.cmo $ ocamlc Kernel.cmo main.ml -o ap Now the last thing is how to convince my OMakefile to do it automatically. Regards, Jozef -- jozef kosoru http://zyzstar.kosoru.com