<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE message PUBLIC
  "-//MLarc//DTD MLarc output files//EN"
  "../../mlarc.dtd"[
  <!ATTLIST message
    listname CDATA #REQUIRED
    title CDATA #REQUIRED
  >
]>

  <?xml-stylesheet href="../../mlarc.xsl" type="text/xsl"?>


<message 
  url="2005/05/725ad833bf2d3b144a9847221542e80d"
  from="Lars Schouw &lt;schouwla@y...&gt;"
  author="Lars Schouw"
  date="2005-05-18T10:04:55"
  subject="using gsl library...."
  prev="2005/05/57a93b75afa283d5253a4b19199a197b"
  next="2005/05/ea2188ebdcfcb2c153d6fa92a75855b7"
  next-in-thread="2005/05/ea2188ebdcfcb2c153d6fa92a75855b7"
  prev-thread="2005/05/57a93b75afa283d5253a4b19199a197b"
  next-thread="2005/05/1fafad7f0c1581c0398bc91c183d7000"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="using gsl library....">
<msg 
  url="2005/05/725ad833bf2d3b144a9847221542e80d"
  from="Lars Schouw &lt;schouwla@y...&gt;"
  author="Lars Schouw"
  date="2005-05-18T10:04:55"
  subject="using gsl library....">
<msg 
  url="2005/05/ea2188ebdcfcb2c153d6fa92a75855b7"
  from="James E. Scott &lt;james.scott@l...&gt;"
  author="James E. Scott"
  date="2005-05-18T13:32:38"
  subject="Re: [Caml-list] using gsl library....">
</msg>
</msg>
</thread>

<contents>
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&gt;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
&gt; Then I compiled your second example with:
&gt;
&gt; $ ocamlopt -cclib -lgsl -I +gsl gsl.cmxa test.ml -o
test
and ran it with:
&gt; &gt;
&gt; &gt; $ ./test
&gt; &gt; # gaussian with sigma=3
&gt; &gt; +0.9986501
&gt; &gt; +0.9986501
&gt; &gt; +0.9986501
&gt; &gt; +0.9986501
&gt; &gt; +0.9986501
&gt; &gt; +0.9986501
&gt; &gt; +0.9986501
&gt; &gt; +0.9986501
&gt; &gt; +0.9986501
&gt; &gt; +0.9986501

BTW3: If I try this I get an unbound module error
C:\ocaml\gsl\ocamlgsl-0.4.0\examples&gt;ocamlopt -cclib
-lgsl -I +gsl
&gt; gsl.cmxa bs.ml -i bs
&gt; File "bs.ml", line 2, characters 0-12:
&gt; Unbound module Gsl_fun


		
__________________________________ 
Yahoo! Mail Mobile 
Take Yahoo! Mail with you! Check email on your mobile phone. 
http://mobile.yahoo.com/learn/mail 

</contents>

</message>

