caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] ocamlfind + sexplib + bin_io
@ 2012-04-27 18:21 Matej Košík
       [not found] ` <CE03BFB3-8F84-4AA4-A536-48E8DAC0DF22@metastack.com>
  0 siblings, 1 reply; 5+ messages in thread
From: Matej Košík @ 2012-04-27 18:21 UTC (permalink / raw)
  To: Caml List

Hi,

I have decided to switch to ocamlfind.
All goes find but I have ran into a problem how to make "ocaml",
"sexplib" and "bin_io" play together.

Suppose that I have the following "program":

	type test = Foo | Bar
	with sexp, bin_io

when I try to compile it without ocamlfind:

	ocamlc -o main -pp "camlp4o -I ZZZ/lib/godi/lib/ocaml/pkg-lib/sexplib
-I ZZZ/lib/godi/lib/ocaml/pkg-lib/type-conv -I
ZZZ/lib/godi/lib/ocaml/pkg-lib/bin_prot pa_type_conv.cma
pa_sexp_conv.cma pa_bin_prot.cma" -I
ZZZ/lib/godi/lib/ocaml/pkg-lib/sexplib -I
ZZZ/lib/godi/lib/ocaml/pkg-lib/type-conv -I
ZZZ/lib/godi/lib/ocaml/pkg-lib/bin_prot unix.cma nums.cma bigarray.cma
sexplib.cma bin_prot.cma main.ml

all goes well.

When I try to simplify the build instruction with ocamlfind:

	ocamlfind ocamlc -linkpkg -package
sexplib,sexplib.syntax,bin_prot,bin_prot.syntax -syntax camlp4o main.ml

I get the following error:

	Camlp4: Uncaught exception: Not_found

	File "main.ml", line 1, characters 0-1:
	Error: Preprocessor error

What should I put on the command-line along with ocamlfind to be able to
compile the original program; if that is what I am doing wrong.

Thank you very much in advance for the help.

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

* Re: [Caml-list] ocamlfind + sexplib + bin_io
       [not found] ` <CE03BFB3-8F84-4AA4-A536-48E8DAC0DF22@metastack.com>
@ 2012-04-27 18:37   ` Matej Košík
  2012-04-27 19:29     ` Markus Mottl
  0 siblings, 1 reply; 5+ messages in thread
From: Matej Košík @ 2012-04-27 18:37 UTC (permalink / raw)
  To: Caml List

On 04/27/2012 07:24 PM, David Allsopp wrote:
> Try adding -verbose to the call - ocamlfind will display the commands it is executing which may help refine the problem.

With this:

ocamlfind ocamlc -verbose -linkpkg -package
sexplib,sexplib.syntax,bin_prot,bin_prot.syntax -syntax camlp4o main.ml

I get the following output:

