Re: using opam ?

Ashish Agarwal <[email protected]>
Newsgroups gmane.comp.lang.ocaml.beginners
Message-ID <CAMu2m2J=WPH+JKt5arZHkZp-BaBKiMDDzyYvo=dfpZ1nPyu_Hg@mail.gmail.com>
On Wed, Nov 6, 2013 at 2:56 PM, Vu Ngoc San <[email protected]> wrote:

in fact : `ocamlfind ocamlc -where` gives
> /usr/lib/ocaml
>

Something is still wrong then. It should give you a path under your .opam
directory. Try running this command:

eval `opam config env`

and then see if the output of `ocamlfind ocamlc -where` changes. Then make
sure you're running this command in your login scripts.




Le 06/11/2013 20:08, [email protected] a écrit :
>
>
>
> -[ Wed, Nov 06, 2013 at 05:44:01PM +0100, Vu Ngoc San ]----
>
> > The stupid thing is that I don't know how to do 2). The packages seem to
> > be installed in
> > $HOME/.opam/system/lib, whereas I have a preexisting ocaml install
> (ubuntu).
> > Do it mean that I need to include this DIR in my Makefile ?
>
> You should use ocamlfind (opam install ocamlfind).
> Then, supposed your PATH includes your opam switch bindir
> (which it should), then:
>
> ocamlfind ocamlc -where
>
> should point toward your opam switch libdir.
> At this point, compiling using ocamlfind boils down to:
>
> ocamlfind ocamlopt -package lib1,lib2,lib3 ...other-options... -c
> module.ml
>
> where lib1 etc are the name registered in the META files (usually the same
> as
> the opam package name)
>
> Since OcamlMakefile already uses ocamlfind (apparently for libraries
> specified
> by the PACKS parameter) I guess everything should runs all right.
>
>
>  
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.