[Dune] problem using ug and the gmshreader

Bernd Flemisch bernd at iws.uni-stuttgart.de
Wed May 5 09:32:29 CEST 2010


Hey Franz and Jö,

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.

By the way, to get the complete command that is passed to the linker,
you can use
make VERBOSE=1
And then, as Jö suggested, it is a matter of comparing with autotools.

Kind regards
Bernd

On 05/05/2010 09:18 AM, Jö Fahlke wrote:
> 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ö.
>
>   
>
>
> _______________________________________________
> Dune mailing list
> Dune at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune
>   

-- 
_____________________________________________________________________

Bernd Flemisch                               phone: +49 711 685 69162
IWS, Universität Stuttgart                   fax:   +49 711 685 60430
Pfaffenwaldring 61                  email: bernd at iws.uni-stuttgart.de
D-70569 Stuttgart                  url: www.hydrosys.uni-stuttgart.de
_____________________________________________________________________

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20100505/e413c74d/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dumux_cmake.zip
Type: application/zip
Size: 13625 bytes
Desc: not available
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20100505/e413c74d/attachment.zip>


More information about the Dune mailing list