From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id EFB89BCAB for ; Wed, 18 May 2005 15:32:37 +0200 (CEST) Received: from cujo.runbox.com (aibo.runbox.com [193.71.199.94]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j4IDWbqS005576 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Wed, 18 May 2005 15:32:37 +0200 Received: from [10.9.9.110] (helo=snoopy.runbox.com) by greyhound.runbox.com with esmtp (Exim 4.34) id 1DYOf7-00062A-3M; Wed, 18 May 2005 15:32:37 +0200 Received: from [62.203.90.76] (helo=[62.203.90.76]) by snoopy.runbox.com with asmtp (uid:160313) (Exim 4.34) id 1DYOf6-0001kQ-68; Wed, 18 May 2005 15:32:36 +0200 Message-ID: <428B43CB.2070201@lexifi.com> Date: Wed, 18 May 2005 15:31:55 +0200 From: "James E. Scott" User-Agent: Mozilla Thunderbird 0.9 (X11/20041124) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Lars Schouw , caml-list@yquem.inria.fr Subject: Re: [Caml-list] using gsl library.... References: <20050518100453.1527.qmail@web50305.mail.yahoo.com> In-Reply-To: <20050518100453.1527.qmail@web50305.mail.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Sender: 160313 X-Miltered: at concorde with ID 428B43F5.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; lexifi:01 caml-list:01 gsl:01 ocaml:01 gsl:01 ocamlopt:01 bigarray:01 cmxa:01 cmxa:01 -cclib:01 lib:01 camlprog:01 gaussian:01 ocaml:01 ocamlopt:01 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.2 X-Spam-Level: Hi Lars, it depends on how exactly you've installed it, but the following works here (on an MSVC build of both ocaml and GSL) $ ocamlopt bigarray.cmxa -I +gsl gsl.cmxa bs.ml -cclib gsl.lib $ ./camlprog.exe # gaussian with sigma=3 +0.9986501 +0.9986501 +0.9986501 +0.9986501 +0.9986501 +0.9986501 +0.9986501 +0.9986501 +0.9986501 +0.9986501 If gsl.cmxa is in ".." you should have: C:\ocaml\gsl\ocamlgsl-0.4.0\examples>ocamlopt -cclib gsl.lib -I .. bigarray.cmxa gsl.cmxa bs.ml James Lars Schouw wrote: >This is newbii !!! > >We are trying to use the ocmlgsl library. > >we are trying to call the ugaussian_P function >belonging to Gsl_cdf. > >This works: > >open Gsl_fun;; > >let _ = >Gsl_error.init () ; >Gsl_rng.env_setup () > >let rng = Gsl_rng.make (Gsl_rng.default ()) > >let sigma = 3. > >let _ = >Printf.printf "# gaussian with sigma=%g\n" sigma ; >for i=1 to 10 do >let x = Gsl_randist.gaussian rng 3. in >Printf.printf "%+.7f\n" x >done > > >This does not compile: >let _ = >Gsl_error.init () ; >Gsl_rng.env_setup () > >let rng = Gsl_rng.make (Gsl_rng.default ()) > >let sigma = 3. > >let _ = >Printf.printf "# gaussian with sigma=%g\n" sigma ; >for i=1 to 10 do >let x = Gsl_cdf.ugaussian_P 3. in > >Printf.printf "%+.7f\n" x >done > >C:\ocaml\gsl\ocamlgsl-0.4.0\examples>ocamlopt -cclib >gsl.lib -I .. >bigarray.cmxa >..\gsl.cmxa bs.ml >File "bs.ml", line 23, characters 12-31: >Unbound value Gsl_cdf.ugaussian_P > >Do you have any ideas what I do wrong? > >I am using my own Windows 1.6 build of GSL that I >build yesterday. > >Regards >Lars Schouw > >BTW. I asked this on the ocaml_beginners mailing list >and they told me this is to Windows specific. > >BTW2: From the ocaml_beginner mailing list >It works on Debian if you do >/usr/lib# ln -s libgsl.so.0 libgsl.so >/usr/lib# ln -s libgslcblas.so.0 libgslcblas.so >/usr/lib# ldconfig > > >>Then I compiled your second example with: >> >>$ ocamlopt -cclib -lgsl -I +gsl gsl.cmxa test.ml -o >> >> >test >and ran it with: > > >>>$ ./test >>># gaussian with sigma=3 >>>+0.9986501 >>>+0.9986501 >>>+0.9986501 >>>+0.9986501 >>>+0.9986501 >>>+0.9986501 >>>+0.9986501 >>>+0.9986501 >>>+0.9986501 >>>+0.9986501 >>> >>> > >BTW3: If I try this I get an unbound module error >C:\ocaml\gsl\ocamlgsl-0.4.0\examples>ocamlopt -cclib >-lgsl -I +gsl > > >>gsl.cmxa bs.ml -i bs >>File "bs.ml", line 2, characters 0-12: >>Unbound module Gsl_fun >> >> > > > >__________________________________ >Yahoo! Mail Mobile >Take Yahoo! Mail with you! Check email on your mobile phone. >http://mobile.yahoo.com/learn/mail > >_______________________________________________ >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 > > > >