From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 8427C7EE25 for ; Tue, 19 Nov 2013 23:57:16 +0100 (CET) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of mike.mcclurg@gmail.com) identity=pra; client-ip=209.85.212.172; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="mike.mcclurg@gmail.com"; x-sender="mike.mcclurg@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of mike.mcclurg@gmail.com designates 209.85.212.172 as permitted sender) identity=mailfrom; client-ip=209.85.212.172; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="mike.mcclurg@gmail.com"; x-sender="mike.mcclurg@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-wi0-f172.google.com) identity=helo; client-ip=209.85.212.172; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="mike.mcclurg@gmail.com"; x-sender="postmaster@mail-wi0-f172.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjwEAJnri1LRVdSslGdsb2JhbABZgz9TtnOJZQgWDgEBAQEHCwsJEiqCUxkBGx4DEhBdAREBBQGIIwEDD587gwSMV4MJhCUKGScNZIgHAQUMlAQDiUKOUIEvjnIYKYRzHA X-IPAS-Result: AjwEAJnri1LRVdSslGdsb2JhbABZgz9TtnOJZQgWDgEBAQEHCwsJEiqCUxkBGx4DEhBdAREBBQGIIwEDD587gwSMV4MJhCUKGScNZIgHAQUMlAQDiUKOUIEvjnIYKYRzHA X-IronPort-AV: E=Sophos;i="4.93,732,1378850400"; d="scan'208";a="36580329" Received: from mail-wi0-f172.google.com ([209.85.212.172]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 19 Nov 2013 23:57:15 +0100 Received: by mail-wi0-f172.google.com with SMTP id en1so4376176wid.17 for ; Tue, 19 Nov 2013 14:57:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=33wDM8W+X/w5uD+3tHFLFryGQ3qvZKNI1VYizTNtQGg=; b=KORF+pqHZH5QsalHswlZFXVgzPex3zpNjNVOm6Ron6NB6lM+dswGIhpfV22Lq0cOJ0 QmPsKGP4Lsd8nVMwY2jdMGVastJbIdwQVc1/NrKFyM3acxD87qayDSExCSW0cod05uSL YdRnchHKwrnMRvdbTqZ+GzSXn0fFDswdBBRrf8jtE3b3HgN6ARmUIDCcctqv9cgGLqb4 UQmipVATmP4NzBn+DFp45LV6yzxIJpvgMQQmJR7ztCFHwggSP3VVe5gOH9Oh+pvC5HAY N6TQ3YVxDwUPMTHyxw7ygSWuZahnUdwun2vxrL7o/RT0sKOaQQ8ImyQ10uJVR3g9wLa9 wqTg== MIME-Version: 1.0 X-Received: by 10.180.77.49 with SMTP id p17mr4332358wiw.30.1384901835276; Tue, 19 Nov 2013 14:57:15 -0800 (PST) Received: by 10.216.77.196 with HTTP; Tue, 19 Nov 2013 14:57:15 -0800 (PST) Date: Tue, 19 Nov 2013 15:57:15 -0700 Message-ID: From: Mike McClurg To: caml-list@inria.fr Content-Type: multipart/alternative; boundary=f46d04389213f0c97a04eb8f9526 Subject: [Caml-list] ctypes with -thread: inconsistent assumptions over implementation Foreign --f46d04389213f0c97a04eb8f9526 Content-Type: text/plain; charset=ISO-8859-1 Hi list, I'm running into a strange issue when compiling a ctypes (0.2.1) library with the -thread option. Here is my test program: open Ctypes open PosixTypes open Foreign let time = foreign "time" (ptr time_t @-> returning time_t) let _ = ignore (time (from_voidp time_t null)) This is the simplest example I could find from the ctypes tutorial. When I compile it without -threaded, it works: $ ocamlfind ocamlopt -verbose -package ctypes,ctypes.foreign -linkpkg -o test test.ml Effective set of compiler predicates: pkg_unix,pkg_bigarray,pkg_ctypes,pkg_ctypes.foreign-base,pkg_ctypes.foreign,autolink,native + ocamlopt.opt -verbose -o test -I /Users/mike/.opam/system/lib/ctypes /usr/local/lib/ocaml/unix.cmxa /usr/local/lib/ocaml/bigarray.cmxa /Users/mike/.opam/system/lib/ctypes/ctypes.cmxa /Users/mike/.opam/system/lib/ctypes/ctypes-foreign-base.cmxa /Users/mike/.opam/system/lib/ctypes/ctypes-foreign-unthreaded.cmxa test.ml + clang -arch x86_64 -c -o 'test.o' '/var/folders/56/7m5w0d2s31l99sh6jw_53_900000gn/T/camlasmeaa663.s' + clang -arch x86_64 -c -o '/var/folders/56/7m5w0d2s31l99sh6jw_53_900000gn/T/camlstartup56e173.o' '/var/folders/56/7m5w0d2s31l99sh6jw_53_900000gn/T/camlstartup78207e.s' + cc -Wl,-no_compact_unwind -o 'test' '-L/Users/mike/.opam/system/lib/ctypes' '-L/usr/local/lib/ocaml' '/var/folders/56/7m5w0d2s31l99sh6jw_53_900000gn/T/camlstartup56e173.o' '/usr/local/lib/ocaml/std_exit.o' 'test.o' '/Users/mike/.opam/system/lib/ctypes/ctypes-foreign-unthreaded.a' '/Users/mike/.opam/system/lib/ctypes/ctypes-foreign-base.a' '/Users/mike/.opam/system/lib/ctypes/ctypes.a' '/usr/local/lib/ocaml/bigarray.a' '/usr/local/lib/ocaml/unix.a' '/usr/local/lib/ocaml/stdlib.a' '-L/usr/local/Cellar/libffi/3.0.13/lib' '-lffi' '-lctypes-foreign-base_stubs' '-L/usr/local/Cellar/libffi/3.0.13/lib' '-lffi' '-lctypes_stubs' '-lbigarray' '-lunix' '/usr/local/lib/ocaml/libasmrun.a' But when I use the -thread option: $ ocamlfind ocamlopt -verbose -package ctypes,ctypes.foreign -linkpkg -thread -o test test.ml Effective set of compiler predicates: pkg_unix,pkg_threads.posix,pkg_threads,pkg_bigarray,pkg_ctypes,pkg_ctypes.foreign-base,pkg_ctypes.foreign,autolink,mt,mt_posix,native + ocamlopt.opt -verbose -o test -thread -I /Users/mike/.opam/system/lib/ctypes /usr/local/lib/ocaml/unix.cmxa /usr/local/lib/ocaml/threads/threads.cmxa /usr/local/lib/ocaml/bigarray.cmxa /Users/mike/.opam/system/lib/ctypes/ctypes.cmxa /Users/mike/.opam/system/lib/ctypes/ctypes-foreign-base.cmxa /Users/mike/.opam/system/lib/ctypes/ctypes-foreign-threaded.cmxa test.ml + clang -arch x86_64 -c -o 'test.o' '/var/folders/56/7m5w0d2s31l99sh6jw_53_900000gn/T/camlasmd75109.s' File "test.ml", line 1: Error: Files test.cmx and /Users/mike/.opam/system/lib/ctypes/ctypes-foreign-threaded.cmxa make inconsistent assumptions over implementation Foreign I've deleted all the cmx/cmi/o files and rerun the above command, but I still get this error. Here I'm using ctypes 0.2.1 from opam on OSX, but this also fails for me with a ctypes 0.2.1 rpm I built in a CentOS 6.4 environment. Am I doing something wrong here? Or is something wrong with the way ctypes is built and packaged? Mike --f46d04389213f0c97a04eb8f9526 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hi list,

I'm running into a str= ange issue when compiling a ctypes (0.2.1) library with the -thread option.= Here is my test program:

=A0=A0=A0 open Ctypes
=A0=A0=A0 open Po= sixTypes
=A0=A0=A0 open Foreign

=A0=A0=A0 let time =3D foreign "time&quo= t; (ptr time_t @-> returning time_t)

=A0=A0=A0 let _ =3D ignore (= time (from_voidp time_t null))

This is the simplest examp= le I could find from the ctypes tutorial. When I compile it without -thread= ed, it works:

$ ocamlfind ocamlopt -verbose -package ctypes,ctypes.foreign -linkpkg -= o test test.ml
Effective set of compiler = predicates: pkg_unix,pkg_bigarray,pkg_ctypes,pkg_ctypes.foreign-base,pkg_ct= ypes.foreign,autolink,native
+ ocamlopt.opt -verbose -o test -I /Users/mike/.opam/system/lib/ctypes /usr= /local/lib/ocaml/unix.cmxa /usr/local/lib/ocaml/bigarray.cmxa /Users/mike/.= opam/system/lib/ctypes/ctypes.cmxa /Users/mike/.opam/system/lib/ctypes/ctyp= es-foreign-base.cmxa /Users/mike/.opam/system/lib/ctypes/ctypes-foreign-unt= hreaded.cmxa test.ml
+ clang -arch x86_64 -c -o 'test.o' '/var/folders/56/7m5w0d2s31= l99sh6jw_53_900000gn/T/camlasmeaa663.s'
+ clang -arch x86_64 -c -o &= #39;/var/folders/56/7m5w0d2s31l99sh6jw_53_900000gn/T/camlstartup56e173.o= 9; '/var/folders/56/7m5w0d2s31l99sh6jw_53_900000gn/T/camlstartup78207e.= s'
+ cc -Wl,-no_compact_unwind -o 'test'=A0=A0 '-L/Users/mike/.opa= m/system/lib/ctypes' '-L/usr/local/lib/ocaml'=A0 '/var/fold= ers/56/7m5w0d2s31l99sh6jw_53_900000gn/T/camlstartup56e173.o' '/usr/= local/lib/ocaml/std_exit.o' 'test.o' '/Users/mike/.opam/sys= tem/lib/ctypes/ctypes-foreign-unthreaded.a' '/Users/mike/.opam/syst= em/lib/ctypes/ctypes-foreign-base.a' '/Users/mike/.opam/system/lib/= ctypes/ctypes.a' '/usr/local/lib/ocaml/bigarray.a' '/usr/lo= cal/lib/ocaml/unix.a' '/usr/local/lib/ocaml/stdlib.a' '-L/u= sr/local/Cellar/libffi/3.0.13/lib' '-lffi' '-lctypes-foreig= n-base_stubs' '-L/usr/local/Cellar/libffi/3.0.13/lib' '-lff= i' '-lctypes_stubs' '-lbigarray' '-lunix' '= /usr/local/lib/ocaml/libasmrun.a'

