dolfin version

Asked by Felix Ospald

Hi, is there something like a DOLFIN_VERSION somewhere in the C++ headers defined (didn't find one)?
Or how to determine if the user has dolfin 1.0 (stable version) or dolfin 1.1 (current dev version)?

Question information

Language:
English Edit question
Status:
Solved
For:
DOLFIN Edit question
Assignee:
No assignee Edit question
Solved by:
Johan Hake
Solved:
Last query:
Last reply:
Revision history for this message
Johan Hake (johan-hake) said :
#1

Run dolfin-version from the command prompt.

Johan
On Oct 24, 2012 3:51 PM, "Felix Ospald" <
<email address hidden>> wrote:

> New question #212189 on DOLFIN:
> https://answers.launchpad.net/dolfin/+question/212189
>
> Hi, is there something like a DOLFIN_VERSION somewhere in the C++ headers
> defined (didn't find one)?
> Or how to determine if the user has dolfin 1.0 (sable version) or dolfin
> 1.1 (current dev version)?
>
> --
> You received this question notification because you are a member of
> DOLFIN Team, which is an answer contact for DOLFIN.
>

Revision history for this message
Felix Ospald (felix-ospald) said :
#2

Thanks you, but it would be nice to have something like a
#define DOLFIN_VERSION_MAJOR 1
#define DOLFIN_VERSION_MINOR 1
in dolfin_common.h (for example) and if it is not defined (to be compatible to existing installation) I would know it is dolfin< 1.1

This would it make it more easy to write compatible code for the 1.0 and 1.1 version.

For sure i can use somehow dolfin-version within cmake to define these constants for g++. But it is more complicated.

Revision history for this message
Felix Ospald (felix-ospald) said :
#3

an easy workaround for the moment would be for example

#include<dolfin/la/dolfin_la.h>

#ifdef __GENERIC_LINEAR_OPERATOR_H
#warning "Version >=1.1"
#else
#warning "Version <1.1"
#endif

Revision history for this message
Best Johan Hake (johan-hake) said :
#4

If you use either pkg-config or cmake to find the installed dolfin in
your configure set up you have this defined for you:

  -DDOLFIN_VERSION=\"1.0.0+\"

Johan

On 10/24/2012 05:51 PM, Felix Ospald wrote:
> Question #212189 on DOLFIN changed:
> https://answers.launchpad.net/dolfin/+question/212189
>
> Felix Ospald posted a new comment:
> an easy workaround for the moment would be for example
>
> #include<dolfin/la/dolfin_la.h>
>
> #ifdef __GENERIC_LINEAR_OPERATOR_H
> #warning "Version >=1.1"
> #else
> #warning "Version <1.1"
> #endif
>

Revision history for this message
Felix Ospald (felix-ospald) said :
#5

Thanks

Revision history for this message
Felix Ospald (felix-ospald) said :
#6

Thanks Johan Hake, that solved my question.