CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Installation

[] Single precision build failing

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By spritche

LinkBack Thread Tools Search this Thread Display Modes
Old   June 4, 2016, 04:23
Default Single precision build failing
New Member
Steve Pritchett
Join Date: May 2016
Posts: 2
Rep Power: 0
spritche is on a distinguished road
Hi all,

I'm attempting to build a single precision version of OpenFOAM-v3.0+, and am running into difficulties. I've verified that the double precision builds complete as expected.

For comparison reasons, I was building two versions in parallel, one with the Intel 2015 (composer_xe_2015.0.090) compiler, and the other with gcc 4.8.5. Both compilers have run into the same issue with a function call to Foam::max.

Intel 2015:

icpc -std=c++0x -fp-trap=common -fp-model precise -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_SP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -diag-disable 2304 -xHost -O2  -DNoRepository -I../turbulenceModels/lnInclude -I/codes/OpenFOAM/OpenFOAM-v3.0+_IntelSP/src/transportModels -I/codes/OpenFOAM/OpenFOAM-v3.0+_IntelSP/src/finiteVolume/lnInclude -I/codes/OpenFOAM/OpenFOAM-v3.0+_IntelSP/src/meshTools/lnInclude  -IlnInclude -I. -I/codes/OpenFOAM/OpenFOAM-v3.0+_IntelSP/src/OpenFOAM/lnInclude -I/codes/OpenFOAM/OpenFOAM-v3.0+_IntelSP/src/OSspecific/POSIX/lnInclude   -fPIC -c turbulentTransportModels/turbulentTransportModels.C -o /codes/OpenFOAM/OpenFOAM-v3.0+_IntelSP/platforms/linux64IccSPInt32Opt/cfs/build/src/TurbulenceModels/incompressible/turbulentTransportModels/turbulentTransportModels.o
../turbulenceModels/lnInclude/SpalartAllmarasDES.C(189): error: no instance of overloaded function "Foam::max" matches the argument list
            argument types are: (double, Foam::tmp<Foam::GeometricField<Foam::scalar, Foam::fvPatchField, Foam::volMesh>>)
                     /max(SMALL, (fv1*max(1e-10, 1 - ft2)))
gcc 4.8.5:

g++ -m64 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_SP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -O3  -DNoRepository -ftemplate-depth-100 -I../turbulenceModels/lnInclude -I/codes/OpenFOAM/OpenFOAM-v3.0+_gccSP/src/transportModels -I/codes/OpenFOAM/OpenFOAM-v3.0+_gccSP/src/finiteVolume/lnInclude -I/codes/OpenFOAM/OpenFOAM-v3.0+_gccSP/src/meshTools/lnInclude  -IlnInclude -I. -I/codes/OpenFOAM/OpenFOAM-v3.0+_gccSP/src/OpenFOAM/lnInclude -I/codes/OpenFOAM/OpenFOAM-v3.0+_gccSP/src/OSspecific/POSIX/lnInclude   -fPIC -c turbulentTransportModels/turbulentTransportModels.C -o /codes/OpenFOAM/OpenFOAM-v3.0+_gccSP/platforms/linux64GccSPInt32Opt/cfs/build/src/TurbulenceModels/incompressible/turbulentTransportModels/turbulentTransportModels.o
In file included from ../turbulenceModels/lnInclude/SpalartAllmarasDES.H:241:0,
                 from turbulentTransportModels/turbulentTransportModels.C:112:
../turbulenceModels/lnInclude/SpalartAllmarasDES.C: In member function 'Foam::tmp<Foam::GeometricField<float, Foam::fvPatchField, Foam::volMesh> > Foam::LESModels::SpalartAllmarasDES<BasicTurbulenceModel>::psi(const volScalarField&, const volScalarField&) const':
../turbulenceModels/lnInclude/SpalartAllmarasDES.C:189:55: error: no matching function for call to 'max(double, Foam::tmp<Foam::GeometricField<float, Foam::fvPatchField, Foam::volMesh> >&)'
                    /max(SMALL, (fv1*max(1e-10, 1 - ft2)))
If not obvious in the above code blocks, the errors are for the inner max call after 'fv1*'.

Does anyone happen to know a good workaround to this issue, or have experience building the single precision version of OpenFOAM-v3.0+ successfully?

Any assistance is appreciated.

spritche is offline   Reply With Quote

Old   June 14, 2016, 07:26
Default known bug
New Member
Steve Pritchett
Join Date: May 2016
Posts: 2
Rep Power: 0
spritche is on a distinguished road
Just so that others are aware, this is a known bug. The fix can be found on here.

The solution was to force 1e-10 to be a scalar:

/max(SMALL, (fv1*max(scalar(1e-10), 1 - ft2)))

in the file:


wyldckat likes this.
spritche is offline   Reply With Quote


installation by sources, installation issue, openfoam+, single precision

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Single or double precision Jonas Larsson Main CFD Forum 16 June 20, 2017 07:53
Building from Source on Windows using Cygwin64 ericthefatguy SU2 2 May 12, 2015 19:23
Number of elements x double precision matheusguzella ANSYS Meshing & Geometry 2 October 7, 2009 11:15
Compiling OpenFOAM 12 in Single Precision fra76 OpenFOAM Installation 5 April 21, 2006 13:05
double precision assigning in FRTRAN R.A.Khurram Main CFD Forum 12 October 2, 2001 12:00

All times are GMT -4. The time now is 05:44.