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

Error during compilation with Icc

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

Reply
 
LinkBack Thread Tools Display Modes
Old   November 24, 2009, 11:09
Default Error during compilation with Icc
  #1
Senior Member
 
Fabian Schlegel
Join Date: Apr 2009
Location: Dresden, Germany
Posts: 171
Rep Power: 7
fs82 is on a distinguished road
Hello,

I have to compile OpenFoam 1.6.x with the Intel C++ Compiler on our SGI Altix System. This is the only available choice, gcc is not allowed on this maschine. I also have to switch the MPI coming with OpenFoam to a system own one. So I changed in $WM_PROJECT_DIR/etc/bashrc:

: ${WM_COMPILER:=Icc}; export WM_COMPILER

ia64)
WM_ARCH=linuxIA64
export WM_COMPILER=Icc
export WM_MPLIB=SGIMPT
;;

And in $WM_PROJECT_DIR/etc/settings.sh:

compilerInstall=System

case "$WM_MPLIB" in
SGIMPT)
mpi_version=mpt-1.22
export MPI_HOME=/opt/sgi/mpt/$mpi_version
export MPI_ARCH_PATH=$MPI_HOME

_foamAddPath $MPI_ARCH_PATH/bin
_foamAddLib $MPI_ARCH_PATH/lib

export FOAM_MPI_LIBBIN=$FOAM_LIBBIN/$mpi_version
unset mpi_version
;;

So this works so far, I have to add a $WM_PROJECT_DIR/wmake/rules/linuxIA64Icc/mplibSGIMPT and I tried to compile $WM_PROJECT_DIR/src/Pstream/mpi which works perfect. I noticed that I have to add *MPT* to the Allwmake file in the $WM_PROJECT_DIR/src/Pstream/ directory but this is easy. After executing Allwmake in $WM_PROJECT_DIR it takes a while until a serious error occurs:

/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 am not able to figure out what the problem is. So may be anyone of the more advanced users could help me. I need the possibility to run my cases on this HPC and the usage of gcc and other mpi's is forbidden by the admins :-/

kind regards,
fabian

Last edited by fs82; November 24, 2009 at 11:31. Reason: I missed the OpenFoam version
fs82 is offline   Reply With Quote

Old   November 25, 2009, 08:46
Default
  #2
Senior Member
 
Fabian Schlegel
Join Date: Apr 2009
Location: Dresden, Germany
Posts: 171
Rep Power: 7
fs82 is on a distinguished road
Nobody have an idea? I tested it with the intel 11.0 and 10.1 but the result is quite the same. The maschine provides an older gcc-4.1.1. but using this compiler leads to another serious error concerning some private variables. But the gcc-4.1.1. is able to compile the fileStat.C which causes the error. This problem sucks really.
fs82 is offline   Reply With Quote

Old   November 26, 2009, 19:47
Default
  #3
Super Moderator
 
Takuya OSHIMA
Join Date: Mar 2009
Location: Niigata City, Japan
Posts: 514
Blog Entries: 1
Rep Power: 10
7islands is on a distinguished road
Hi Fabian,
I have posted a hint (a hint, not a solution) in another thread about the same issue. You might be able to try searching for that.

Takuya
7islands is offline   Reply With Quote

Old   November 27, 2009, 02:38
Default
  #4
Senior Member
 
Fabian Schlegel
Join Date: Apr 2009
Location: Dresden, Germany
Posts: 171
Rep Power: 7
fs82 is on a distinguished road
Yes I know you mean this post:

Code:
namespace X {
  template<class T1, class T2> class A
  { template<class T3> void func(const A<T3, T2>&); };

  template<class T4> class T2 {};
}

// error - current OF code
template<class T1, class T2> template<class T3>
void X::A<T1, T2>::func(const A<T3, T2>&) {}

// ok - suggested fix
template<class T1, class T5> template<class T3>
void X::A<T1, T5>::func(const A<T3, T5>&) {}
But there are two problems with your hint. First one is my very less knowledge about C++and second I am not able to figure pout where the code lines are located you mentioned. So the hint wasn't really helpful for me up to now. May be you could explain it a little bit more?

Fabian
fs82 is offline   Reply With Quote

Old   November 27, 2009, 03:36
Default
  #5
Super Moderator
 
Takuya OSHIMA
Join Date: Mar 2009
Location: Niigata City, Japan
Posts: 514
Blog Entries: 1
Rep Power: 10
7islands is on a distinguished road
Hi Fabian,

Yup that's the one. First try compiling the following with icc 11
Code:
namespace X {
  template<class T1, class T2> class A
  { template<class T3> void func(const A<T3, T2>&); };

  template<class T4> class T2 {};
}

