caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Erick Matsen <matsen@berkeley.edu>
To: Markus Mottl <markus.mottl@gmail.com>
Cc: "Stéphane Glondu" <steph@glondu.net>, caml-list@inria.fr
Subject: RESOLVED: problem with LACAML and static linking
Date: Thu, 29 Jan 2009 10:51:21 -0800	[thread overview]
Message-ID: <243054520901291051o45c9120er88b10e1a9f5fe90c@mail.gmail.com> (raw)

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


                 reply	other threads:[~2009-01-29 18:51 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=243054520901291051o45c9120er88b10e1a9f5fe90c@mail.gmail.com \
    --to=matsen@berkeley.edu \
    --cc=caml-list@inria.fr \
    --cc=markus.mottl@gmail.com \
    --cc=steph@glondu.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).