From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 8A5CE7FADE for ; Wed, 19 Nov 2014 18:15:17 +0100 (CET) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of kennethadammiller@gmail.com) identity=pra; client-ip=209.85.214.178; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="kennethadammiller@gmail.com"; x-sender="kennethadammiller@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of kennethadammiller@gmail.com designates 209.85.214.178 as permitted sender) identity=mailfrom; client-ip=209.85.214.178; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="kennethadammiller@gmail.com"; x-sender="kennethadammiller@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-ob0-f178.google.com) identity=helo; client-ip=209.85.214.178; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="kennethadammiller@gmail.com"; x-sender="postmaster@mail-ob0-f178.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqMBAPTObFTRVdaym2dsb2JhbABag2NZBIMCt3yPK4FeAQmHSQKBAQcWAQEBAQERAQEBAQEGCwsJFC6EAgEBAQMBEhEdARsSDAMBCwYFBAcNDR0CAiIBEQEFAQoSBhMSCAEHiAkBAwkJDbEZPTGLO4FygxGKRwoZJwMKaIVpAQEBBwEBAQEBFwEFDpB2C4I2QRKBQgWFKQWGbYsahyyBcJMQGCmFUx8wgksBAQE X-IPAS-Result: AqMBAPTObFTRVdaym2dsb2JhbABag2NZBIMCt3yPK4FeAQmHSQKBAQcWAQEBAQERAQEBAQEGCwsJFC6EAgEBAQMBEhEdARsSDAMBCwYFBAcNDR0CAiIBEQEFAQoSBhMSCAEHiAkBAwkJDbEZPTGLO4FygxGKRwoZJwMKaIVpAQEBBwEBAQEBFwEFDpB2C4I2QRKBQgWFKQWGbYsahyyBcJMQGCmFUx8wgksBAQE X-IronPort-AV: E=Sophos;i="5.07,418,1413237600"; d="scan'208";a="89358721" Received: from mail-ob0-f178.google.com ([209.85.214.178]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 19 Nov 2014 18:15:10 +0100 Received: by mail-ob0-f178.google.com with SMTP id gq1so783122obb.23 for ; Wed, 19 Nov 2014 09:15:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=/XbYw2SirBmLn/U8pcYYfaJQwf2VIf15Jan03+7lbJE=; b=EwK2la1NUksEkESxsaggaou1A7zhzR2U9cdFrtntKbk6bgEEmj2jGpJKwmot2/YNfN 50ZehlZyXALCgHIX4zXveydhedvLxTqcUDIL5hjqT9y2sLVXte9HoIBPt1fsBUj5ZVCb IJ+bisXm+2JQ9caWiGi2EcFz2PFQX3pyUVbUT4BuRqy392Pq59qmO6DuySeAroSgBHDQ eV54xtq+eF6vrckaiL6OFMZSpQnkco7zHFMTkmaP4yIXVSxtQOE98/SusxvFvVLstUIA p995wtJGQXl9jWbMK4Ab7xZYRxhNoGiBQYuXsrFgEaZDfvl/X8LHkdyO9hHTVyIgL3jb r5ag== MIME-Version: 1.0 X-Received: by 10.60.35.193 with SMTP id k1mr19996357oej.40.1416417315362; Wed, 19 Nov 2014 09:15:15 -0800 (PST) Received: by 10.182.197.1 with HTTP; Wed, 19 Nov 2014 09:15:15 -0800 (PST) In-Reply-To: References: Date: Wed, 19 Nov 2014 12:15:15 -0500 Message-ID: From: Kenneth Adam Miller To: caml users Content-Type: multipart/alternative; boundary=089e011842a4ef9e3b0508395ac7 Subject: Re: [Caml-list] Recursive dependency issues --089e011842a4ef9e3b0508395ac7 Content-Type: text/plain; charset=UTF-8 Ok. Does anybody know how to use OCamlMakefile to have it do this? The commands already call ocamlfind before ocamlc; ocamlfind ocamlc ... is there before every compile command. Does ocamlfind only look in ~/.opam? All my dependencies are local... On Wed, Nov 19, 2014 at 12:00 PM, David Allsopp wrote: > Kenneth Adam Miller wrote: > > I have a library that I'm building against. > > An OCaml library, or a C library? (it's unclear from what you say later) > > > I only consume an interface from > > 2 specific directories; there are no other usages throughout my code. I > would > > like to be able to link against the library, and have the compiler admit > my > > code so long as it uses the interfaces of the other libraries correctly. > > Instead, I'm having to recursively specify all the dependencies of the > library > > I consume! > > > > I specify the location of my library with -ccopt -L location/to/it and > then > > -ccopt is used with C libraries - are you sure you're trying to do the > correct thing? > > > afterward, have the cma or the cmxa before I specify my source that is > being compiled. > > > > Should I statically link? What do I do to avoid the dependency hell? > > You are (probably) statically linking - it sounds like you're mixing > terminology. If you use an OCaml library foo.cmxa which depends on bar.cmxa > then you do have to specify bar.cmxa before linking foo.cmxa - that's not > dependency hell, it's just linking! There is a simple solution to this: > ocamlfind. It manages all of the linking instructions for you simply by > specifying the package that you need to be available. > > > David > > -- > Caml-list mailing list. Subscription management and archives: > https://sympa.inria.fr/sympa/arc/caml-list > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs --089e011842a4ef9e3b0508395ac7 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Ok. Does anybody know how to use OCamlMakefile to have it = do this? The commands already call ocamlfind before ocamlc;

<= div>ocamlfind ocamlc ...

is there before every com= pile command. Does ocamlfind only look in ~/.opam? All my dependencies are = local...

On Wed, Nov 19, 2014 at 12:00 PM, David Allsopp <dra-news@metastac= k.com> wrote:
Kenneth Adam Miller wrote:
> I have a library that I'm building against.

An OCaml library, or a C library? (it's unclear from what you sa= y later)

> I only consume an interface from
> 2 specific directories; there are no other usages throughout my code. = I would
> like to be able to link against the library, and have the compiler adm= it my
> code so long as it uses the interfaces of the other libraries correctl= y.
> Instead, I'm having to recursively specify all the dependencies of= the library
> I consume!=C2=A0
>
> I specify the location of my library with -ccopt -L location/to/it and= then

-ccopt is used with C libraries - are you sure you're trying to = do the correct thing?

> afterward, have the cma or the cmxa before I specify my source that is= being compiled.=C2=A0
>
> Should I statically link? What do I do to avoid the dependency hell?
You are (probably) statically linking - it sounds like you're mi= xing terminology. If you use an OCaml library foo.cmxa which depends on bar= .cmxa then you do have to specify bar.cmxa before linking foo.cmxa - that&#= 39;s not dependency hell, it's just linking! There is a simple solution= to this: ocamlfind. It manages all of the linking instructions for you sim= ply by specifying the package that you need to be available.


David

--
Caml-list mailing list.=C2=A0 Subscription management and archives:
https://sympa.inria.= fr/sympa/arc/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inr= ia.fr/bin/caml-bugs

--089e011842a4ef9e3b0508395ac7--