<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<title></title>
</head>
<body text="#000000" bgcolor="#ffffff">
Hey Franz and Jö, <br>
<br>
I remember that I ran into the same problem with CMake but as usual I
do not remember how I solved it. I attach my CMake files, maybe you can
compare with yours. <br>
<br>
By the way, to get the complete command that is passed to the linker,
you can use <br>
make VERBOSE=1<br>
And then, as Jö suggested, it is a matter of comparing with autotools. <br>
<br>
Kind regards <br>
Bernd <br>
<br>
On 05/05/2010 09:18 AM, Jö Fahlke wrote:
<blockquote cite="mid:20100505071859.GD12200@paranoia" type="cite">
<pre wrap="">Am Tue, 4. May 2010, 20:02:05 +0200 schrieb Franz Rammerstorfer:
</pre>
<blockquote type="cite">
<pre wrap="">I've updated all my modules and rebuilt them.
I've also checked the linking sequence within my buildingsystem cmake.
Linking seems to work, because e.g. I'm able to construct a UGGrid
object like in your example code unitcube.hh in dune-grid-howto.
</pre>
</blockquote>
<pre wrap="">
Works for me [tm]: After adding the necessary include files your example
looks as follows:
=== testp.cc =========================================================
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <string>
#include <dune/grid/uggrid.hh>
#include <dune/grid/io/file/gmshreader.hh>
int main(int argc, char **argv)
{
const int dim=3;
const std::string filename(argv[1]);
typedef Dune::UGGrid<dim> GT;
GT grid;
Dune::GmshReader<GT>::read(grid, filename);
return 0;
}
=== testp.cc =========================================================
I added the following snippet for compilation to my Makefile.am:
=== Makefile.am ======================================================
noinst_PROGRAMS = testp
testp_SOURCES = testp.cc
testp_CPPFLAGS = $(AM_CPPFLAGS) \
$(UG_CPPFLAGS)
testp_LDFLAGS = $(AM_LDFLAGS) \
$(UG_LDFLAGS)
testp_LDADD = \
$(UG_LIBS) \
$(LDADD)
=== Makefile.am ======================================================
With that in place, everything works fine (except for an unrelated warning
from UG):
=== make output ======================================================
-*- mode: compilation; default-directory: "~/src/dune2/dune-edyn/dune/edyn/utilities/" -*-
Compilation started at Wed May 5 09:10:03
cd ~/src/dune2/dune-edyn/dune/edyn/utilities && make testp
cd ../../.. && /bin/bash /home/joe/src/dune2/dune-edyn/missing --run automake-1.9 --foreign dune/edyn/utilities/Makefile
cd ../../.. && /bin/bash ./config.status dune/edyn/utilities/Makefile depfiles
config.status: creating dune/edyn/utilities/Makefile
config.status: executing depfiles commands
if g++ -std=c++0x -DHAVE_CONFIG_H -I. -I. -I../../.. -I/home/joe/src/dune2/dune-common -I/home/joe/src/dune2/dune-grid -I/home/joe/src/dune2/dune-localfunctions -I/home/joe/src/dune2/dune-istl -I/home/joe/src/dune2/dune-pdelab -I../../.. -I/usr/lib/openmpi/include -I/usr/lib/openmpi/include/openmpi -pthread -DMPIPP_H -DENABLE_MPI=1 -I/home/joe/src/dune2/UGinst/include -DENABLE_UG -DModelP -DNDEBUG -ggdb3 -O3 -funroll-loops -fno-strict-aliasing -Wall -MT testp-testp.o -MD -MP -MF ".deps/testp-testp.Tpo" -c -o testp-testp.o `test -f 'testp.cc' || echo './'`testp.cc; \
then mv -f ".deps/testp-testp.Tpo" ".deps/testp-testp.Po"; else rm -f ".deps/testp-testp.Tpo"; exit 1; fi
In file included from /home/joe/src/dune2/dune-grid/dune/grid/uggrid.hh:44,
from testp.cc:7:
/home/joe/src/dune2/dune-grid/dune/grid/uggrid/ugwrapper.hh:578:2: warning: #warning Method isLeaf() for nodes will not work properly in case of vertical load balancing
In file included from testp.cc:9:
/home/joe/src/dune2/dune-grid/dune/grid/io/file/gmshreader.hh: In member function ‘void Dune::GmshReaderParserBase<GridType, DimImp>::read(const std::string&) [with GridType = Dune::UGGrid<3>, DimImp = Dune::GmshReaderParser<Dune::UGGrid<3>, 3>]’:
/home/joe/src/dune2/dune-grid/dune/grid/io/file/gmshreader.hh:380: warning: ‘physical_entity’ may be used uninitialized in this function
/bin/bash ../../../libtool --tag=CXX --mode=link g++ -std=c++0x -ggdb3 -O3 -funroll-loops -fno-strict-aliasing -Wall -o testp testp-testp.o -L/home/joe/src/dune2/UGinst/lib -lugS2 -lugS3 -ldevS -pthread -L/usr/lib/openmpi/lib -lmpi -lopen-rte -lopen-pal -ldl -Wl,--export-dynamic -lnsl -lutil -lm -ldl ../../../lib/libduneedyn.la -L/home/joe/src/dune2/dune-grid/lib -ldunegrid -L/home/joe/src/dune2/dune-common/lib -ldunecommon -lm
libtool: link: g++ -std=c++0x -ggdb3 -O3 -funroll-loops -fno-strict-aliasing -Wall -o .libs/testp testp-testp.o -pthread -Wl,--export-dynamic -L/home/joe/src/dune2/UGinst/lib /home/joe/src/dune2/UGinst/lib/libugS2.so /home/joe/src/dune2/UGinst/lib/libugS3.so /home/joe/src/dune2/UGinst/lib/libdevS.so -L/usr/lib/openmpi/lib /usr/lib/openmpi/lib/libmpi.so /usr/lib/openmpi/lib/libopen-rte.so /usr/lib/openmpi/lib/libopen-pal.so -lnsl -lutil -ldl ../../../lib/.libs/libduneedyn.so -L/home/joe/src/dune2/dune-grid/lib /home/joe/src/dune2/dune-grid/lib/.libs/libdunegrid.so -L/home/joe/src/dune2/dune-common/lib /home/joe/src/dune2/dune-common/lib/.libs/libdunecommon.so -lm -pthread -Wl,-rpath -Wl,/home/joe/src/dune2/UGinst/lib -Wl,-rpath -Wl,/usr/lib/openmpi/lib
Compilation finished at Wed May 5 09:10:08
=== make output ======================================================
So, to help you any further, I will really need the exact command line cmake
uses to call the linker.
Bye,
Jö.
</pre>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
Dune mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Dune@dune-project.org">Dune@dune-project.org</a>
<a class="moz-txt-link-freetext" href="http://lists.dune-project.org/mailman/listinfo/dune">http://lists.dune-project.org/mailman/listinfo/dune</a>
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
_____________________________________________________________________
Bernd Flemisch phone: +49 711 685 69162
IWS, Universität Stuttgart fax: +49 711 685 60430
Pfaffenwaldring 61 email: <a class="moz-txt-link-abbreviated" href="mailto:bernd@iws.uni-stuttgart.de">bernd@iws.uni-stuttgart.de</a>
D-70569 Stuttgart url: <a class="moz-txt-link-abbreviated" href="http://www.hydrosys.uni-stuttgart.de">www.hydrosys.uni-stuttgart.de</a>
_____________________________________________________________________
</pre>
</body>
</html>