Effective set of preprocessor predicates: preprocessor,syntax,camlp4o
Effective set of compiler predicates:
pkg_unix,pkg_bigarray,pkg_num.core,pkg_num,pkg_sexplib,pkg_camlp4,pkg_type_conv,pkg_sexplib.syntax,pkg_bin_prot,pkg_type-conv,pkg_bin_prot.syntax,syntax,autolink,byte
+ ocamlc.opt -verbose -I /home/mkosik/lib/godi/lib/ocaml/pkg-lib/num -I
/home/mkosik/lib/godi/lib/ocaml/std-lib/camlp4 -I
/home/mkosik/lib/godi/lib/ocaml/pkg-lib/type_conv -I
/home/mkosik/lib/godi/lib/ocaml/pkg-lib/sexplib -I
/home/mkosik/lib/godi/lib/ocaml/pkg-lib/type-conv -I
/home/mkosik/lib/godi/lib/ocaml/pkg-lib/bin_prot -pp "camlp4 '-I'
'/home/mkosik/lib/godi/lib/ocaml/std-lib/camlp4' '-I'
'/home/mkosik/lib/godi/lib/ocaml/pkg-lib/type_conv' '-I'
'/home/mkosik/lib/godi/lib/ocaml/std-lib' '-I'
'/home/mkosik/lib/godi/lib/ocaml/std-lib' '-I'
'/home/mkosik/lib/godi/lib/ocaml/std-lib' '-I'
'/home/mkosik/lib/godi/lib/ocaml/pkg-lib/num' '-I'
'/home/mkosik/lib/godi/lib/ocaml/pkg-lib/sexplib' '-I'
'/home/mkosik/lib/godi/lib/ocaml/pkg-lib/sexplib' '-I'
'/home/mkosik/lib/godi/lib/ocaml/pkg-lib/type-conv' '-I'
'/home/mkosik/lib/godi/lib/ocaml/pkg-lib/bin_prot' '-I'
'/home/mkosik/lib/godi/lib/ocaml/pkg-lib/bin_prot' '-parser' 'o'
'-parser' 'op' '-printer' 'p' 'pa_type_conv.cma' 'unix.cma'
'bigarray.cma' 'nums.cma' 'sexplib.cma' 'pa_sexp_conv.cma'
'pa_type_conv.cma' 'bin_prot.cma' 'pa_bin_prot.cma' "
/home/mkosik/lib/godi/lib/ocaml/std-lib/unix.cma
/home/mkosik/lib/godi/lib/ocaml/std-lib/bigarray.cma
/home/mkosik/lib/godi/lib/ocaml/std-lib/nums.cma
/home/mkosik/lib/godi/lib/ocaml/pkg-lib/sexplib/sexplib.cma
/home/mkosik/lib/godi/lib/ocaml/pkg-lib/bin_prot/bin_prot.cma main.ml
+ camlp4 '-I' '/home/mkosik/lib/godi/lib/ocaml/std-lib/camlp4' '-I'
'/home/mkosik/lib/godi/lib/ocaml/pkg-lib/type_conv' '-I'
'/home/mkosik/lib/godi/lib/ocaml/std-lib' '-I'
'/home/mkosik/lib/godi/lib/ocaml/std-lib' '-I'
'/home/mkosik/lib/godi/lib/ocaml/std-lib' '-I'
'/home/mkosik/lib/godi/lib/ocaml/pkg-lib/num' '-I'
'/home/mkosik/lib/godi/lib/ocaml/pkg-lib/sexplib' '-I'
'/home/mkosik/lib/godi/lib/ocaml/pkg-lib/sexplib' '-I'
'/home/mkosik/lib/godi/lib/ocaml/pkg-lib/type-conv' '-I'
'/home/mkosik/lib/godi/lib/ocaml/pkg-lib/bin_prot' '-I'
'/home/mkosik/lib/godi/lib/ocaml/pkg-lib/bin_prot' '-parser' 'o'
'-parser' 'op' '-printer' 'p' 'pa_type_conv.cma' 'unix.cma'
'bigarray.cma' 'nums.cma' 'sexplib.cma' 'pa_sexp_conv.cma'
'pa_type_conv.cma' 'bin_prot.cma' 'pa_bin_prot.cma'  'main.ml' >
/tmp/camlpp99eefa
Camlp4: Uncaught exception: Not_found

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

