caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: David Allsopp <dra-news@metastack.com>
To: caml users <caml-list@inria.fr>
Subject: RE: [Caml-list] Recursive dependency issues
Date: Wed, 19 Nov 2014 17:00:59 +0000	[thread overview]
Message-ID: <E51C5B015DBD1348A1D85763337FB6D9E96E6795@Remus.metastack.local> (raw)
In-Reply-To: <CAK7rcp8OjeCFoofj6_9fogXgX_zz-yf+r17Q+Cmg+8iWgV8chA@mail.gmail.com>

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

  reply	other threads:[~2014-11-19 17:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-19 16:50 Kenneth Adam Miller
2014-11-19 17:00 ` David Allsopp [this message]
2014-11-19 17:15   ` Kenneth Adam Miller
2014-11-19 21:08     ` John Whitington
2014-11-19 21:20       ` Kenneth Adam Miller
2014-12-02 21:02         ` Gerd Stolpmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E51C5B015DBD1348A1D85763337FB6D9E96E6795@Remus.metastack.local \
    --to=dra-news@metastack.com \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).