Re: [Caml-list] Compiling OCaml under OS X 10.6

2009-09-08 Thread John Whitington

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

___
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


Re: [Caml-list] ocamlfind and GODI packaging sprint this Wednesday, 9/9

2009-09-08 Thread Cedric Auger

Cedric Auger a écrit :

Hezekiah M. Carty a écrit :

For any who are interested:

There will be an informal GODI packaging sprint for OCaml libraries
this Wednesday, 9/9, with coordination taking place via IRC (#ocaml on
Freenode).  Some information (documentation, ideas for libraries to
package) is available here:

http://ocamlsprint.couch.it/ocamlfind_and_GODI_packaging

The site is a wiki, so please feel free to add links to packaging
documentation, ideas for libraries to package or other relevant
information.

Everyone is welcome!  The plan is to continue the packaging efforts
throughout the day.  If you are interested, please drop by for as long
or short a time as you like.

Many thanks to bluestorm for suggesting and initiating this effort!

Hez

___
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
  
For cairo-ocaml, take a look at http://www.lri.fr/~cauger; there is 
also a package for bitstring and one for mlpost (the latter is partly 
developped by JC Filiâtre).


I didn't contacted the teams for bitstring and cairo, so I can't 
guarantee to maintain them.


I already tried to contact the GODI team as I have no account for the 
svn, but have no response yet.



Sorry, I used reply instead of reply all

--
Cédric AUGER

Univ Paris-Sud, Laboratoire LRI, UMR 8623, F-91405, Orsay

___
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


Re: [Caml-list] ocamlfind and GODI packaging sprint this Wednesday, 9/9

2009-09-08 Thread Hezekiah M. Carty
On Tue, Sep 8, 2009 at 7:55 AM, Cedric Augercedric.au...@lri.fr wrote:

 Hezekiah M. Carty a écrit :
 There will be an informal GODI packaging sprint for OCaml libraries
 this Wednesday, 9/9, with coordination taking place via IRC (#ocaml on
 Freenode).  Some information (documentation, ideas for libraries to
 package) is available here:

 http://ocamlsprint.couch.it/ocamlfind_and_GODI_packaging

 For cairo-ocaml, take a look at http://www.lri.fr/~cauger; there is also a
 package for bitstring and one for mlpost (the latter is partly developped by
 JC Filiâtre).

Thank you for the information and link!  Those packages will be
helpful for the libraries themselves and as examples.

Hez

-- 
Hezekiah M. Carty
Graduate Research Assistant
University of Maryland
Department of Atmospheric and Oceanic Science

___
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


[Caml-list] threads

2009-09-08 Thread ygrek
Hello,

 let x = Array.make 100 []
 let update i n = x.(i) - n :: x.(i)
 let read i = x.(i)

 Consider the following scenario: one thread is `update`ing x, another
thread(s) uses only `read`. Is it safe to use these functions without
locking on mutex? 

 I.e. is Array.set atomic? What about updating references (:=) ?

 If I understand correctly these operations require only one cpu
instruction to update one machine word and so should be atomic. Taking
into account single-cpu affinity of ocaml program it should be safe
to write such multithreaded code. Is it true?

 Is it safe to assume that ocamlopt won't skip reads/writes to globally
visible memory address using cached value in a register?

-- 
 ygrek
 http://ygrek.org.ua


pgpGe5pvVMje9.pgp
Description: PGP signature
___
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


Re: [Caml-list] threads

2009-09-08 Thread Philippe Wang
Hi,

  let x = Array.make 100 []
  let update i n = x.(i) - n :: x.(i)
  let read i = x.(i)

I don't think you can obtain funny results when you don't put a mutex
on these two specific update and read.
What is sure is that update function is not atomic because you have
a value allocation at the right of - (with :: operator), and this
may trigger garbage collection and/or make the scheduler change the
running thread.

What you can be sure with the current official OCaml distribution is
that there won't be at the exact same time both an (-)operation and a
(.())operation.
But it is actually possible, for instance, for a thread to compute
while another one is simultaneously writing on a socket. So it is
generally not a good idea to count on some operation atomicity to put
or not a mutex lock (well it's good to write some hard-to-debug
code)...

Cheers,

Philippe Wang


On Tue, Sep 8, 2009 at 7:33 PM, ygrek ygrekhere...@gmail.com wrote:
 Hello,

  let x = Array.make 100 []
  let update i n = x.(i) - n :: x.(i)
  let read i = x.(i)

  Consider the following scenario: one thread is `update`ing x, another
 thread(s) uses only `read`. Is it safe to use these functions without
 locking on mutex?

  I.e. is Array.set atomic? What about updating references (:=) ?

  If I understand correctly these operations require only one cpu
 instruction to update one machine word and so should be atomic. Taking
 into account single-cpu affinity of ocaml program it should be safe
 to write such multithreaded code. Is it true?

  Is it safe to assume that ocamlopt won't skip reads/writes to globally
 visible memory address using cached value in a register?

 --
  ygrek
  http://ygrek.org.ua

 ___
 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





-- 
Philippe Wang
   m...@philippewang.info

___
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


[Caml-list] probability of some events

2009-09-08 Thread Rakotomandimby Mihamina

Hi,

1°) A bit of history before the question.

Some of my collegues are running Python at the moment.

Python has decided to improve some things, and there is a two step 
improve coming:

 - Python 2.6
 - Python 3

Both of them introduce syntax incompatibility, especially 2.6 on 
exceptions (which is a kind of handicap).


They run Debian Lenny, stuck with Python 2.5 and I run Ubuntu with 
Python 2.6. I should have developped for them.


2°) Now the question

Are you aware of such future changes in OCaml, that would lead to 
incompatibility?


We intend to begin huge developments in OCaml (Web, GUI, system,...)
and such changes will make our task a bit more difficult.

Thank you.

--
  Architecte Informatique chez Blueline/Gulfsat:
   Administration Systeme, Recherche  Developpement
   +261 34 29 155 34

___
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