But when I use the -thread option:

$ ocaml= find ocamlopt -verbose -package ctypes,ctypes.foreign -linkpkg -thread -o t= est test.ml
Effective set of compiler pre= dicates: pkg_unix,pkg_threads.posix,pkg_threads,pkg_bigarray,pkg_ctypes,pkg= _ctypes.foreign-base,pkg_ctypes.foreign,autolink,mt,mt_posix,native
+ ocamlopt.opt -verbose -o test -thread -I /Users/mike/.opam/system/lib/cty= pes /usr/local/lib/ocaml/unix.cmxa /usr/local/lib/ocaml/threads/threads.cmx= a /usr/local/lib/ocaml/bigarray.cmxa /Users/mike/.opam/system/lib/ctypes/ct= ypes.cmxa /Users/mike/.opam/system/lib/ctypes/ctypes-foreign-base.cmxa /Use= rs/mike/.opam/system/lib/ctypes/ctypes-foreign-threaded.cmxa test.ml
+ clang -arch x86_64 -c -o 'test.o' '/var/folders/56/7m5w0d2s31= l99sh6jw_53_900000gn/T/camlasmd75109.s'
File "test.ml", line 1:
Error: Files test.cmx
=A0=A0=A0= =A0=A0=A0 and /Users/mike/.opam/system/lib/ctypes/ctypes-foreign-threaded.c= mxa
=A0=A0=A0=A0=A0=A0 make inconsistent assumptions over implementation Foreig= n

I've deleted all the cmx/cmi/o files and rerun the = above command, but I still get this error. Here I'm using ctypes 0.2.1 = from opam on OSX, but this also fails for me with a ctypes 0.2.1 rpm I buil= t in a CentOS 6.4 environment.

Am I doing something wrong here? Or is something wrong with = the way ctypes is built and packaged?

Mike
--f46d04389213f0c97a04eb8f9526--