List Info

Thread: "ocaml_beginners"::[] help using third party libraries




"ocaml_beginners"::[] help using third party libraries
user name
2006-11-24 00:41:03

On Thu, 23 Nov 2006, drehman27 wrote:

> I would like to use the DynArray module from ExtLib.
>
> Here's what I did:
>
> I installed godi and using godi_console installed ExtLib.
>
> I installed godi at: /home/user/godi
>
> When I use "ocamlfind list" I saw that extlib was available so I added
>; the following line to my MakeFile.
> PACKS = unix bigarray extlib
>
> I compiled my program with "make bc top"
> But when I try the following in the toplevel I created, the DynArray
> module is not loaded. How can I fix this?
>;
> # DynArray.create;;
> Unbound value DynArray.create

I believe it's a search path problem. I'm not sure whether it qualifies as
a bug or not. But it's definitely counter-intuitive since the library is
actually loaded. I suspect the toplevel is looking for dynArray.cmi and
doesn't find it because the search path doesn't include it, although the
library is loaded (since you may have some junk in this directory, you
may not want to put it automatically into the search path which would
explain the observed behavior - maybe you should ask the author of
findlib, Gerd Stolpmann, directly or though caml-list%40inria.fr">caml-listinria.fr).

Anyway, what you should do is:
#use "topfind";;
#require "extlib";;

This really adds extlib's directory to the search path:

# #require "extlib";;
/home/martin/godi/lib/ocaml/pkg-lib/extlib: added to search path
/home/martin/godi/lib/ocaml/pkg-lib/extlib/extLib.cma: loaded

--
Martin Jambon, PhD
http://martin.jambon.free.fr

__._,_.___
.

__,_._,___
"ocaml_beginners"::[] help using third party libraries
user name
2006-11-24 09:39:16


> I believe it's a search path problem. I'm not sure whether it
qualifies as
> a bug or not. But it's definitely counter-intuitive since the
library is
> actually loaded. I suspect the toplevel is looking for dynArray.cmi and
> doesn't find it because the search path doesn't include it, although
the
> library is loaded (since you may have some junk in this directory, you
> may not want to put it automatically into the search path which would
> explain the observed behavior - maybe you should ask the author of
> findlib, Gerd Stolpmann, directly or though caml-list...).
>
> Anyway, what you should do is:
> #use "topfind";;
> #require "extlib";;
>
> This really adds extlib's directory to the search path:
>;
> # #require "extlib";;
> /home/martin/godi/lib/ocaml/pkg-lib/extlib: added to search path
> /home/martin/godi/lib/ocaml/pkg-lib/extlib/extLib.cma: loaded
>
>
> --
> Martin Jambon, PhD
> http://martin.jambon.free.fr
>

Yes what you say works, but only in the toplevel, but I want to
compile programs with third-party libraries. I will try and ask the
author of GODI or maybe the caml-list.
Thanks.

__._,_.___
.

__,_._,___
[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )