|
[Sponsors] |
![]() |
![]() |
#1 |
Senior Member
Dr. Fabian Schlegel
Join Date: Apr 2009
Location: Dresden, Germany
Posts: 222
Rep Power: 18 ![]() |
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 12:31. Reason: I missed the OpenFoam version |
|
![]() |
![]() |
![]() |
![]() |
#2 |
Senior Member
Dr. Fabian Schlegel
Join Date: Apr 2009
Location: Dresden, Germany
Posts: 222
Rep Power: 18 ![]() |
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.
|
|
![]() |
![]() |
![]() |
![]() |
#4 |
Senior Member
Dr. Fabian Schlegel
Join Date: Apr 2009
Location: Dresden, Germany
Posts: 222
Rep Power: 18 ![]() |
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>&) {} Fabian |
|
![]() |
![]() |
![]() |
![]() |
#5 |
Super Moderator
Takuya OSHIMA
Join Date: Mar 2009
Location: Niigata City, Japan
Posts: 518
Blog Entries: 1
Rep Power: 21 ![]() |
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>&) {} 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>&) {} 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 |
|
![]() |
![]() |
![]() |
![]() |
#6 |
Senior Member
Dr. Fabian Schlegel
Join Date: Apr 2009
Location: Dresden, Germany
Posts: 222
Rep Power: 18 ![]() |
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 |
|
![]() |
![]() |
![]() |
![]() |
#7 |
New Member
Felix Apel
Join Date: Sep 2009
Posts: 15
Rep Power: 17 ![]() |
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 |
|
![]() |
![]() |
![]() |
![]() |
#8 |
Senior Member
Dr. Fabian Schlegel
Join Date: Apr 2009
Location: Dresden, Germany
Posts: 222
Rep Power: 18 ![]() |
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 ) 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()) 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 |
|
![]() |
![]() |
![]() |
![]() |
#9 |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,715
Rep Power: 41 ![]() ![]() |
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 ) Code:
template<class Key, class Hash> template<class AnyType, class AnyHash> Foam::HashSet<Key, Hash>::HashSet ( const HashTable<AnyType, Key, AnyHash>& h ) |
|
![]() |
![]() |
![]() |
![]() |
#10 |
Senior Member
Dr. Fabian Schlegel
Join Date: Apr 2009
Location: Dresden, Germany
Posts: 222
Rep Power: 18 ![]() |
Allright for anybody else who try to compile OpenFoam 1.6 with Intels C++ Compiler the solution is posted here:
http://www.cfd-online.com/Forums/ope...1-6-x-icc.html Fabian |
|
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Compilation Order and Single Precision Issues | gocarts | OpenFOAM Bugs | 1 | October 14, 2009 18:19 |
Compilation Error when running Tutorial 2.4 | zhihuali | Siemens | 7 | April 1, 2008 08:34 |
Compilation error with uparm.f | Raghu | Siemens | 2 | May 30, 2007 03:09 |
Compilation Error.... | Arnab | Siemens | 4 | September 12, 2004 16:54 |
Need help on double precision compilation | tingguang | Main CFD Forum | 1 | March 18, 2002 18:26 |