* Re: [Caml-list] ocamlfind + sexplib + bin_io
  2012-04-27 18:37   ` Matej Košík
@ 2012-04-27 19:29     ` Markus Mottl
  2012-04-28 18:12       ` Matej Košík
  0 siblings, 1 reply; 5+ messages in thread
From: Markus Mottl @ 2012-04-27 19:29 UTC (permalink / raw)
  To: Matej Košík; +Cc: Caml List

Hi,

even the following should work if everything is installed correctly:

  ocamlfind ocamlc -linkpkg -package sexplib.syntax,bin_prot.syntax
-syntax camlp4o main.ml

The currently best supported versions of type_conv, sexplib, and
bin_prot can be found in my fork of Jane Street's Core library here:

  https://bitbucket.org/mmottl/ocaml-core-mmottl

Installation is fairly easy: it only requires uninstalling all Jane
Street Godi packages, type_conv, bin_prot, and sexplib, installing
Oasis 0.3, and running one script "build-and-install", which will
install ocamlfind packages for all libraries.

It may unfortunately still take a little while before Jane Street will
release their latest version of Core, which should integrate the above
and also finally into Godi.  Until then people who want to use Core or
any of type_conv, sexplib, and bin_prot are probably well-advised to
not use the Godi packages.

Regards,
Markus

On Fri, Apr 27, 2012 at 14:37, Matej Košík
<5764c029b688c1c0d24a2e97cd764f@gmail.com> wrote:
> On 04/27/2012 07:24 PM, David Allsopp wrote:
>> Try adding -verbose to the call - ocamlfind will display the commands it is executing which may help refine the problem.
>
> With this:
>
> ocamlfind ocamlc -verbose -linkpkg -package
> sexplib,sexplib.syntax,bin_prot,bin_prot.syntax -syntax camlp4o main.ml
>
> I get the following output:
>
> Effective set of preprocessor predicates: preprocessor,syntax,camlp4o
> Effective set of compiler predicates:
> pkg_unix,pkg_bigarray,pkg_num.core,pkg_num,pkg_sexplib,pkg_camlp4,pkg_type_conv,pkg_sexplib.syntax,pkg_bin_prot,pkg_type-conv,pkg_bin_prot.syntax,syntax,autolink,byte
> + ocamlc.opt -verbose -I /home/mkosik/lib/godi/lib/ocaml/pkg-lib/num -I
> /home/mkosik/lib/godi/lib/ocaml/std-lib/camlp4 -I
> /home/mkosik/lib/godi/lib/ocaml/pkg-lib/type_conv -I
> /home/mkosik/lib/godi/lib/ocaml/pkg-lib/sexplib -I
> /home/mkosik/lib/godi/lib/ocaml/pkg-lib/type-conv -I
> /home/mkosik/lib/godi/lib/ocaml/pkg-lib/bin_prot -pp "camlp4 '-I'
> '/home/mkosik/lib/godi/lib/ocaml/std-lib/camlp4' '-I'
> '/home/mkosik/lib/godi/lib/ocaml/pkg-lib/type_conv' '-I'
> '/home/mkosik/lib/godi/lib/ocaml/std-lib' '-I'
> '/home/mkosik/lib/godi/lib/ocaml/std-lib' '-I'
> '/home/mkosik/lib/godi/lib/ocaml/std-lib' '-I'
> '/home/mkosik/lib/godi/lib/ocaml/pkg-lib/num' '-I'
> '/home/mkosik/lib/godi/lib/ocaml/pkg-lib/sexplib' '-I'
> '/home/mkosik/lib/godi/lib/ocaml/pkg-lib/sexplib' '-I'
> '/home/mkosik/lib/godi/lib/ocaml/pkg-lib/type-conv' '-I'
> '/home/mkosik/lib/godi/lib/ocaml/pkg-lib/bin_prot' '-I'
> '/home/mkosik/lib/godi/lib/ocaml/pkg-lib/bin_prot' '-parser' 'o'
> '-parser' 'op' '-printer' 'p' 'pa_type_conv.cma' 'unix.cma'
> 'bigarray.cma' 'nums.cma' 'sexplib.cma' 'pa_sexp_conv.cma'
> 'pa_type_conv.cma' 'bin_prot.cma' 'pa_bin_prot.cma' "
> /home/mkosik/lib/godi/lib/ocaml/std-lib/unix.cma
> /home/mkosik/lib/godi/lib/ocaml/std-lib/bigarray.cma
> /home/mkosik/lib/godi/lib/ocaml/std-lib/nums.cma
> /home/mkosik/lib/godi/lib/ocaml/pkg-lib/sexplib/sexplib.cma
> /home/mkosik/lib/godi/lib/ocaml/pkg-lib/bin_prot/bin_prot.cma main.ml
> + camlp4 '-I' '/home/mkosik/lib/godi/lib/ocaml/std-lib/camlp4' '-I'
> '/home/mkosik/lib/godi/lib/ocaml/pkg-lib/type_conv' '-I'
> '/home/mkosik/lib/godi/lib/ocaml/std-lib' '-I'
> '/home/mkosik/lib/godi/lib/ocaml/std-lib' '-I'
> '/home/mkosik/lib/godi/lib/ocaml/std-lib' '-I'
> '/home/mkosik/lib/godi/lib/ocaml/pkg-lib/num' '-I'
> '/home/mkosik/lib/godi/lib/ocaml/pkg-lib/sexplib' '-I'
> '/home/mkosik/lib/godi/lib/ocaml/pkg-lib/sexplib' '-I'
> '/home/mkosik/lib/godi/lib/ocaml/pkg-lib/type-conv' '-I'
> '/home/mkosik/lib/godi/lib/ocaml/pkg-lib/bin_prot' '-I'
> '/home/mkosik/lib/godi/lib/ocaml/pkg-lib/bin_prot' '-parser' 'o'
> '-parser' 'op' '-printer' 'p' 'pa_type_conv.cma' 'unix.cma'
> 'bigarray.cma' 'nums.cma' 'sexplib.cma' 'pa_sexp_conv.cma'
> 'pa_type_conv.cma' 'bin_prot.cma' 'pa_bin_prot.cma'  'main.ml' >
> /tmp/camlpp99eefa
> Camlp4: Uncaught exception: Not_found
>
> --
> Caml-list mailing list.  Subscription management and archives:
> https://sympa-roc.inria.fr/wws/info/caml-list
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
>



-- 
Markus Mottl        http://www.ocaml.info        markus.mottl@gmail.com


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

* Re: [Caml-list] ocamlfind + sexplib + bin_io
  2012-04-27 19:29     ` Markus Mottl
