[Dune] Problem linking one module to another as a library with cmake

Markus Blatt markus at dr-blatt.de
Wed Nov 26 20:49:46 CET 2014


Hi,

On Wed, Nov 26, 2014 at 05:36:47PM +0100, Aleksejs Fomins wrote:
> I wish to create an executable for my test. For that I write the
> following lines in
> dune-curvilineargrid/dune/curvilineargrid/io/file/test/CMakeLists.txt
> 
> add_executable(curvilineargmshtest curvilineargmshtest.cc)
> target_link_libraries(curvilineargmshtest dunecommon dunegeometry
> dunecurvilineargeometry dunegrid)
> 
> So now the test compiles correctly, however, upon linking it throws
> 
> Linking CXX executable curvilineargmshtest
> /usr/bin/ld: cannot find -ldunecurvilineargeometry
> 
> Should I not be specifying the curvilineargeometry as a library? Or if I
> should, should I make sure it is a library somehow?

If your module does not build library, then you cannot link to it. I
cannot judge whether you need one or not. 

Apparently you are not building one (neither with cmake nor
autotools). Therefore just skip it when linking or use ${DUNE_LIBS}
which should contain all available DUNE libraries.

Markus


-- 
Do you need more support with DUNE or HPC in general? 

Dr. Markus Blatt - HPC-Simulation-Software & Services http://www.dr-blatt.de
Hans-Bunte-Str. 8-10, 69123 Heidelberg, Germany
Tel.: +49 (0) 160 97590858
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20141126/4dc7170c/attachment.sig>


More information about the Dune mailing list