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.1 required=5.0 tests=AWL autolearn=disabled version=3.1.3 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 A4C02BBAF for ; Mon, 6 Jul 2009 11:27:06 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Am4CAMtfUUqGnQCBd2dsb2JhbACZGwEMCwoFGLFxhBIFgTo X-IronPort-AV: E=Sophos;i="4.42,355,1243807200"; d="scan'208";a="32539032" Received: from shiva.jussieu.fr ([134.157.0.129]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 06 Jul 2009 11:27:06 +0200 Received: from hydrogene.pps.jussieu.fr (hydrogene.pps.jussieu.fr [134.157.168.1]) by shiva.jussieu.fr (8.14.3/jtpda-5.4) with ESMTP id n669R51l096375 for ; Mon, 6 Jul 2009 11:27:05 +0200 (CEST) X-Ids:168 Received: from hydrogene.pps.jussieu.fr (localhost.localdomain [127.0.0.1]) by hydrogene.pps.jussieu.fr (8.13.4/jtpda-5.4) with ESMTP id n669R4C7021510 for ; Mon, 6 Jul 2009 11:27:04 +0200 Received: (from abate@localhost) by hydrogene.pps.jussieu.fr (8.13.4/8.13.2/Submit) id n669R4SQ021509 for caml-list@yquem.inria.fr; Mon, 6 Jul 2009 11:27:04 +0200 Date: Mon, 6 Jul 2009 11:27:04 +0200 From: Pietro Abate To: caml-list@yquem.inria.fr Subject: Circular dependencies Message-ID: <20090706092704.GA20957@uranium.pps.jussieu.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Operating-System: GNU/Linux User-Agent: Mutt/1.5.9i X-Virus-Scanned: ClamAV 0.94.2/9223/Fri Apr 10 16:54:59 2009 on shiva.jussieu.fr X-Virus-Status: Clean X-Miltered: at jchkmail.jussieu.fr with ID 4A51C369.007 by Joe's j-chkmail (http : // j-chkmail dot ensmp dot fr)! X-j-chkmail-Enveloppe: 4A51C369.007/134.157.168.1/hydrogene.pps.jussieu.fr/hydrogene.pps.jussieu.fr/ X-j-chkmail-Score: MSGID : 4A51C369.007 on shiva.jussieu.fr : j-chkmail score : . : R=. U=. O=. B=0.015 -> S=0.015 X-j-chkmail-Status: Ham X-Spam: no; 0.00; dependencies:01 compilation:01 cmx:01 usr:01 ocamldep:01 usr:01 ocamldep:01 ocamlc:01 cmo:01 ocamlc:01 cmo:01 -pack:01 dependencies:01 cmxa:01 ocamlopt:01 Hi all, I've this small compilation problem with ocamlbuild. Basically private.ml contains the common part of pub1.ml and pub2.ml and out.ml contains the output type. Here I'm trying to hide private.ml and to provide a module algo with only the public interface. If there is a better way of doing this, I'll be happy to learn. I don't quite get the circular dependency problem ... thanks for your help ! Briefly: #ls _tags algo.mlpack out.ml private.ml pub1.ml pub2.ml #cat _tags <{pub1,pub2,out}.cmx>: for-pack(Algo) #cat algo.mlpack Pub1 Pub2 Out #cat out.ml let b = () #cat pub1.ml let b = Private.a #cat pub2.ml let b = Private.a #cat private.ml let a = Out.b ;; Then when I try to compile my library I get : #ocamlbuild -classic-display algo.cma /usr/bin/ocamldep -modules pub1.ml > pub1.ml.depends /usr/bin/ocamldep -modules private.ml > private.ml.depends /usr/bin/ocamldep -modules out.ml > out.ml.depends /usr/bin/ocamlc -c -o out.cmo out.ml /usr/bin/ocamlc -c -o private.cmo private.ml /usr/bin/ocamldep -modules pub2.ml > pub2.ml.depends /usr/bin/ocamlc -c -o pub1.cmo pub1.ml /usr/bin/ocamlc -c -o pub2.cmo pub2.ml /usr/bin/ocamlc -pack out.cmo pub1.cmo pub2.cmo -o algo.cmo Circular dependencies: "algo.cmo" already seen in [ "private.cmo"; "algo.cmo" ] as native library : #ocamlbuild -classic-display algo.cmxa /usr/bin/ocamlopt -c -for-pack Algo -o out.cmx out.ml /usr/bin/ocamlopt -c -o private.cmx private.ml /usr/bin/ocamlopt -c -for-pack Algo -o pub1.cmx pub1.ml /usr/bin/ocamlopt -c -for-pack Algo -o pub2.cmx pub2.ml touch algo.mli ; if /usr/bin/ocamlopt -pack out.cmx pub1.cmx pub2.cmx -o algo.cmx ; then rm -f algo.mli ; else rm -f algo.mli ; exit 1; fi Circular dependencies: "algo.cmx" already seen in [ "private.cmx"; "algo.cmx" ] -- ---- http://en.wikipedia.org/wiki/Posting_style