* [Caml-list] deriving
@ 2012-01-27 16:51 Matej Košík
2012-01-27 23:29 ` [Caml-list] deriving Richard Stoerzer
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Matej Košík @ 2012-01-27 16:51 UTC (permalink / raw)
To: caml-list
Hi,
I would like to play with / evaluate the "deriving" library:
http://code.google.com/p/deriving/wiki/Introduction
How can I:
- create a Ocaml top-level where I can play with it?
- compile programs which take advantage of this library?
I am on Fedora 16.
What I have tried is this:
$ sudo yum install ocaml-deriving-devel
$ rlwrap ocaml
# #use "topfind";;
# #require "deriving";;
No such package: %{camlp4} - Required by `deriving'
I am not sure how to proceed.
------------------------------------------------
Concerning linking against this library, I have tried this:
$ cat Main.ml
let s = Show.show<int> 3
$ ocamlc -I +deriving -pp "camlp4of -I `ocamlc -where`/deriving
nums.cma deriving.cma" deriving.cma Main.ml -o main
File "ghost-location", line 7, characters 8--144:
Error: Unbound value Show.show
make: *** [main] Error 2
where "Main.ml" is supposed to be a program that uses syntactic sugar
provided by "deriving" library.
What is the proper way to get things compiled? I have failed to find any
examples.
Thanks in advance for the help.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Caml-list] Re: deriving
2012-01-27 16:51 [Caml-list] deriving Matej Košík
@ 2012-01-27 23:29 ` Richard Stoerzer
2012-01-29 13:10 ` [Caml-list] deriving Lin
2012-01-29 19:34 ` Richard W.M. Jones
2 siblings, 0 replies; 7+ messages in thread
From: Richard Stoerzer @ 2012-01-27 23:29 UTC (permalink / raw)
To: caml-list
On Fri, 27 Jan 2012 16:51:35 +0000
Matej Košík <5764c029b688c1c0d24a2e97cd764f@gmail.com> wrote:
> $ ocamlc -I +deriving -pp "camlp4of -I `ocamlc -where`/deriving
> nums.cma deriving.cma" deriving.cma Main.ml -o main
Just take a look at the examples under "./test".
deriving ships with an own preprocessor:
e.g:
ocamlc -pp "deriving" -I $DERIVING_DIR deriving.cma mail.ml -o main
Or use the version, that is provided by the ocsigen team
( http://ocsigen.org/download/ )
This one is findlib friendly and supports the toplevel without hassle.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Caml-list] deriving
2012-01-27 16:51 [Caml-list] deriving Matej Košík
2012-01-27 23:29 ` [Caml-list] deriving Richard Stoerzer
@ 2012-01-29 13:10 ` Lin
2012-01-29 18:11 ` Matej Košík
2012-01-29 19:34 ` Richard W.M. Jones
2 siblings, 1 reply; 7+ messages in thread
From: Lin @ 2012-01-29 13:10 UTC (permalink / raw)
To: caml-list
I have no Fedora machine at hand, but from the error message it seems to
have something to do with camlp4. Do you have it installed correctly?
Check if you have the camlp4 command by `which camlp4`.
On 01/28/2012 12:51 AM, Matej Košík wrote:
> Hi,
>
> I would like to play with / evaluate the "deriving" library:
> http://code.google.com/p/deriving/wiki/Introduction
>
> How can I:
> - create a Ocaml top-level where I can play with it?
> - compile programs which take advantage of this library?
>
> I am on Fedora 16.
>
> What I have tried is this:
>
> $ sudo yum install ocaml-deriving-devel
> $ rlwrap ocaml
> # #use "topfind";;
> # #require "deriving";;
> No such package: %{camlp4} - Required by `deriving'
>
> I am not sure how to proceed.
>
> ------------------------------------------------
>
> Concerning linking against this library, I have tried this:
>
> $ cat Main.ml
>
> let s = Show.show<int> 3
>
> $ ocamlc -I +deriving -pp "camlp4of -I `ocamlc -where`/deriving
> nums.cma deriving.cma" deriving.cma Main.ml -o main
>
> File "ghost-location", line 7, characters 8--144:
> Error: Unbound value Show.show
> make: *** [main] Error 2
>
> where "Main.ml" is supposed to be a program that uses syntactic sugar
> provided by "deriving" library.
>
> What is the proper way to get things compiled? I have failed to find any
> examples.
>
> Thanks in advance for the help.
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Caml-list] deriving
2012-01-29 13:10 ` [Caml-list] deriving Lin
@ 2012-01-29 18:11 ` Matej Košík
2012-01-29 18:15 ` Adrien
0 siblings, 1 reply; 7+ messages in thread
From: Matej Košík @ 2012-01-29 18:11 UTC (permalink / raw)
To: Lin; +Cc: caml-list
On 01/29/2012 01:10 PM, Lin wrote:
> I have no Fedora machine at hand, but from the error message it seems to
> have something to do with camlp4. Do you have it installed correctly?
> Check if you have the camlp4 command by `which camlp4`.
I am not sure what caused the problem but camlp4 was not missing.
After some experimentation I was able to get "godi-deriving-ocsigen"
working. Why Fedora package did not work for me, I do not know. Maybe I
did some other error... I am not very familiar with Ocaml libraries.
Thanks for the tip.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Caml-list] deriving
2012-01-29 18:11 ` Matej Košík
@ 2012-01-29 18:15 ` Adrien
2012-01-29 18:25 ` Matej Košík
0 siblings, 1 reply; 7+ messages in thread
From: Adrien @ 2012-01-29 18:15 UTC (permalink / raw)
To: Matej Košík; +Cc: caml-list
Hi,
Could you show the content of the META file for deriving on your
fedora installation?
On my computer (I'm not using fedora), a command like this one points
to a proper file:
% find /opt/ocaml -name META | grep -i deriving
/opt/ocaml/lib/ocaml/pkg-lib/deriving-ocsigen/META
Regards,
Adrien Nader
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Caml-list] deriving
2012-01-29 18:15 ` Adrien
@ 2012-01-29 18:25 ` Matej Košík
0 siblings, 0 replies; 7+ messages in thread
From: Matej Košík @ 2012-01-29 18:25 UTC (permalink / raw)
To: Adrien; +Cc: caml-list
On 01/29/2012 06:15 PM, Adrien wrote:
> Hi,
>
> Could you show the content of the META file for deriving on your
> fedora installation?
>
> On my computer (I'm not using fedora), a command like this one points
> to a proper file:
> % find /opt/ocaml -name META | grep -i deriving
> /opt/ocaml/lib/ocaml/pkg-lib/deriving-ocsigen/META
Here it is:
mkosik@desktop:~$ cat /usr/lib64/ocaml/deriving/META
name="deriving"
version="0.1.1a"
requires="%{camlp4}"
description="%{description}"
# need a syntax here XXX
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Caml-list] deriving
2012-01-27 16:51 [Caml-list] deriving Matej Košík
2012-01-27 23:29 ` [Caml-list] deriving Richard Stoerzer
2012-01-29 13:10 ` [Caml-list] deriving Lin
@ 2012-01-29 19:34 ` Richard W.M. Jones
2 siblings, 0 replies; 7+ messages in thread
From: Richard W.M. Jones @ 2012-01-29 19:34 UTC (permalink / raw)
To: Matej Košík; +Cc: caml-list
On Fri, Jan 27, 2012 at 04:51:35PM +0000, Matej Košík wrote:
> Hi,
>
> I would like to play with / evaluate the "deriving" library:
> http://code.google.com/p/deriving/wiki/Introduction
>
> How can I:
> - create a Ocaml top-level where I can play with it?
> - compile programs which take advantage of this library?
>
> I am on Fedora 16.
>
> What I have tried is this:
>
> $ sudo yum install ocaml-deriving-devel
> $ rlwrap ocaml
> # #use "topfind";;
> # #require "deriving";;
> No such package: %{camlp4} - Required by `deriving'
This is a bug in the Fedora package:
$ cat /usr/lib64/ocaml/deriving/META
name="deriving"
version="0.1.1a"
requires="%{camlp4}"
description="%{description}"
Obviously those %... sequences are RPM macros which should have been
replaced. Please file a bug at http://bugzilla.redhat.com
Rich.
--
Richard Jones
Red Hat
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2012-01-29 19:34 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-27 16:51 [Caml-list] deriving Matej Košík
2012-01-27 23:29 ` [Caml-list] deriving Richard Stoerzer
2012-01-29 13:10 ` [Caml-list] deriving Lin
2012-01-29 18:11 ` Matej Košík
2012-01-29 18:15 ` Adrien
2012-01-29 18:25 ` Matej Košík
2012-01-29 19:34 ` Richard W.M. Jones
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox