caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Re: [Caml-list] How to install a package
  2001-08-08 10:44 [Caml-list] How to install a package Johann Spies
@ 2001-08-08  9:40 ` Xavier Leroy
  2001-08-08 10:11 ` Alain Frisch
       [not found] ` <15217.3474.83354.531393@akasha.ijm.jussieu.fr>
  2 siblings, 0 replies; 5+ messages in thread
From: Xavier Leroy @ 2001-08-08  9:40 UTC (permalink / raw)
  To: Johann Spies; +Cc: ocaml mailing list

> I have followed the instructions for installing libpq_ocaml.
> 
> $ sudo make install
> ocamlfind install libpq libpq.cmi *.o libpq.cmo *.cmx  META
> Installed /usr/lib/ocaml/libpq/META
> Installed /usr/lib/ocaml/libpq/libpq.cmx
> Installed /usr/lib/ocaml/libpq/libpq.cmo
> Installed /usr/lib/ocaml/libpq/libpqstub.o
> Installed /usr/lib/ocaml/libpq/libpq.o
> Installed /usr/lib/ocaml/libpq/libpq.cmi
> 
> So far so good.
> 
> Now:
> ------------------------------------------------
> $ ocaml
>         Objective Caml version 3.01
> 
> # open Libpq;;
> Unbound module Libpq

I don't know what this libpq package is, and whether the documentation
that comes with it explain the issue, but it seems that it installs in
a subdirectory libpq/ of the Caml standard library directory.  If so,
you must tell ocaml to look there:

        ocaml -I +libpq

Hope this helps,

- Xavier Leroy
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


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

* Re: [Caml-list] How to install a package
  2001-08-08 10:44 [Caml-list] How to install a package Johann Spies
  2001-08-08  9:40 ` Xavier Leroy
@ 2001-08-08 10:11 ` Alain Frisch
  2001-08-08 13:38   ` Johann Spies
       [not found] ` <15217.3474.83354.531393@akasha.ijm.jussieu.fr>
  2 siblings, 1 reply; 5+ messages in thread
From: Alain Frisch @ 2001-08-08 10:11 UTC (permalink / raw)
  To: Johann Spies; +Cc: ocaml mailing list

On 8 Aug 2001, Johann Spies wrote:

> I have followed the instructions for installing libpq_ocaml.

(libpq_ocaml is no longer maintained; you may want to install Postgres
instead (safer interface, more examples); I will give instructions for it)

> But how can I use libpq in the toplevel?

As the package contains C objects, you have to build a custom toplevel:

ocamlfind ocamlmktop -o postgres_top -linkpkg -package postgres

You also have to pass to this toplevel the directory where it can
find the .cmi files for the package (is there a reason
for ocamlmktop not putting the -I options in the custom toplevel ?):

./postgres_top -I `ocamlfind query postgres`

        Objective Caml version 3.01

# let c = new Postgres.connection "host=clipper";;
val c : Postgres.connection = <obj>
# c # user;;
- : string = "frisch"


Hope this helps.

--
 Alain

-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


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

* [Caml-list] How to install a package
@ 2001-08-08 10:44 Johann Spies
  2001-08-08  9:40 ` Xavier Leroy
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Johann Spies @ 2001-08-08 10:44 UTC (permalink / raw)
  To: ocaml mailing list

I have followed the instructions for installing libpq_ocaml.

$ sudo make install
ocamlfind install libpq libpq.cmi *.o libpq.cmo *.cmx  META
Installed /usr/lib/ocaml/libpq/META
Installed /usr/lib/ocaml/libpq/libpq.cmx
Installed /usr/lib/ocaml/libpq/libpq.cmo
Installed /usr/lib/ocaml/libpq/libpqstub.o
Installed /usr/lib/ocaml/libpq/libpq.o
Installed /usr/lib/ocaml/libpq/libpq.cmi

So far so good.

Now:
------------------------------------------------
$ ocaml
        Objective Caml version 3.01

# open Libpq;;
Unbound module Libpq
#
10:37:45 js@bywoner:~$ sudo ldconfig
10:38:05 js@bywoner:~$ ocaml
        Objective Caml version 3.01
# open Libpq;;
Unbound module Libpq

--------------------

Why is that?  

I can compile the program with the following lines in a Makefile:

COMPILE  = ocamlfind ocamlopt -package libpq
LINK     = ocamlfind ocamlopt -linkpkg -package libpq

But how can I use libpq in the toplevel?


Johann
-- 
Johann Spies          Telefoon: 021-808 4036
Informasietegnologie, Universiteit van Stellenbosch

     "Ye lust, and have not; ye kill, and desire to have, 
      and cannot obtain; ye fight and war, yet ye have not, 
      because ye ask not."            James 4:2 
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


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

* Re: [Caml-list] How to install a package
       [not found] ` <15217.3474.83354.531393@akasha.ijm.jussieu.fr>
@ 2001-08-08 13:00   ` Johann Spies
  0 siblings, 0 replies; 5+ messages in thread
From: Johann Spies @ 2001-08-08 13:00 UTC (permalink / raw)
  To: ocaml mailing list

Olivier Andrieu <andrieu@ijm.jussieu.fr> writes:

>  Johann Spies [ 8 August 2001] :
>  > But how can I use libpq in the toplevel?
> 
> Since this package contains stub code, you need to build a custom
> toplevel :
> 
> ocamlmktop -o ocamlpq -custom -I +libpq libpq.cmo libpqstub.o
> 
> then to use it:
> 
> ocamlmktop -I + libpq

Thanks for the information.  Unfortunately the compilation failed.  I
am trying out a new version of the libpq now.

Regards.


Johann
-- 
Johann Spies          Telefoon: 021-808 4036
Informasietegnologie, Universiteit van Stellenbosch

     "Ye lust, and have not; ye kill, and desire to have, 
      and cannot obtain; ye fight and war, yet ye have not, 
      because ye ask not."            James 4:2 
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


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

* Re: [Caml-list] How to install a package
  2001-08-08 10:11 ` Alain Frisch
@ 2001-08-08 13:38   ` Johann Spies
  0 siblings, 0 replies; 5+ messages in thread
From: Johann Spies @ 2001-08-08 13:38 UTC (permalink / raw)
  To: ocaml mailing list; +Cc: Alain Frisch

Alain Frisch <frisch@clipper.ens.fr> writes:


> (libpq_ocaml is no longer maintained; you may want to install Postgres
> instead (safer interface, more examples); I will give instructions for it)
> 
> > But how can I use libpq in the toplevel?
> 
> As the package contains C objects, you have to build a custom toplevel:
> 
> ocamlfind ocamlmktop -o postgres_top -linkpkg -package postgres
> 
> You also have to pass to this toplevel the directory where it can
> find the .cmi files for the package (is there a reason
> for ocamlmktop not putting the -I options in the custom toplevel ?):

Thanks Alan.  That solves my problem.

Regards


Johann
-- 
Johann Spies          Telefoon: 021-808 4036
Informasietegnologie, Universiteit van Stellenbosch

     "Ye lust, and have not; ye kill, and desire to have, 
      and cannot obtain; ye fight and war, yet ye have not, 
      because ye ask not."            James 4:2 
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


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

end of thread, other threads:[~2001-08-08 11:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-08 10:44 [Caml-list] How to install a package Johann Spies
2001-08-08  9:40 ` Xavier Leroy
2001-08-08 10:11 ` Alain Frisch
2001-08-08 13:38   ` Johann Spies
     [not found] ` <15217.3474.83354.531393@akasha.ijm.jussieu.fr>
2001-08-08 13:00   ` Johann Spies

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