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=1.1 required=5.0 tests=AWL,SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 7496FBC6B for ; Wed, 27 Jun 2007 16:48:50 +0200 (CEST) Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.180]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l5REmmQG014644 for ; Wed, 27 Jun 2007 16:48:49 +0200 Received: by wa-out-1112.google.com with SMTP id j37so256627waf for ; Wed, 27 Jun 2007 07:48:47 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=PwPFJwVIFvmt0+DHpnBV9iG9rX5Nv/BqiMP5zSU3niXxx4VnmxquZIejfSjEgFyJ92As4UN2yMmNSnG5xa3onLDAW5MbwAG6Yza0vrh2bW3Jqs1Cp3VPTXxbTSEBrmNHXKe+Po94MBp2JPAZgNidOf77UCsKbWfyL52ZQmKZ9O8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=tRLkZ46ACbRB4kPVVONwf9VzlulHA/nglO9b1YNmPHaktkrMko8S+DYZDfBC4TlXhQ/8TYEMKzRuhnjtlyMCZKK2zlDd21RTLCeeScWT9qGC24abHj8P1MlJmatSHwmnStKF1oFHqj/t7jVovo63DY96EedTYMCrwZQPZ2VviVU= Received: by 10.114.149.2 with SMTP id w2mr592419wad.1182955727530; Wed, 27 Jun 2007 07:48:47 -0700 (PDT) Received: by 10.114.181.8 with HTTP; Wed, 27 Jun 2007 07:48:47 -0700 (PDT) Message-ID: Date: Wed, 27 Jun 2007 16:48:47 +0200 From: "Nicolas Pouillard" To: "Andrew Warshaver" Subject: Re: [Caml-list] compiling a clib from further away Cc: caml-list@yquem.inria.fr In-Reply-To: <46826F6F.6060009@janestcapital.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <46826CA4.4010308@janestcapital.com> <46826F6F.6060009@janestcapital.com> X-j-chkmail-Score: MSGID : 468278D0.000 on discorde : j-chkmail score : X : 0/20 1 0.000 -> 1 X-Miltered: at discorde with ID 468278D0.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ocaml:01 lib:01 lib:01 stubs:01 sexp:01 stubs:01 usr:01 ocamlmklib:01 bug:01 bug:01 pathname:01 libs:01 libname:01 libname:01 wrote:01 On 6/27/07, Andrew Warshaver wrote: > > > Andrew Warshaver wrote: > > I am trying to compile a clib (with the eventual hope of it making its > > way into a compiled ocaml lib). It is working fine if I am in the > > specific directory; but if I move too far out it fails. My directories > > are like /../janebase/lib/cephes/ The c files live in cephes. > > > > $ cat lib/cephes/libjane_stubs.clib > > bdtr.o > > btdtr.o > > chbevl.o > > ... > > $ cat _tags > > or : include > > > > $ cat myocamlbuild.ml > > open Ocamlbuild_plugin > > open Command > > > > let headers = ["lib/cephes/mconf.h"; "lib/cephes/protos.h"];; > > > > dispatch begin function > > | After_rules -> > > dep ["compile"; "c"] headers; > > | _ -> () > > end > > > > $ ocamlbuild lib/cephes/libjane_stubs.a > > + /usr/local/home/godi310/godi/bin/ocamlmklib -o /cephes/libjane_stubs > > by the way, obviously the culprit is in this -o, it should have lib/, is > this a ocamlbuild bug? > Indeed, it seems to be a bug. In order to give the library name without the "lib" prefix, ocamlbuild cuts the given pathname on the substring "lib". The bad news is that it's not dummy programming bug, it's more abou the expressiveness of ocamlbuild rules. Indeed there are roughly two rules for libs. ... ~prods:["lib%(libname).a"; "dll%(libname).so"] ... ... ~prods:["%(path)/lib%(libname).a"; "%(path)/dll%(libname).so"] ... And for now I can specify more precise rules. So with your lib/ directory you fall in the first one. An safe workaround is to rename your lib/ dir. -- Nicolas Pouillard