caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* ocamlbuild not including dependencies with mlpack
@ 2008-10-06 17:49 Ashish Agarwal
  2008-10-06 19:42 ` [Caml-list] " Nicolas Pouillard
  0 siblings, 1 reply; 2+ messages in thread
From: Ashish Agarwal @ 2008-10-06 17:49 UTC (permalink / raw)
  To: Caml List

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

Ocamlbuild seems to not include dependent modules when building a library,
when that library is defined by an mlpack file. However, it works fine if I
manually pack, i.e. define an ml file instead of an mlpack file. Here's a
summary:

--- mylib.mlpack ---
A
B

$ ocamlbuild mylib.cma
$ cat _build/_log  #just showing relevant line
ocamlfind ocamlc -a -linkpkg mylib.cmo -o mylib.cma

I was expecting a.cmo and b.cmo to get included in the library but they are
not.
Now if a replace the mylib.mlpack with mylib.ml as follows, I get what I
want.

--- mylib.ml ---
module A = A
module B = B

$ ocamlbuild mylib.cma
$ cat _build/_log  #just showing relevant line
ocamlfind ocamlc -a -linkpkg a.cmo b.cmo mylib.cmo -o mylib.cma

How can I get the latter behavior with mlpack? Thank you.

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

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

* Re: [Caml-list] ocamlbuild not including dependencies with mlpack
  2008-10-06 17:49 ocamlbuild not including dependencies with mlpack Ashish Agarwal
@ 2008-10-06 19:42 ` Nicolas Pouillard
  0 siblings, 0 replies; 2+ messages in thread
From: Nicolas Pouillard @ 2008-10-06 19:42 UTC (permalink / raw)
  To: Ashish Agarwal; +Cc: caml-list

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

Excerpts from Ashish Agarwal's message of Mon Oct 06 19:49:16 +0200 2008:
> Ocamlbuild seems to not include dependent modules when building a library,
> when that library is defined by an mlpack file. However, it works fine if I
> manually pack, i.e. define an ml file instead of an mlpack file. Here's a
> summary:
> 
> --- mylib.mlpack ---
> A
> B
> 
> $ ocamlbuild mylib.cma
> $ cat _build/_log  #just showing relevant line
> ocamlfind ocamlc -a -linkpkg mylib.cmo -o mylib.cma
> 
> I was expecting a.cmo and b.cmo to get included in the library but they are
> not.
> Now if a replace the mylib.mlpack with mylib.ml as follows, I get what I
> want.
> 
> --- mylib.ml ---
> module A = A
> module B = B
> 
> $ ocamlbuild mylib.cma
> $ cat _build/_log  #just showing relevant line
> ocamlfind ocamlc -a -linkpkg a.cmo b.cmo mylib.cmo -o mylib.cma
> 
> How can I get the latter behavior with mlpack? Thank you.

The concept of package is precisely to get rid of a.cmo and b.cmo, since
mylib.cmo (in your first example) contains all the code of A and B.
In the second example mylib.cmo does not contains the code of A and B but
merely a bunch of 'let' definitions.

In your case, if you want to avoid name-space pollution by using packs, then
the first option is the right one.

Best regards,

-- 
Nicolas Pouillard aka Ertai

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 194 bytes --]

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

end of thread, other threads:[~2008-10-06 19:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-06 17:49 ocamlbuild not including dependencies with mlpack Ashish Agarwal
2008-10-06 19:42 ` [Caml-list] " Nicolas Pouillard

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