caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Compiling OCaml under OS X 10.6
@ 2009-09-01 16:32 John Whitington
  2009-09-02 16:12 ` [Caml-list] " Markus Mottl
  2009-09-03  2:28 ` Andres Varon
  0 siblings, 2 replies; 4+ messages in thread
From: John Whitington @ 2009-09-01 16:32 UTC (permalink / raw)
  To: caml-list

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  
give:

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  
i686-apple-darwin10-gcc-4.2.1.

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?

Cheers,

-- 
John Whitington
Coherent Graphics Ltd
http://www.coherentpdf.com/


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

* Re: [Caml-list] Compiling OCaml under OS X 10.6
  2009-09-01 16:32 Compiling OCaml under OS X 10.6 John Whitington
@ 2009-09-02 16:12 ` Markus Mottl
  2009-09-03  2:28 ` Andres Varon
  1 sibling, 0 replies; 4+ messages in thread
From: Markus Mottl @ 2009-09-02 16:12 UTC (permalink / raw)
  To: John Whitington; +Cc: caml-list

On Tue, Sep 1, 2009 at 12:32, John
Whitington<john@coherentgraphics.co.uk> wrote:
> Has anyone managed this? Bytecode seems fine, native not so.

I haven't compiled it under 10.6, but FWIW my 64bit Godi installation
of OCaml kept working just fine after the upgrade.

Regards,
Markus

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


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

* Re: [Caml-list] Compiling OCaml under OS X 10.6
  2009-09-01 16:32 Compiling OCaml under OS X 10.6 John Whitington
  2009-09-02 16:12 ` [Caml-list] " Markus Mottl
@ 2009-09-03  2:28 ` Andres Varon
  2009-09-08 12:25   ` John Whitington
  1 sibling, 1 reply; 4+ messages in thread
From: Andres Varon @ 2009-09-03  2:28 UTC (permalink / raw)
  To: John Whitington; +Cc: OCaml Mailing List

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


On Sep 1, 2009, at 12:32 PM, John Whitington wrote:

> 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 give:
>
> 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 i686-apple-darwin10-gcc-4.2.1.
>
> 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


I just installed Snow Leopard in my laptop and the x86_64 ocaml  
appears to work fine. I noticed that in your configure log the gcc  
compiler is still listed at the end as 'gcc', while in mine it is 'gcc  
-m64'. Perhaps you need to cleanup with 'make distclean'  and  
reconfigure before compiling the x86_64 target?


>
> 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?


Previous versions of gcc in Mac OS X allowed you to pass the -mmacosx- 
version-min=10.4 option to target the minimum API that you wanted to  
support. I suppose this still works with the gcc 4.2.1 included in  
XCode 3.2, but haven't tried it yet.

Andres

>
> Cheers,
>
> -- 
> John Whitington
> Coherent Graphics Ltd
> http://www.coherentpdf.com/
>
> _______________________________________________
> Caml-list mailing list. Subscription management:
> http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
> Archives: http://caml.inria.fr
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs


[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 2415 bytes --]

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

* Re: [Caml-list] Compiling OCaml under OS X 10.6
  2009-09-03  2:28 ` Andres Varon
@ 2009-09-08 12:25   ` John Whitington
  0 siblings, 0 replies; 4+ messages in thread
From: John Whitington @ 2009-09-08 12:25 UTC (permalink / raw)
  To: OCaml Mailing List

Hi.

On 3 Sep 2009, at 03:28, Andres Varon wrote:
> On Sep 1, 2009, at 12:32 PM, John Whitington wrote:
>
>> 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 give:
>>
>> 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 i686-apple-darwin10-gcc-4.2.1.
>>
>> 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
>
>
> I just installed Snow Leopard in my laptop and the x86_64 ocaml  
> appears to work fine. I noticed that in your configure log the gcc  
> compiler is still listed at the end as 'gcc', while in mine it is  
> 'gcc -m64'. Perhaps you need to cleanup with 'make distclean'  and  
> reconfigure before compiling the x86_64 target?

It turned out these errors were spurious - I nuked the machine and  
installed 10.6 clean, and it was fine. However, 3.11.1 seems to have a  
bug 3.11.0 doesn't, which I've reported here:

http://caml.inria.fr/mantis/view.php?id=4860

Also, the 3.11.1 intel .dmg from the OCaml website doesn't work, which  
I've reported here:

http://caml.inria.fr/mantis/view.php?id=4861

Thanks to Andres and Markus for their help. It's taken 3 days in total  
to deal with all the ocaml and non-ocaml issues with Snow Leopard -  
time I got back to some work now :-) And next time a new OS X comes  
out, I'll buy a copy and put it on the shelf for a few months!

Cheers,

John


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

end of thread, other threads:[~2009-09-08 12:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-01 16:32 Compiling OCaml under OS X 10.6 John Whitington
2009-09-02 16:12 ` [Caml-list] " Markus Mottl
2009-09-03  2:28 ` Andres Varon
2009-09-08 12:25   ` John Whitington

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