Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
problem with LACAML and static linking
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Erick Matsen <matsen@b...>
Subject: Re: [Caml-list] problem with LACAML and static linking
Hello Stephane (and the rest of the ocaml community)---

Thank you for your input here.

I do have libgfortran.a, but I might note that it's in
/usr/lib/gcc/i486-linux-gnu/4.3/ rather than /usr/lib. This is in contrast to
liblapack.a, etc, which just live in /usr/lib. This makes me wonder if this is
somehow the problem.

I did try (naievely!) copying libgfortran.a over to /usr/lib. I also added
/usr/lib/gcc/i486-linux-gnu/4.3/ to my list of directories. No luck yet. Also

$ ldd /usr/lib/ =>  (0xffffe000) => /usr/lib/ (0xb775d000) => /usr/lib/ (0xb76ab000) => /lib/i686/cmov/ (0xb7684000) => /lib/ (0xb7677000) => /lib/i686/cmov/ (0xb751c000)
	/lib/ (0x80000000)

$ locate linux-gate.a
$ locate libblas.a
$ locate libgfortran.a
$ locate libm.a
$ locate libgcc_s.a
$ locate libc.a

So everything there seems to be OK. Also

# ldd /usr/lib/gcc/i486-linux-gnu/4.3/ =>  (0xffffe000) => /lib/i686/cmov/ (0xb7ed9000) => /lib/i686/cmov/ (0xb7d7e000)
	/lib/ (0x80000000)

Here is my compile line

ocamlopt \

# source directories:
    -I /home/matsen/ocaml/bio/ -I /home/matsen/ocaml/common/  -I
/usr/lib/ocaml/3.10.2/pcre/ -I /usr/lib/ocaml/3.10.2/glpk/ -I
/usr/lib/ocaml/3.10.2/gsl/ -I /usr/lib/ocaml/3.10.2/lacaml/ -I
/usr/lib/gcc/i486-linux-gnu/4.3/ \

# cc directives
    -ccopt -static  -ccopt -lgfortran    -ccopt
-L/home/matsen/ocaml/bio/ -ccopt -L/home/matsen/ocaml/common/ -ccopt
-L/usr/lib/ocaml/3.10.2/pcre/ -ccopt -L/usr/lib/ocaml/3.10.2/glpk/
-ccopt -L/usr/lib/ocaml/3.10.2/gsl/ -ccopt
-L/usr/lib/ocaml/3.10.2/lacaml/ -ccopt
-L/usr/lib/gcc/i486-linux-gnu/4.3/    pcre.cmxa bigarray.cmxa
unix.cmxa gsl.cmxa lacaml.cmxa   -o placer \

# my code
/home/matsen/ocaml/bio/biobase.cmx base.cmx minimization.cmx
integration.cmx /home/matsen/ocaml/bio/liketree.cmx liketreeFuns.cmx
/home/matsen/ocaml/common/number.cmx /home/matsen/ocaml/common/mat.cmx
/home/matsen/ocaml/bio/diagd.cmx /home/matsen/ocaml/bio/qtree.cmx
/home/matsen/ocaml/bio/alignmentLike.cmx placerFuns.cmx placer.cmx

Thank you again for your help. If we can get this running, I'll
definitely acknowledge your help in our paper, which is in the long
run about understanding the distribution of phytoplankton in the ocean
and ramifications for carbon cycling (very relevant for climate