English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Compiling OCaml under OS X 10.6
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2009-09-01 (16:32)
From: John Whitington <john@c...>
Subject: Compiling OCaml under OS X 10.6
Hi Folks,

Has anyone managed this? Bytecode seems fine, native not so.

I've tried just ./configure and ./configure -cc "gcc -m64" with the  
source bzip of 3.11.1 as suggested in INSTALL. Both compile fine, but  

feast:trunk john$ ocamlopt -c a.ml
feast:trunk john$ ocamlopt -o a a.cmx
ld: warning: in libasmrun.a, file is not of required architecture
Undefined symbols:
   "_caml_ml_set_binary_mode", referenced from:
       .L139 in stdlib.a(pervasives.o)
       .L157 in stdlib.a(pervasives.o)
       _camlPervasives__102 in stdlib.a(pervasives.o)
       _camlPervasives__102 in stdlib.a(pervasives.o)
... (several hundred more lines)

This is with XCode 3.2 64-bit (from the Snow Leopard DVD), the gcc is  

lipo -info libasmrun.a gives:
input file /usr/local/lib/ocaml/libasmrun.a is not a fat file
Non-fat file: /usr/local/lib/ocaml/libasmrun.a is architecture: x86_64

One possibly-salient error from the build:
ld: warning: -read_only_relocs cannot be used with x86_64

Configure log: http://www.coherentpdf.com/configure.txt
make world.opt log: http://www.coherentpdf.com/build.txt

Another question: Can I build a version of OCaml from these sources  
which isn't 64-bit so I can build code which will run on 10.5/10.4?


John Whitington
Coherent Graphics Ltd