[Dune] Using a dune project create with v2.1 with the trunk

Christian Engwer christian.engwer at uni-muenster.de
Tue Mar 20 14:25:36 CET 2012


Hi Eike,

> if I created a dune project with version 2.1, can I still use this
> with the trunk? Obviously, I need to adapt my source code, so I will
> need to put in some preprocessor flags to check the version at
> compile time, but it would make code a lot management easier if I do
> not end up with two different dune projects in my svn repository. Or
> is putting the entire dune project under version control (obviously
> not including the files that are generated by
> automake/configure/make) a bad idea anyway?
> 
> I will need to use dune-geometry, which did not exist in 2.1, so I
> suspect that it will not work and I will have to create an entirely
> new project, with DUNE_CONTROL_PATH set to the trunk installation
> and using the duneproject executable from the trunk, then copy my
> source code across and maintain this separately.

You can adapt your code to work with both version.

Some hints:
a) you only need to mention those dependencies (in dune.module) which
   you are using directly, this means that dune-geometry will be
   pulled in, as you are using dune-grid.
b) You don't need to additionally check this at compile time,
   dunecontrol will make sure that all necessry modules are there
c) You can add preprocessor macros to use the one ore the other code,
   when you need to introduce incompatible changes. In you config.h
   will find definitions like:
   #define DUNE_COMMON_VERSION_MAJOR 2
   #define DUNE_COMMON_VERSION_MINOR 2

Cheers
Christian



More information about the Dune mailing list