CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Bugs (
-   -   Error occurs when compiling OpenFoam 1.6.x with Icc (

fs82 November 26, 2009 11:34

Error occurs when compiling OpenFoam 1.6.x with Icc
Is there anybody who successfully compiled OpenFoam 1.6.x with the Intel C++ Compiler and a IA64 architecture?

If I switch $WM_COMPILER from Gcc to Icc and compilerInstall to System I get an error in fileStat.C:

/work/home6/fschleg/Source/OpenFoam/OpenFOAM-1.6.x/src/OpenFOAM/lnInclude/HashTable.C(459): error: argument list for class template "Foam::Hash" is missing
const HashTable<AnyType, Key, Hash>& rhs

/work/home6/fschleg/Source/OpenFoam/OpenFOAM-1.6.x/src/OpenFOAM/lnInclude/HashTable.C(457): error: no instance of overloaded function "Foam::HashTable<T, Key, Hash>::erase" matches the specified type
Foam::label Foam::HashTable<T, Key, Hash>::erase

So I already posted this question in the Installation section but nobody is answering. So may be someone here already tried to compile OpenFoam 1.6.x wit the Icc and have a solution?


fs82 December 1, 2009 05:09

Allright I fixed this bug with a little help of a colleague but this was not the last error which occurs when compiling with icc. The solution is posted here:

But now the next error appears in src/OpenFOAM/primitives/hashes/SHA1/SHA1.C:

primitives/hashes/SHA1/SHA1.C(137): error: type definition is not allowed
if (UNALIGNED_P (data))


mattijs December 1, 2009 15:17

I've pushed the changes for a (fairly clean) build using icpc11.1 into 1.6.x. Please let me know of any problems. To use it you'll need to set the environment variable WM_COMPILER to Icc and change the etc/settings.* to have compilerInstall=System.

Thanks for reporting,


fs82 December 2, 2009 10:14

Yeah seems that I am back in business. Thx a lot Mattijs great work.
I tested it first with intel compiler version 10.1 but this was a bad idea. Now I am compiling with 11.0 and it looks very good but it needs a long time and the Altix isnt very fast on one CPU :/ The only thing I noticed is right in the beginning, when compiling ThirdParty:

could not open file libc_private.h for source file fbsdmalloc.c
could not open file spinlock.h for source file fbsdmalloc.c

But may be this isnt a serious error and wmake do not complain about the missing files. May be anybody know if this files should be provided by the OS, or compiler or OpenFoam?

kind regards,

bastil January 17, 2010 09:09

I am wondering if I need a license for Intel-COmpiler if I intend to compile OpenFOAM with icc and use the compiled OfenFOAM for comercial use but not want to sell anything compiled with icc?
What about performance? Does this improve with icc compared to gcc on x86_86?


fs82 January 20, 2010 04:08

As far as I know you are allowed to use the intel compiler suite free for educational use (linux only). For everything else, especially for commercial use (even if you are not planning to sell anything done with intels compilers suite) you have to buy it. More informations should be on intels website.
I never tested the performence between gcc and icc. I have to use the icc compiler because I run OpenFoam on a Intel Itanium2 cluster and this is only possible if you compile with the intel compiler suite. On my x86_64 I prefer the gcc and the performance is quite good. And if you read through the forum you will notice that most of the performace checks states gcc is as fast as icc. But for my opinion gcc is much more comfortable to use with openfoam :-D


All times are GMT -4. The time now is 03:25.