caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Issue to compile a program with camlp4 in OCaml 3.10.0
@ 2008-09-22 20:41 David MENTRE
  2008-09-23  6:53 ` [Caml-list] " Gabriel Kerneis
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: David MENTRE @ 2008-09-22 20:41 UTC (permalink / raw)
  To: caml-list

Hello,

I'm trying to compile an OCaml program I haven't written. I'm compiling
it on an Ubuntu 8.04, OCaml 3.10.0.

The compilation fails with following error:
"""
ocamlopt -pp "camlp4o pa_op.cmo" -I src                      -c src/common.ml
File "src/common.ml", line 5, characters 101-102:
Parse error: "in" expected after [binding] (in [expr])
Preprocessor error
"""

Here is the beginning of the relevant file:
"""
(** Common utility functions. *)

(* space *)

let heap_size () : float = float_of_int (Gc.stat ()).Gc.heap_words *. float_of_int (Sys.word_size / 8)  (* in bytes *)

"""

This expression seems correct to me. Is this issue related to one of the
fixes on camlp4 that where made in 3.10.1?

Any idea how to work around this issue (without recompiling latest ocaml
and all the needed libraries)?

Sincerly yours,
david
-- 
GPG/PGP key: A3AD7A2A David MENTRE <dmentre@linux-france.org>
 5996 CC46 4612 9CA4 3562  D7AC 6C67 9E96 A3AD 7A2A


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

* Re: [Caml-list] Issue to compile a program with camlp4 in OCaml 3.10.0
  2008-09-22 20:41 Issue to compile a program with camlp4 in OCaml 3.10.0 David MENTRE
@ 2008-09-23  6:53 ` Gabriel Kerneis
  2008-09-23 16:22   ` David MENTRE
  2008-09-23  8:08 ` Сергей Плаксин
  2008-09-23 10:18 ` Richard Jones
  2 siblings, 1 reply; 8+ messages in thread
From: Gabriel Kerneis @ 2008-09-23  6:53 UTC (permalink / raw)
  To: David MENTRE; +Cc: caml-list

On Mon, Sep 22, 2008 at 10:41:52PM +0200, David MENTRE wrote:
> ocamlopt -pp "camlp4o pa_op.cmo" -I src                      -c src/common.ml
> File "src/common.ml", line 5, characters 101-102:
> Parse error: "in" expected after [binding] (in [expr])
> Preprocessor error
> 
> let heap_size () : float = [...]

Does the following solve the problem?

  val heap_size () : float = [...]

If it does, it has to do with revised syntax and you should change the flags
of camlp4 (but it believe camlp4o loads the classic syntax, so it might be a
bug as well).

Regards,
-- 
Gabriel Kerneis


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

* Re: [Caml-list] Issue to compile a program with camlp4 in OCaml 3.10.0
  2008-09-22 20:41 Issue to compile a program with camlp4 in OCaml 3.10.0 David MENTRE
  2008-09-23  6:53 ` [Caml-list] " Gabriel Kerneis
@ 2008-09-23  8:08 ` Сергей Плаксин
  2008-09-23 16:29   ` David MENTRE
  2008-09-24  6:56   ` Michel Mauny
  2008-09-23 10:18 ` Richard Jones
  2 siblings, 2 replies; 8+ messages in thread
From: Сергей Плаксин @ 2008-09-23  8:08 UTC (permalink / raw)
  To: David MENTRE; +Cc: caml-list

