caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* RESOLVED: problem with LACAML and static linking
@ 2009-01-29 18:51 Erick Matsen
  0 siblings, 0 replies; only message in thread
From: Erick Matsen @ 2009-01-29 18:51 UTC (permalink / raw)
  To: Markus Mottl; +Cc: Stéphane Glondu, caml-list

Thank you to Mauricio Fernandez, St\'{e}phane Glondu, and Makus Mottl
for helping me with this problem.


Review of problem:

When doing static compilation using LAPACK, encountering the following error:

/usr/lib/libblas.a(xerbla.o): In function `xerbla_':
(.text+0x0): multiple definition of `xerbla_'
/usr/lib/liblapack.a(xerbla.o):(.text+0x0): first defined here


Solution:

Copying a version of liblapack.a to my home directory and removing the
offending symbol using ar, then using -noautolink to use the local
version. I found the necessary libraries using -verbose.

[complex:~/placer/ocaml]$ cp `locate liblapack.a` .
[complex:~/placer/ocaml]$ ar t liblapack.a | grep xerbla.o
xerbla.o
[complex:~/placer/ocaml]$ ar d liblapack.a xerbla.o
[complex:~/placer/ocaml]$ ar t liblapack.a | grep xerbla.o
[complex:~/placer/ocaml]$


The compilation command:

ocamlopt \
    -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/gsl/ -I
/usr/lib/ocaml/3.10.2/lacaml/ \
    -noautolink \
    -ccopt -static \
    -cclib /usr/lib/ocaml/3.10.2/lacaml/liblacaml_stubs.a \
    -cclib /home/matsen/placer/ocaml/liblapack.a \
    -cclib /home/matsen/placer/ocaml/libblas.a \
    -cclib /usr/lib/ocaml/3.10.2/gsl/libmlgsl.a \
    -cclib /usr/lib/libgsl.a \
    -cclib /usr/lib/libgslcblas.a \
    -cclib /usr/lib/ocaml/3.10.2/libunix.a \
    -cclib /usr/lib/ocaml/3.10.2/libbigarray.a \
    -cclib /usr/lib/ocaml/3.10.2/pcre/libpcre_stubs.a \
    -cclib /usr/lib/libpcre.a \
    -cclib /usr/lib/gcc/i486-linux-gnu/4.3/libgfortran.a \
    -cclib /usr/lib/ocaml/3.10.2/libasmrun.a \
    -cclib /usr/lib/libm.a \
    -cclib /usr/lib/libdl.a \
    -cclib -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/
pcre.cmxa bigarray.cmxa unix.cmxa gsl.cmxa lacaml.cmxa   -o placer \
    /home/matsen/ocaml/common/common_base.cmx
/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/protModels.cmx
/home/matsen/ocaml/bio/alignment.cmx
/home/matsen/ocaml/bio/alignmentLike.cmx placerFuns.cmx placer.cmx


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-01-29 18:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-29 18:51 RESOLVED: problem with LACAML and static linking Erick Matsen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).