Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Compiling for Mac OS 64 bit?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2005-10-27 (15:21)
From: Xavier Leroy <Xavier.Leroy@i...>
Subject: Re: [Caml-list] Compiling for Mac OS 64 bit?
> I've been asked to research the use of Ocaml in high-performance
> computing applications on Mac OS X. I take this to mean (a) 64-bit
> applications (the client says so) and (b) compiled applications.

As you found out, ocamlopt currently cannot generate PPC64 code.
So, it's either bytecode-only in 64-bit mode, or native code in 32-bit

A PPC64 port of ocamlopt looks reasonably simple, but that will have
to wait until a Mac G5 lands here at INRIA.

> Make opt is not so happy. One example is that the assembler balks at
> _camlPervasives__55:
>     .long    _caml_int64_ops
>     .long    1018167296
>     .long    4372995238176751616
>     .data
>     .long    2303
> because the huge number should take the .quad directive, not .long.  But
> given that the huge number is 0x3cb0000000000000, I have bad  feelings
> that this is some badly-cleared or -shifted native integer.

No, no, it's a genuine 64-bit integer constant (see the definition of
epsilon_float in stdlib/

> In fact, my
> skimming of the compiler source suggests that the  compiler doesn't do
> native 64-bit pointers and integers.

The PowerPC back-end does not, but everything else in OCaml will
gladly handle 64-bit quantities on a 64-bit architecture (e.g. Alpha,
AMD64, IA64).

- Xavier Leroy