On Mon, 2008-09-22 at 22:41 +0200, David MENTRE wrote:
> Hello,
> 
> I'm trying to compile an OCaml program I haven't written. I'm compiling
> it on an Ubuntu 8.04, OCaml 3.10.0.
> 
> The compilation fails with following error:
> """
> ocamlopt -pp "camlp4o pa_op.cmo" -I src                      -c src/common.ml
> File "src/common.ml", line 5, characters 101-102:
> Parse error: "in" expected after [binding] (in [expr])
> Preprocessor error
> """
> 
> Here is the beginning of the relevant file:
> """
> (** Common utility functions. *)
> 
> (* space *)
> 
> let heap_size () : float = float_of_int (Gc.stat ()).Gc.heap_words *. float_of_int (Sys.word_size / 8)  (* in bytes *)

This code successfuly compiled on my ocaml 3.10.2 without any
"pa_op.cmo", what is pa_op.cmo?


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

* Re: [Caml-list] Issue to compile a program with camlp4 in OCaml 3.10.0
  2008-09-22 20:41 Issue to compile a program with camlp4 in OCaml 3.10.0 David MENTRE
  2008-09-23  6:53 ` [Caml-list] " Gabriel Kerneis
  2008-09-23  8:08 ` Сергей Плаксин
@ 2008-09-23 10:18 ` Richard Jones
  2008-09-23 16:31   ` David MENTRE
  2 siblings, 1 reply; 8+ messages in thread
From: Richard Jones @ 2008-09-23 10:18 UTC (permalink / raw)
  To: David MENTRE; +Cc: caml-list

On Mon, Sep 22, 2008 at 10:41:52PM +0200, David MENTRE wrote:
> I'm trying to compile an OCaml program I haven't written. I'm compiling
> it on an Ubuntu 8.04, OCaml 3.10.0.

3.10.0 contains quite a few camlp4 parsing bugs which are fixed in
version 3.10.2.  (But unfortunately I still have to workaround them
because Fedora 8 is stuck at 3.10.0 ...)

Best to upgrade if you can.

Rich.

-- 
Richard Jones
Red Hat


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

* Re: [Caml-list] Issue to compile a program with camlp4 in OCaml 3.10.0
  2008-09-23  6:53 ` [Caml-list] " Gabriel Kerneis
@ 2008-09-23 16:22   ` David MENTRE
  0 siblings, 0 replies; 8+ messages in thread
From: David MENTRE @ 2008-09-23 16:22 UTC (permalink / raw)
  To: caml-list

Hello Gabriel,

On Tue, Sep 23, 2008 at 08:53, Gabriel Kerneis <kerneis@enst.fr> wrote:
> Does the following solve the problem?
>
>  val heap_size () : float = [...]
>
> If it does, it has to do with revised syntax and you should change the flags
> of camlp4 (but it believe camlp4o loads the classic syntax, so it might be a
> bug as well).

No, it gives me another error:
"""
ocamlopt -pp "camlp4o pa_op.cmo" -I src                      -c src/common.ml
File "src/common.ml", line 5, characters 0-3:
Parse error: illegal begin of implem
Preprocessor error
"""

Yours,
d.


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

* Re: [Caml-list] Issue to compile a program with camlp4 in OCaml 3.10.0
  2008-09-23  8:08 ` Сергей Плаксин
@ 2008-09-23 16:29   ` David MENTRE
  2008-09-24  6:56   ` Michel Mauny
  1 sibling, 0 replies; 8+ messages in thread
From: David MENTRE @ 2008-09-23 16:29 UTC (permalink / raw)
  To: Сергей
	Плаксин
  Cc: caml-list

Hello Сергей,

On Tue, Sep 23, 2008 at 10:08, Сергей Плаксин <serp@stork.ru> wrote:
>> Here is the beginning of the relevant file:
>> """
>> (** Common utility functions. *)
>>
>> (* space *)
>>
>> let heap_size () : float = float_of_int (Gc.stat ()).Gc.heap_words *. float_of_int (Sys.word_size / 8)  (* in bytes *)
>
> This code successfuly compiled on my ocaml 3.10.2 without any
> "pa_op.cmo",

Could you compile it with 'ocamlopt -pp "camlp4o pa_op.cmo"', just to
check that the error is fixed using ocaml 3.10.2?

>  what is pa_op.cmo?

I don't know.

Yours,
d.

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

* Re: [Caml-list] Issue to compile a program with camlp4 in OCaml 3.10.0
  2008-09-23 10:18 ` Richard Jones
@ 2008-09-23 16:31   ` David MENTRE
  0 siblings, 0 replies; 8+ messages in thread
From: David MENTRE @ 2008-09-23 16:31 UTC (permalink / raw)
  To: Richard Jones; +Cc: caml-list

Hello Richard,

On Tue, Sep 23, 2008 at 12:18, Richard Jones <rich@annexia.org> wrote:
> Best to upgrade if you can.

That's the answer I feared. ;-) As next Ubuntu should be released in a
few weeks and has OCaml 3.10.2, I'll give it a try.

Yours,
d.


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

* Re: [Caml-list] Issue to compile a program with camlp4 in OCaml 3.10.0
  2008-09-23  8:08 ` Сергей Плаксин
  2008-09-23 16:29   ` David MENTRE
@ 2008-09-24  6:56   ` Michel Mauny
  1 sibling, 0 replies; 8+ messages in thread
From: Michel Mauny @ 2008-09-24  6:56 UTC (permalink / raw)
  To: Сергей
	Плаксин
  Cc: David MENTRE, caml-list

[-- Attachment #1: Type: text/plain, Size: 275 bytes --]

Hi,

2008/9/23 Сергей Плаксин <serp@stork.ru>

>
> what is pa_op.cmo?


It's a CamlP4 parser for the extension of ocaml classical syntax  with
streams parsers. Decoding proceeds as follows:

  "pa_" stands for parser, "o" for ocaml syntax, and "p" for stream parsers.

-- MM

[-- Attachment #2: Type: text/html, Size: 647 bytes --]

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

end of thread, other threads:[~2008-09-24  6:56 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-22 20:41 Issue to compile a program with camlp4 in OCaml 3.10.0 David MENTRE
2008-09-23  6:53 ` [Caml-list] " Gabriel Kerneis
2008-09-23 16:22   ` David MENTRE
2008-09-23  8:08 ` Сергей Плаксин
2008-09-23 16:29   ` David MENTRE
2008-09-24  6:56   ` Michel Mauny
2008-09-23 10:18 ` Richard Jones
2008-09-23 16:31   ` David MENTRE

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