This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

Test Fenics version

+3 votes

Hi,
is there a command which allows to "ask" the computer what version of Fenics is installed? in this way I could write a code which could be handled by both Fenics 1.3.0 and 1.4.0.
thanks
Antoine

asked Jul 3, 2014 by Antoine FEniCS Novice (810 points)

1 Answer

+7 votes
 
Best answer

Hi, in shell you can call

$ dolfin-version 
1.4.0+

Also, there is a a function dolfin_version that returns version string. See here.

answered Jul 3, 2014 by MiroK FEniCS Expert (80,920 points)
selected Jul 4, 2014 by Garth N. Wells

It's also available in Python through

import dolfin
print dolfin.dolfin_version()

Edit: I see now that I found MixedFunctionSpace in the dolfin/1.6.0 documentation, so now I know I should just need to verify my dolfin version for this problem. I am still generally interested in the answer to the specific title question, about checking the fenics version.

Original comment:

I came to this thread looking specifically for my fenics version. This answers for dolfin, but the same method is not an attribute of fenics. How do I do this for fenics itself?

I'm new to fenics. I ask because I am failing to import something (specifically, MixedFunctionSpace) that should exist in fenics 1.6+. I'm assuming this simply because I found the name in the fenics 1.6.0 documentation.

I'm running the provided docker container, but I'm failing to find where the version is documented.

Thanks,

Alex

...