CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Installation

Error compiling OpenFoam 1.6.x with intel compiler icc

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

Reply
 
LinkBack Thread Tools Display Modes
Old   February 25, 2010, 04:16
Default Error compiling OpenFoam 1.6.x with intel compiler icc
  #1
New Member
 
Mak
Join Date: Feb 2010
Posts: 1
Rep Power: 0
mak_04 is on a distinguished road
I have checked out the latest version from the repository "OpenFoam 1.6.x"

And I get the following error compiling it with icc (11.0):

derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.C(4 5): error: member "Foam::NamedEnum<Enum, nEnum>::names [with Enum=Foam::compressible::turbulentHeatFluxTemperat ureFvPatchScalarField::heatSourceType, nEnum=2]" cannot be specialized in the current scope
names[] =
^

The is in the file:
src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.C

g++ does not give this error. It seems that the partially specialized template in this file is not allowed by icc while gcc seems to be ignoring it.

icc version: 11.0

Any idea what can be done?

Thanks,
mak_04 is offline   Reply With Quote

Old   February 25, 2010, 05:59
Default
  #2
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 7,327
Blog Entries: 32
Rep Power: 72
wyldckat is a jewel in the roughwyldckat is a jewel in the roughwyldckat is a jewel in the roughwyldckat is a jewel in the rough
Greetings Mak,

I knew I saw something recently about icc... According to this post, OpenFOAM 1.6.x is prepared to work with icc 11.1. Prior to that version, it doesn't work all that well.

I personally have very little experience with icc, but my advice is to get the latest free version of icc for Linux, and compare the two versions. Or read the release notes for the latest version and see what's the difference!

In case you had already seen that post, you could have let us know

Best regards,
Bruno
wyldckat is offline   Reply With Quote

Old   February 25, 2010, 06:04
Default
  #3
New Member
 
Join Date: May 2009
Posts: 3
Rep Power: 7
joris is on a distinguished road
I have the same problem. I think this link describes the problem and some solutions:
http://stackoverflow.com/questions/1470654
joris is offline   Reply With Quote

Old   February 25, 2010, 06:52
Default
  #4
New Member
 
Join Date: May 2009
Posts: 3
Rep Power: 7
joris is on a distinguished road
Quote:
Originally Posted by joris View Post
I have the same problem. I think this link describes the problem and some solutions:
http://stackoverflow.com/questions/1470654
I followed the instructions in this link and now it compiles fine with icc/icpc

1) comment out the template specialization at the top of the file:

/*
template<>
const char*
NamedEnum<turbulentHeatFluxTemperatureFvPatchScala rField::heatSourceType, 2>::
names[] =
{
"power",
"flux"
};
*/

2) add the following to the bottom of the file (outside the namespaces!):

template<>
const char*
Foam::NamedEnum<Foam::compressible::turbulentHeatF luxTemperatureFvPatchScalarField::heatSourceType, 2>::
names[] =
{
"power",
"flux"
};
joris is offline   Reply With Quote

Old   April 7, 2010, 18:45
Default
  #5
Member
 
Patricio Bohorquez
Join Date: Mar 2009
Location: Jaén, Spain
Posts: 87
Rep Power: 7
pbohorquez is on a distinguished road
Please, could you fix the blank space in the word F lux?

Foam::NamedEnum<Foam::compressible::turbulentHeatF lux

Thanks, now it works for me.
pbohorquez is offline   Reply With Quote

Old   October 28, 2011, 07:06
Default OpenFOAM with Intel compiler (OF 1.7.1)
  #6
New Member
 
Achim Boemelburg
Join Date: Oct 2011
Posts: 12
Rep Power: 5
achim is on a distinguished road
Quote:
Originally Posted by joris View Post
I followed the instructions in this link and now it compiles fine with icc/icpc

1) comment out the template specialization at the top of the file:

/*
template<>
const char*
NamedEnum<turbulentHeatFluxTemperatureFvPatchScala rField::heatSourceType, 2>::
names[] =
{
"power",
"flux"
};
*/

2) add the following to the bottom of the file (outside the namespaces!):

template<>
const char*
Foam::NamedEnum<Foam::compressible::turbulentHeatF luxTemperatureFvPatchScalarField::heatSourceType, 2>::
names[] =
{
"power",
"flux"
};

---------------------------------------------------------------------
I tried to follow this way, but my compilation fails:

derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.C(2 40): error: namespace "Foam::compressible" has no member "turbulentHeatF"
Foam::NamedEnum<Foam::compressible::turbulentHeatF luxTemperatureFvPatchScalarField::heatSourceType, 2>::
^

derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.C(2 40): error: name followed by "::" must be a class or namespace name
Foam::NamedEnum<Foam::compressible::turbulentHeatF luxTemperatureFvPatchScalarField::heatSourceType, 2>::
^

derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.C(2 40): error: too few arguments for class template "Foam::NamedEnum"
Foam::NamedEnum<Foam::compressible::turbulentHeatF luxTemperatureFvPatchScalarField::heatSourceType, 2>::
^

derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.C(2 40): error: expected a ";"
Foam::NamedEnum<Foam::compressible::turbulentHeatF luxTemperatureFvPatchScalarField::heatSourceType, 2>::
^
Here's my source:

...
34 namespace Foam
35 {
36 namespace compressible
37 {
38
39 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
40
41 /*
42 (Error compiling OpenFoam 1.6.x with intel compiler icc)
43 template<>
44 const char*
45 NamedEnum<turbulentHeatFluxTemperatureFvPatchScala rField::heatSourceType, 2>::
46 names[] =
47 {
48 "power",
49 "flux"
50 };
51 */
52
53 const
54 NamedEnum<turbulentHeatFluxTemperatureFvPatchScala rField::heatSourceType, 2>
55 turbulentHeatFluxTemperatureFvPatchScalarField::he atSourceTypeNames_;
56
57
...

233 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
234
235 } // End namespace compressible
236 } // End namespace Foam
237
238 template<>
239 const char*
240 Foam::NamedEnum<Foam::compressible::turbulentHeatF luxTemperatureFvPatchScalarField::heatSourceType, 2>::
241 names[] =
242 {
243 "power",
244 "flux"
245 };
246
247 //
************************************************** *********************** //
248

my icpc is
Version 12.0.2

achim is offline   Reply With Quote

Reply

Tags
icc, intel compiler, template errors

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
CFX11 + Fortran compiler ? Mohan CFX 20 March 30, 2011 18:56
OF 1.6 | Ubuntu 9.10 (64bit) | GLIBCXX_3.4.11 not found piprus OpenFOAM Installation 22 February 25, 2010 13:43
Error occurs when compiling OpenFoam 1.6.x with Icc fs82 OpenFOAM Bugs 5 January 20, 2010 03:08
OpenFOAM compiled with Intel C++ Compiler? af631717 OpenFOAM Running, Solving & CFD 4 June 5, 2009 06:41
64bitrhel5 OF installation instructions mirko OpenFOAM Installation 2 August 12, 2008 18:07


All times are GMT -4. The time now is 22:29.