From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 9AAE7BC6C for ; Thu, 31 Jan 2008 12:53:59 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAGxFoUfAXQInh2dsb2JhbACQKwEBAQgKKZpw X-IronPort-AV: E=Sophos;i="4.25,285,1199660400"; d="scan'208";a="22012647" Received: from concorde.inria.fr ([192.93.2.39]) by mail4-smtp-sop.national.inria.fr with ESMTP; 31 Jan 2008 12:53:58 +0100 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id m0VBrwMX010096 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Thu, 31 Jan 2008 12:53:58 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAACZGoUeBrw8Eh2dsb2JhbACQKwEBAQgKKZpv X-IronPort-AV: E=Sophos;i="4.25,285,1199660400"; d="scan'208";a="7467747" Received: from ext.lri.fr ([129.175.15.4]) by mail1-smtp-roc.national.inria.fr with ESMTP; 31 Jan 2008 12:53:58 +0100 Received: from localhost (localhost [127.0.0.1]) by ext.lri.fr (Postfix) with ESMTP id 5376DA48AA for ; Thu, 31 Jan 2008 12:53:58 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at lri.fr Received: from ext.lri.fr ([127.0.0.1]) by localhost (ext.lri.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Qg9qxhr1KPwi for ; Thu, 31 Jan 2008 12:53:58 +0100 (CET) Received: from smtp.lri.fr (vhost3-23 [129.175.3.23]) by ext.lri.fr (Postfix) with ESMTP id 357C5A488D for ; Thu, 31 Jan 2008 12:53:58 +0100 (CET) Received: from [129.175.4.128] (lri4-128 [129.175.4.128]) by smtp.lri.fr (Postfix) with ESMTP id 12250E052B for ; Thu, 31 Jan 2008 12:53:58 +0100 (CET) Message-ID: <47A1B728.1070200@lri.fr> Date: Thu, 31 Jan 2008 12:55:20 +0100 From: Romain Bardou User-Agent: Thunderbird 2.0.0.6 (X11/20071022) MIME-Version: 1.0 To: caml-list@inria.fr Subject: ocamlbuild and packs Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 47A1B6D6.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; lri:01 summarized:01 -pack:01 makefile:01 makefile:01 byte:01 byte:01 cmo:01 cmo:01 solver:01 solver:01 wiki:01 unbound:01 compile:01 compile:01 Hello, I have this big project I work on, which could be summarized like this: module A module bla/A module bla/B module Main The module B in the bla directory depends on the module A of the bla directory. The module Main depends on both modules A and on module B. For some reasons I cannot rename either of the modules. So what I do is pack A and B in a Bla module, so I can write Bla.A and Bla.B, using the -pack command line option. It works with my Makefile. Now I try to use ocamlbuild, because I really like its approach (I come from the Pascal world where no makefile is needed). So I made this file bla.mlpack containing the lines: A B Now if I compile using: ocamlbuild Main.byte I get the following error: Unbound module Bla.A I can't compile using: ocamlbuild -I bla Main.byte Because now the module A is defined twice. So I tried to compile using two steps: first, compile bla.cmo, and then, compile Main.byte, but ocamlbuild doesn't seem to be good at that (and actually that's not a bad thing imo). Indeed, if I do: ocamlbuild bla.cmo I get the following error: Solver failed: Ocamlbuild cannot find or build bla.ml. (but the file bla.mlpack does exist). Actually at first I did that from a parent directory, so the command I used looked more like: ocamlbuild -I dir dir/bla.cmo And the error was different: Solver failed: Ocamlbuild knows of no rules that apply to a target named dir/bla.mly. There is no such file as dir/bla.mly anywhere on my drive, although the project does contain some other mly files. Now for the questions: 1) What is the best way to compile my project? By "best" I mean: with no plugin if possible, with a small _tags file, and as few command line options as possible, while still keeping the spirit of ocamlbuild (for instance, compiling everything in one single call to ocamlbuild if possible). 2) Why doesn't ocamlbuild compile my file bla.mlpack into bla.cmo? In the manual I can read that "%.mlpack" has target "%.cmo". 3) If ocamlbuild actually did compile bla.cmo, could it use it to compile main.byte or must I build a library bla.cma first? Thanks. I would be glad to contribute to the wiki, but I have to understand ocamlbuild first ;) -- Romain Bardou