[Dune] DUNE Usage as a 'normal' library

Simon Praetorius simon.praetorius at tu-dresden.de
Sun Nov 7 11:55:47 CET 2021


Hi Lukas,

> Nun zu den eigentlichen Fragen:
> 1. Würden Sie mir die Verwendung von DUNE für diesen Fall raten, oder 
> bin ich besser mit einer kleineren PDE Library aufgehoben, die 
> leichter zu handlen ist (wenn man sie selber handlen soll wie wir in 
> dem Fall).
> 2. Gibt es Dokumentation wie man DUNE als normale Library verwenden 
> kann, also als statische oder dynamische Library die man dann als .a / 
> .so in das Projekt einfügt?

DUNE is, strictly speaking, not a library but a library collection - a 
collection of modules that are dependent on each other. The modules can 
provide "classical" compiled libraries (static, shared), or header-only 
libraries. In order to handle all the interactions and dependencies 
between the modules, we have developed the `dunecontrol` tool, as you 
have already found. If I understand you correctly, you want to setup a 
new project, that uses DUNE as library dependency. You want to write 
code that includes the DUNE headers and want to link your executables 
against the DUNE library. Essentially, this is what we created the 
script `duneproject` for. It provides the template for such projects. 
Unfortunately, the dune buildsystem is quiet complex. Meaning: It is not 
so easy to just write in cmake the dependency `find_package(DUNE)`  and 
then on your target `target_link_libraries(<target> PRIVATE DUNE)`. The 
reason is, that 1. DUNE is split up into these modules, so you would 
have to do this for all modules you want to depend on directly and 
indirectly, and 2. The modules itself have complex buildsystem logic, 
find their own (external) dependencies, create configuration header 
files, set properties that the other modules need to adopt... So, 
without the buildsystem cmake scripts provided in dune-common and some 
default cmake functions like `dune_project()` and 
`finalize_dune_project()` it will be quiet hard to do that with pure 
cmake. But, we are working on that and hopefully with the next (or next 
next) release this might also be possible.

In some other PDE "libraries", like e.g. deal.ii, you also have a 
buildsystem infrastructure provided by the framework. Often one is 
required to use this infrastructure to successfully create a project 
that uses the framework. So, I suggest: if you want to use DUNE, start 
with the duneproject script to generate a corresponding template folder 
for your project and then follow the buildsystem documentation in the 
book or on the website.

Best,
Simon


>
>
> Ich hoffe ich konnte meine Situation ein wenig schildern und wäre sehr 
> dankbar, wenn mir weiter geholfen werden könnte.
>
> Ich wünsche eine gute Zeit.
>
> Mit freundlichen Grüßen,
>
> Lukas Heisler
>
> _______________________________________________
> Dune mailing list
> Dune at lists.dune-project.org
> https://lists.dune-project.org/mailman/listinfo/dune

-- 
Dr. Simon Praetorius
Technische Universität Dresden
Institute of Scientific Computing
phone: +49 351 463-34432
mail: simon.praetorius at tu-dresden.de
web: https://tu-dresden.de/mn/math/wir/das-institut/beschaeftigte/simon-praetorius


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5204 bytes
Desc: S/MIME Cryptographic Signature
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20211107/4cf568d3/attachment.bin>


More information about the Dune mailing list