// error - current OF code
template<class T1, class T2> template<class T3>
void X::A<T1, T2>::func(const A<T3, T2>&) {}
and you'll see the same error as you've got when compiling HashTable.C. Next try compiling
Code:
namespace X {
  template<class T1, class T2> class A
  { template<class T3> void func(const A<T3, T2>&); };

  template<class T4> class T2 {};
}

// ok - suggested fix
template<class T1, class T5> template<class T3>
void X::A<T1, T5>::func(const A<T3, T5>&) {}
which should go without any errors. Carefully compare and see the difference between the two pieces of codes. Do the same for HashTable.C.

I didn't try myself but my coworker, who asked for help about the problem, reported this worked for the particular error. But he also reported he had some other problems further on before finally getting everything compiled.

Takuya
7islands is offline   Reply With Quote

Old   November 27, 2009, 10:33
Default
  #6
Senior Member
 
Fabian Schlegel
Join Date: Apr 2009
Location: Dresden, Germany
Posts: 171
Rep Power: 7
fs82 is on a distinguished road
I tried to compile the code example 1 and the code example 2 with icc. And you are right, version 1 do not compile and version 2 do compile. But I am sorry I do not get the difference. I am not a programmer at all, I am used to fortran and while working with OpenFoam I lerned a little bit of C++ but this is not enough to understand whats going on in your example, especially when using templates and how to apply this to the HashTable.C. So please help me :/

Fabian
fs82 is offline   Reply With Quote

Old   November 28, 2009, 06:43
Default
  #7
New Member
 
Felix Apel
Join Date: Sep 2009
Posts: 15
Rep Power: 6
Don456 is on a distinguished road
Hi,

I'm stuck with the same problem.
I see the difference in the two examples but I'm not able to apply the changes.

Is it possible to get a fixed file from someone?

Greetings Felix
Don456 is offline   Reply With Quote

Old   December 1, 2009, 04:05
Default
  #8
Senior Member
 
Fabian Schlegel
Join Date: Apr 2009
Location: Dresden, Germany
Posts: 171
Rep Power: 7
fs82 is on a distinguished road
Allright, here is the fix for HashTable.C This is done by a collegue who has more experience with C++ but this works and the icc shoudn't complain about the HashTable.C any more. The same fix has to be applied to the HashSet.C.
Fix for HashTable.C, line 455:
Code:
template<class T, class KeyXXX, class HashXXX>
template<class AnyType>
Foam::label Foam::HashTable<T, KeyXXX, HashXXX>::erase
(
    const HashTable<AnyType, KeyXXX,HashXXX>& rhs
)
Fix for HashSet.C, line 34:
Code:
template<class KeyXX, class HashXX>
template<class AnyType>
Foam::HashSet<KeyXX, HashXX>::HashSet(const HashTable<AnyType, KeyXX, HashXX>& h)
:
    HashTable<nil, KeyXX, HashXX>(h.size())
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))

So may be anybody has an idea?

kind regards,
Fabian
fs82 is offline   Reply With Quote

Old   December 1, 2009, 12:48
Default
  #9
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: http://olesenm.github.io/
Posts: 774
Rep Power: 17
olesen will become famous soon enough
Would the following fixes also work?

Code:
template<class T, class Key, class Hash>
template<class AnyType, class AnyHash>
Foam::label Foam::HashTable<T, Key, Hash>::erase
(
    const HashTable<AnyType, Key, AnyHash>& rhs
)
and

Code:
template<class Key, class Hash>
template<class AnyType, class AnyHash>
Foam::HashSet<Key, Hash>::HashSet
(
   const HashTable<AnyType, Key, AnyHash>& h
)
Mattijs?
olesen is offline   Reply With Quote

Old   December 2, 2009, 09:17
Default
  #10
Senior Member
 
Fabian Schlegel
Join Date: Apr 2009
Location: Dresden, Germany
Posts: 171
Rep Power: 7
fs82 is on a distinguished road
Allright for anybody else who try to compile OpenFoam 1.6 with Intels C++ Compiler the solution is posted here:
Error occurs when compiling OpenFoam 1.6.x with Icc

Fabian
fs82 is offline   Reply With Quote

Reply

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
Compilation Order and Single Precision Issues gocarts OpenFOAM Bugs 1 October 14, 2009 17:19
Compilation Error when running Tutorial 2.4 zhihuali CD-adapco 7 April 1, 2008 07:34
Compilation error with uparm.f Raghu CD-adapco 2 May 30, 2007 02:09
Compilation Error.... Arnab CD-adapco 4 September 12, 2004 15:54
Need help on double precision compilation tingguang Main CFD Forum 1 March 18, 2002 17:26


All times are GMT -4. The time now is 21:38.