CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Installation (
-   -   [] OpenFOAM 3.0.1 in Ubuntu 18.04 (

jlr December 20, 2018 12:43

OpenFOAM 3.0.1 in Ubuntu 18.04

I've been trying to install OpenFOAM 3.0.1 in Ubuntu 18.04 with no success... Unfortunately, there are still no instructions in

This is from the $WM_PROJECT_DIR/Allwmake log when attempting installing through the official instructions at


ensight/part/ensightPart.C: In member function ‘bool Foam::ensightPart::isFieldDefined(const Foam::List<double>&) const’:
ensight/part/ensightPart.C:54:39: error: ‘isnan’ was not declared in this scope
            if (id >= field.size() || isnan(field[id]))
ensight/part/ensightPart.C:54:39: note: suggested alternative:
In file included from /opt/OpenFOAM-3.0.1/src/OpenFOAM/lnInclude/doubleFloat.H:32:0,
                from /opt/OpenFOAM-3.0.1/src/OpenFOAM/lnInclude/floatScalar.H:38,
                from /opt/OpenFOAM-3.0.1/src/OpenFOAM/lnInclude/scalar.H:39,
                from /opt/OpenFOAM-3.0.1/src/OpenFOAM/lnInclude/IOstream.H:49,
                from /opt/OpenFOAM-3.0.1/src/OpenFOAM/lnInclude/Ostream.H:39,
                from /opt/OpenFOAM-3.0.1/src/OpenFOAM/lnInclude/OSstream.H:39,
                from /opt/OpenFOAM-3.0.1/src/OpenFOAM/lnInclude/OFstream.H:38,
                from lnInclude/ensightFile.H:36,
                from ensight/part/ensightPart.H:40,
                from ensight/part/ensightPart.C:26:
/usr/include/c++/7/cmath:639:5: note:  ‘std::isnan’
    isnan(_Tp __x)
/opt/OpenFOAM-3.0.1/wmake/rules/General/transform:8: recipe for target '/opt/OpenFOAM-3.0.1/platforms/linux64GccDPInt32Opt/src/conversion/ensight/part/ensightPart.o' failed
make: *** [/opt/OpenFOAM-3.0.1/platforms/linux64GccDPInt32Opt/src/conversion/ensight/part/ensightPart.o] Error 1

When following the wiki instructions for Ubuntu 16.04 at the same error occurs in the same line, and also twice in the file ensight/part/ensightPartIO.C

The wiki instructs running $WM_THIRD_PARTY_DIR/makeParaView4 before $WM_PROJECT_DIR/Allwmake. This also results in a compilation error


CMake Error at VTK/CMake/vtkCompilerExtras.cmake:47 (if):
  if given arguments:

    "gcc: error: ARGS: Ficheiro ou directoria inexistente

The last line says "ARGS: File or directory does not exist" in Portuguese.

I've also tried to follow some of the instructions for compiling OpenFOAM 2.3.1 for Ubuntu 18.04 at for example changing the compiler to g++5, but it didn't have any success either.

Thank you in advance for any help provided

olesen December 20, 2018 14:13


Originally Posted by jlr (Post 719737)

I've been trying to install OpenFOAM 3.0.1 in Ubuntu 18.04 with no success... Unfortunately, there are still no instructions in


Thank you in advance for any help provided

The OpenFOAM version that you are trying to use is several years old and some of it will simply not compile with newer compilers. I'd suggest that you obtain a new version. OpenFOAM-v1812 is coming out today. The website ( is still being updated, but the source files are already available

One of my coworkers compiled it from source on ubuntu 18.04 yesterday and had no issues.



jlr December 21, 2018 07:36

I already use several versions of OpenFOAM for different projects who make use of custom code written for different versions. Right now, I need to use OpenFOAM 3.0.1.

It should be possible to compile since OpenFOAM 2.3.1, which is older, apparently can be compiled in Ubuntu 18.04 (I haven't tried it yet though)

wyldckat December 22, 2018 07:48

Greetings to all!

@jlr: I've now finished writing and testing the instructions for building OpenFOAM 3.0.1 on Ubuntu 18.04, by relying on GCC 5:

@Mark: Congrats on the early release of v1812! In order for people to adhere always to the more recent versions, we'll need to make it easier to port their old inherited code to work with the more recent code, so please do keep up with the good work at:

But they'll also need to confirm if the results are still at least similar to the more recent versions, so we need a way to run tests with the older versions. Hence me having written up instructions for them at along with the requests as they come in. That said, I am thinking of relying on AppImage in the future, but it's sometime away for me to do this...

Best regards,

jlr January 3, 2019 13:57

I got it working! Thank you wyldckat!

All times are GMT -4. The time now is 17:04.