@ 2012-04-28 18:12       ` Matej Košík
  2012-04-28 18:46         ` Markus Mottl
  0 siblings, 1 reply; 5+ messages in thread
From: Matej Košík @ 2012-04-28 18:12 UTC (permalink / raw)
  To: Markus Mottl; +Cc: Caml List

On 04/27/2012 08:29 PM, Markus Mottl wrote:
> Hi,
> 
> even the following should work if everything is installed correctly:
> 
>   ocamlfind ocamlc -linkpkg -package sexplib.syntax,bin_prot.syntax
> -syntax camlp4o main.ml

If I try this command, I get the same error:

	Camlp4: Uncaught exception: Not_found

	File "main.ml", line 1, characters 0-1:
	Error: Preprocessor error

Now, I am not sure what should be the conclusion.

I hesitate to claim that versions of (sexplib+bin_prot) libraries
published in GODI are faulty---if I do not use ocamlfind, I can use
those libraries just fine.

Do not you think that camlp4 is never expected (for any kind of input)
throw an exception? Are we sure that the reported steps do not simply
trigger a camlp4 bug?

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

* Re: [Caml-list] ocamlfind + sexplib + bin_io
  2012-04-28 18:12       ` Matej Košík
@ 2012-04-28 18:46         ` Markus Mottl
  0 siblings, 0 replies; 5+ messages in thread
From: Markus Mottl @ 2012-04-28 18:46 UTC (permalink / raw)
  To: Matej Košík; +Cc: Caml List

On Sat, Apr 28, 2012 at 14:12, Matej Košík
<5764c029b688c1c0d24a2e97cd764f@gmail.com> wrote:
> On 04/27/2012 08:29 PM, Markus Mottl wrote:
>> Hi,
>>
>> even the following should work if everything is installed correctly:
>>
>>   ocamlfind ocamlc -linkpkg -package sexplib.syntax,bin_prot.syntax
>> -syntax camlp4o main.ml
>
> If I try this command, I get the same error:
>
>        Camlp4: Uncaught exception: Not_found
>
>        File "main.ml", line 1, characters 0-1:
>        Error: Preprocessor error
>
> Now, I am not sure what should be the conclusion.

Well, the conclusion would be that there is something wrong with the
installation ;-)

> I hesitate to claim that versions of (sexplib+bin_prot) libraries
> published in GODI are faulty---if I do not use ocamlfind, I can use
> those libraries just fine.

It could be that there is more than one installation of these
libraries on your system and that they are in conflict.  E.g. if you
ever installed type_conv outside of Godi.

> Do not you think that camlp4 is never expected (for any kind of input)
> throw an exception? Are we sure that the reported steps do not simply
> trigger a camlp4 bug?

There is surely a reason for this exception.  It might indeed be due
to incompatible preprocessing modules.

To make sure that things compile, please delete any potential other
installations of the above libraries from your system.  One problem
that seems to have happened for some people is that they previously
installed type-conv and bin-prot.  These packages have been renamed to
type_conv and bin_prot (complex reason).  If they have been previously
installed, you may now have both packages on your system.  It seems
Godi cannot determine renamed packages and will leave old ones in
place.  Please make sure to manually delete all files and directories
in your Godi installation that match "*type-conv*" or "*bin-prot*".
If in doubt, just completely reinstall Godi.  I've just tested the
current release, and it works for me.

Regards,
Markus

-- 
Markus Mottl        http://www.ocaml.info        markus.mottl@gmail.com


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

end of thread, other threads:[~2012-04-28 18:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-27 18:21 [Caml-list] ocamlfind + sexplib + bin_io Matej Košík
     [not found] ` <CE03BFB3-8F84-4AA4-A536-48E8DAC0DF22@metastack.com>
2012-04-27 18:37   ` Matej Košík
2012-04-27 19:29     ` Markus Mottl
2012-04-28 18:12       ` Matej Košík
2012-04-28 18:46         ` Markus Mottl

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