From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id JAA16233; Thu, 13 Mar 2003 09:59:03 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id JAA16247 for ; Thu, 13 Mar 2003 09:59:01 +0100 (MET) Received: from gwsmtp.thomson-csf.com (gwsmtp.thomson-csf.com [195.101.39.226]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h2D8x0X27063 for ; Thu, 13 Mar 2003 09:59:01 +0100 (MET) Received: from thalescan.corp.thales (200.3.2.3) by gwsmtp.thomson-csf.com (NPlex 6.5.026) id 3E64E7BF001298B0 for caml-list@inria.fr; Thu, 13 Mar 2003 10:01:19 +0100 Received: from tasplex.srv.cn.tasfr.thales ([194.151.12.2]) by thalescan with InterScan Messaging Security Suite; Thu, 13 Mar 2003 09:58:55 +0100 Received: from mes1.rm.tasfr.thales (61.14.31.2) by tasplex.srv.cn.tasfr.thales (NPlex 6.5.026) id 3E6FA2AE00001569 for caml-list@inria.fr; Thu, 13 Mar 2003 10:00:48 +0100 Received: from mes1.rm.tasfr.thales (61.14.31.2) by mes1.rm.tasfr.thales (NPlex 5.1.053) id 3E6F9FBB00000B30 for caml-list@inria.fr; Thu, 13 Mar 2003 09:57:49 +0100 Received: from 61.25.85.112 by mes1.rm.tasfr.thales (InterScan E-Mail VirusWall NT); Thu, 13 Mar 2003 09:57:49 +0100 Message-ID: <3E70480B.7CAFF86F@fr.thalesgroup.com> Date: Thu, 13 Mar 2003 09:57:47 +0100 From: francois bereux X-Mailer: Mozilla 4.75 [fr]C-CCK-MCD (WinNT; U) X-Accept-Language: fr-FR MIME-Version: 1.0 To: caml-list@inria.fr Subject: [Caml-list] how to interface with integer Bigarrays using camlidl References: <20030306232731.7374.qmail@web10305.mail.yahoo.com> <20030312185904.GB372@phaeton.entropie.net> <20030312212448.A30685@pauillac.inria.fr> Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam: no; 0.00; bereux:01 thalesgroup:01 bigarrays:01 bug:01 libs:01 -include:01 32,:01 elt:01 stub:01 floats:01 idl:01 bigarray:01 camlidl:01 int:01 makefile:02 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hello, I posted this question on the beginner list, but I got no answer. I do not manage to interface a 1D Bigarray of integers with C code, using= camlidl. Here is an example : ----- code.c ------ void linear( int* m, int* ia ) { int i; for( i=3D0; i< *m; i++ ) { ia[i] =3D i; } } ----- bug.idl ----- void linear( [in,ref] int* m, [in,out,length_is(*m),bigarray] int ia[] );= ----- test.ml ----- open Bigarray;; open Bug;; let lin n =3D let ia =3D Array1.create int32 c_layout n in begin linear ia; ia; end;; ------ Makefile ------ SOURCES =3D code.c bug.idl test.ml LIBS =3D bigarray RESULT =3D essai -include $(OCAMLMAKEFILE) ---------------------------------------------------------- When I compile, I get the following error : File "test.ml" line 7, character 12-14 This expression has type (int32, Bigarray.int32_elt, Bigarray.c_layout) Bigarray.Array1.t but is here used with type (int, Bigarray.int32_elt, Bigarray.c_layout) Bigarray.Array1.t As far as I understand, the kind of the array in the stub code generated = by camlidl is (int,int32_elt) kind, whereas the int32 in my test.ml file defines a (int32, int32_elt) kind. Am I correct = ? And how can I modify my code so that it works ? ( I do not know how to define by myself an Array1 with (int, int32_elt) k= ind. ) If I use floats in the code, this works fine. Any help would be appreciated, Sincerely yours, F. B=E9reux ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners