[Dune] Problems with linking an external library

Sacconi, Andrea a.sacconi11 at imperial.ac.uk
Mon Sep 15 19:00:41 CEST 2014


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




More information about the Dune mailing list