[Dune] problem using ug and the gmshreader

Jö Fahlke jorrit at jorrit.de
Wed May 5 09:18:59 CEST 2010


Am Tue,  4. May 2010, 20:02:05 +0200 schrieb Franz Rammerstorfer:
> 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.

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ö.

-- 
If you receive something that says "Send this to everyone you know,"
pretend you don't know me.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 828 bytes
Desc: Digital signature
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20100505/49e9f8e3/attachment.sig>


More information about the Dune mailing list