[Dune] Problems with linking an external library
Bernd Flemisch
bernd at iws.uni-stuttgart.de
Mon Sep 15 20:50:38 CEST 2014
Hi Andrea,
I would put everything into LDADD instead of LDADD + LDFLAGS. I don't have a very good explanation for this, maybe you find this sufficient:
www.ttocp.blogspot.de/2011/06/ldadd-vs-ldflags.html
If this doesn't get you any further, please post the actual command that is passed to libtool / the linker.
Kind regards
Bernd
On Mon, 15 Sep 2014 17:00:41 +0000
"Sacconi, Andrea" <a.sacconi11 at imperial.ac.uk> wrote:
>Hi DUNErs,
>
>I would like to ask you a question about linking external libraries. I'm trying to link the library associated to the package LDL, which belongs to the same family UMFPACK is from.
>The library is saved as libldl.a in a convenient folder.
>Well, what I put in my Makefile.am is the following (relevant part):
>
>dune_LDLtest_SOURCES = dune_LDLtest.cc
>
>dune_LDLtest_CPPFLAGS = $(AM_CPPFLAGS) \
> $(DUNEMPICPPFLAGS) \
> $(UG_CPPFLAGS) \
> $(AMIRAMESH_CPPFLAGS) \
> $(ALBERTA_CPPFLAGS) \
> $(ALUGRID_CPPFLAGS) \
> -I/usr/local_machine/suitesparse-4.2.1/include
>
>dune_LDLtest_LDADD = \
> $(DUNE_LDFLAGS) $(DUNE_LIBS) \
> $(ALUGRID_LDFLAGS) $(ALUGRID_LIBS) \
> $(ALBERTA_LDFLAGS) $(ALBERTA_LIBS) \
> $(AMIRAMESH_LDFLAGS) $(AMIRAMESH_LIBS) \
> $(UG_LDFLAGS) $(UG_LIBS) \
> $(DUNEMPILIBS) \
> $(LDADD) \
> -L/usr/local_machine/suitesparse-4.2.1/lib
>
>dune_LDLtest_LDFLAGS = $(AM_LDFLAGS) \
> $(DUNEMPILDFLAGS) \
> $(UG_LDFLAGS) \
> $(AMIRAMESH_LDFLAGS) \
> $(ALBERTA_LDFLAGS) \
> $(ALUGRID_LDFLAGS) \
> $(DUNE_LDFLAGS) \
> -lldl -lamd -lrt -lblas -lgfortran -lm
>
>but the linker keeps telling me that
>
>undefined reference to `ldl_symbolic(int, int*, int*, int*, int*, int*, int*, int*, int*)'
>
>i.e., the routine that performs the symbolic decomposition is not correctly referenced.
>It's strange, for two reasons:
>
>1) I have already used the same approach with other external libraries (GMSH, for example), and I have never had any troubles;
>2) if I just copy&paste the demo LDL code, eliminating all the DUNE stuff, and compile it from command line, everything goes well.
>
>Any smart ideas ?
>Thanks in advance!
>
>Andrea
>__________________________________________________________
>
>Andrea Sacconi
>PhD student, Applied Mathematics
>AMMP Section, Department of Mathematics, Imperial College London,
>London SW7 2AZ, UK
>a.sacconi11 at imperial.ac.uk
>
>_______________________________________________
>Dune mailing list
>Dune at dune-project.org
>http://lists.dune-project.org/mailman/listinfo/dune
_______________________________________________________________
Bernd Flemisch phone: +49 711 685 69162
IWS, Universitaet Stuttgart fax: +49 711 685 67020
Pfaffenwaldring 61 email: bernd at iws.uni-stuttgart.de
D-70569 Stuttgart url: www.hydrosys.uni-stuttgart.de
_______________________________________________________________
More information about the Dune
mailing list