caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Compilation issue with interdependent libraries
@ 2012-12-18 23:21 Philippe Veber
  2012-12-18 23:52 ` [Caml-list] " Philippe Veber
  0 siblings, 1 reply; 2+ messages in thread
From: Philippe Veber @ 2012-12-18 23:21 UTC (permalink / raw)
  To: caml users

[-- Attachment #1: Type: text/plain, Size: 1160 bytes --]

Dear all,

I have 2 libraries, say A and B where B depends on A, and an executable C
which uses both A and B. Each of these components is a separate (oasis)
project. I have some test executables in B which work fine. However, when I
compile C, the compiler complains that it has no implementation for a
module defined in A and used in B. The compilation (linking) command of C
contains "-package" options for A and B, it is of the form:

ocamlfind ocamlopt ... -package B -package A ... C.cmo

If I permute the two package options, like in

ocamlfind ocamlopt ... -package A -package B ... C.cmo

the compilation works fine. It is not really clear to me, but I thought the
order of the -package options did not matter, because findlib would store
the dependencies between packages and produce a compilation command where
cma or cmxa are correctly sorted. Indeed, if I use the -verbose option, I
can see that cma are wrongly sorted in the former case, while they are fine
in the latter.

Admitedly my description is rather abstract, but does anyone see what could
I (or oasis) have forgotten, to tell ocamlfind that B.cma depends on A.cma?

Cheers,
  Philippe.

[-- Attachment #2: Type: text/html, Size: 1235 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Caml-list] Re: Compilation issue with interdependent libraries
  2012-12-18 23:21 [Caml-list] Compilation issue with interdependent libraries Philippe Veber
@ 2012-12-18 23:52 ` Philippe Veber
  0 siblings, 0 replies; 2+ messages in thread
From: Philippe Veber @ 2012-12-18 23:52 UTC (permalink / raw)
  To: caml users

[-- Attachment #1: Type: text/plain, Size: 1778 bytes --]

Answering to myself: the information needed by findlib to sort the cma
correctly is stored in the META file, using "require" directives. I

In fact I have a slightly more complicated structure:
- library A
- library B.B1 which depends on A
- library B.B2 which depends on B.B1 and A
- executable C which depends on all others

and I had forgotten the dependency between B.B1 and A. The error message
was mentionning B.B2 instead so I overlooked the real missing part. Sorry
for the noise!

Cheers,
  Philippe.

2012/12/19 Philippe Veber <philippe.veber@gmail.com>

> Dear all,
>
> I have 2 libraries, say A and B where B depends on A, and an executable C
> which uses both A and B. Each of these components is a separate (oasis)
> project. I have some test executables in B which work fine. However, when I
> compile C, the compiler complains that it has no implementation for a
> module defined in A and used in B. The compilation (linking) command of C
> contains "-package" options for A and B, it is of the form:
>
> ocamlfind ocamlopt ... -package B -package A ... C.cmo
>
> If I permute the two package options, like in
>
> ocamlfind ocamlopt ... -package A -package B ... C.cmo
>
> the compilation works fine. It is not really clear to me, but I thought
> the order of the -package options did not matter, because findlib would
> store the dependencies between packages and produce a compilation command
> where cma or cmxa are correctly sorted. Indeed, if I use the -verbose
> option, I can see that cma are wrongly sorted in the former case, while
> they are fine in the latter.
>
> Admitedly my description is rather abstract, but does anyone see what
> could I (or oasis) have forgotten, to tell ocamlfind that B.cma depends on
> A.cma?
>
> Cheers,
>   Philippe.
>
>

[-- Attachment #2: Type: text/html, Size: 2112 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-12-18 23:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-18 23:21 [Caml-list] Compilation issue with interdependent libraries Philippe Veber
2012-12-18 23:52 ` [Caml-list] " Philippe Veber

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).