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

Compilation fails on Linuxx86

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 28, 2007, 07:33
Default The topmost error is: #######
  #1
New Member
 
Alexander Grahn
Join Date: Mar 2009
Posts: 12
Rep Power: 17
agrahn is on a distinguished road
The topmost error is:
#####################
meshes/polyMesh/polyPatches/derivedPolyPatches/cyclicPolyPatch/cyclicPolyPatch.d ep:248: warning: overriding commands for target `Make/linuxGcc4DPOpt/cyclicPolyPatcSOURCE=global/global.C ; g++ -m32 -Dlinux -DDP -Wall -W -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-30 -DWM_PROJECT_VERSION='"'1.
3'"' -I/home/grahn/OpenFOAM/OpenFOAM-1.3/src/zlib-1.2.1 -I/home/grahn/OpenFOAM/OpenFOAM-1.3/src/OpenFOAM/lnInclude -IlnInclude -I. -fPIC -pthread -c $SOURCE -o
Make/linuxGcc4DPOpt/global.o
In file included from global/global.C:61:
/home/grahn/OpenFOAM/OpenFOAM-1.3/src/OpenFOAM/lnInclude/error.C:41:22: error: demangle.h: No such file or directory
/home/grahn/OpenFOAM/OpenFOAM-1.3/src/OpenFOAM/lnInclude/error.C: In static member function 'static void Foam::error::printStack(Foam:stream&)':
/home/grahn/OpenFOAM/OpenFOAM-1.3/src/OpenFOAM/lnInclude/error.C:193: error: 'auto_demangling' was not declared in this scope
/home/grahn/OpenFOAM/OpenFOAM-1.3/src/OpenFOAM/lnInclude/error.C:194: error: 'cplus_demangle' was not declared in this scope
make: *** [Make/linuxGcc4DPOpt/global.o] Error 1

Last error is:
##############
SOURCE=foamInfoExec.C ; g++ -m32 -Dlinux -DDP -Wall -W -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-30 -I/home/grahn/OpenFOAM/Ope
nFOAM-1.3/src/OpenFOAM/lnInclude -IlnInclude -I. -fPIC -pthread -c $SOURCE -o Make/linuxGcc4DPOpt/foamInfoExec.o
/home/grahn/OpenFOAM/OpenFOAM-1.3/wmake/bashScripts/mkObjectDir /home/grahn/OpenFOAM/OpenFOAM-1.3/applications/bin/linuxGcc4DPOpt/foamInfoExec
g++ -m32 -Dlinux -DDP -Wall -W -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-30 -I/home/grahn/OpenFOAM/OpenFOAM-1.3/src/OpenFOAM/ln
Include -IlnInclude -I. -fPIC -pthread Make/linuxGcc4DPOpt/foamInfoExec.o -L/home/grahn/OpenFOAM/OpenFOAM-1.3/lib/linuxGcc4DPOpt \
-lOpenFOAM -liberty -o /home/grahn/OpenFOAM/OpenFOAM-1.3/applications/bin/linuxGcc4DPOpt/foamInfoExec
/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/../../../../i686-pc-linux-gnu/bin/ld: cannot find -lOpenFOAM
collect2: ld returned 1 exit status
make: *** [/home/grahn/OpenFOAM/OpenFOAM-1.3/applications/bin/linuxGcc4DPOpt/foamInfoExec] Error 1


This is the output of 'gcc -v':
###############################
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: /var/tmp/portage/sys-devel/gcc-4.1.1-r3/work/gcc-4.1.1/configure --prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/4.1.1 --includedir=/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include --datadir=/usr/share/gcc-data/i686-pc-linux-gnu/4.1.1 --mandir=/usr/share/gcc-data/i686-pc-linux-gnu/4.1.1/man --infodir=/usr/share/gcc-data/i686-pc-linux-gnu/4.1.1/info --with-gxx-include-dir=/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/g++-v4 --host=i686-pc-linux-gnu --build=i686-pc-linux-gnu --disable-altivec --enable-nls --without-included-gettext --with-system-zlib --disable-checking --disable-werror --enable-secureplt --disable-libunwind-exceptions --disable-multilib --disable-libmudflap --disable-libssp --enable-languages=c,c++,java,fortran --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu
Thread model: posix
gcc version 4.1.1 (Gentoo 4.1.1-r3)

And this is 'uname -a' output:
##############################
Linux fwss41 2.6.19-gentoo-r5 #1 SMP Mon Mar 12 11:46:45 CET 2007 i686 Intel(R) Core(TM)2 CPU 6600 @ 2.40GHz GenuineIntel GNU/Linux
agrahn is offline   Reply With Quote

Old   March 28, 2007, 07:38
Default Try again after installing dem
  #2
Senior Member
 
Join Date: Mar 2009
Posts: 854
Rep Power: 22
henry is on a distinguished road
Try again after installing demangle.h which is required to compile OpenFOAM.
henry is offline   Reply With Quote

Old   March 28, 2007, 08:08
Default Henry, Is demangle.h the on
  #3
New Member
 
Alexander Grahn
Join Date: Mar 2009
Posts: 12
Rep Power: 17
agrahn is on a distinguished road
Henry,

Is demangle.h the one that comes with libcwd
http://libcwd.sourceforge.net/index.html
?

Alexander
agrahn is offline   Reply With Quote

Old   March 28, 2007, 08:14
Default We use SuSE and demangle.h ins
  #4
Senior Member
 
Join Date: Mar 2009
Posts: 854
Rep Power: 22
henry is on a distinguished road
We use SuSE and demangle.h installs automatically when the code development package is installed. I do not have any experience with Gentoo.
henry is offline   Reply With Quote

Old   March 28, 2007, 08:42
Default emerge binutils should solve
  #5
Member
 
rafal zietara
Join Date: Mar 2009
Location: Manchester, UK
Posts: 60
Rep Power: 17
rafal is on a distinguished road
emerge binutils
should solve the problem
rafal
rafal is offline   Reply With Quote

Old   March 28, 2007, 08:48
Default Thanks, Rafal, but binutils (2
  #6
New Member
 
Alexander Grahn
Join Date: Mar 2009
Posts: 12
Rep Power: 17
agrahn is on a distinguished road
Thanks, Rafal, but binutils (2.16.1-r3) is already installed.

Alexander
agrahn is offline   Reply With Quote

Old   March 28, 2007, 09:13
Default Rafal, would you please try to
  #7
New Member
 
Alexander Grahn
Join Date: Mar 2009
Posts: 12
Rep Power: 17
agrahn is on a distinguished road
Rafal, would you please try to find out to which package demangle.h belongs. This could be done with

equery belongs `locate -r '\<demangle.h\>'`

'equery' is part of the genoolkit package. Of course, package 'slocate' must be installed and the file name data base (updated automatically once a day by updatedb, started via crond) must be present.

Thanks,
Alexander
agrahn is offline   Reply With Quote

Old   March 28, 2007, 09:28
Default demangle.h is a part of the sy
  #8
Member
 
rafal zietara
Join Date: Mar 2009
Location: Manchester, UK
Posts: 60
Rep Power: 17
rafal is on a distinguished road
demangle.h is a part of the sys-devel/binutils.
I untar it and in /include there is demangle.h
rafal
rafal is offline   Reply With Quote

Old   March 28, 2007, 09:40
Default I assume (didnt test) that unt
  #9
Member
 
rafal zietara
Join Date: Mar 2009
Location: Manchester, UK
Posts: 60
Rep Power: 17
rafal is on a distinguished road
I assume (didnt test) that untaring binutils and
putting demangle.h to /usr/include will solve the
problem(possibly) changing permissions of the file.
maybe you will need to copy in some other dependencies of demangle. binutils 2.16.1-r3 latest stable-should be the most appropriate.
hope this helps.
rafal
PS I dont remember how i did my OF working on Gentoo
but it was definitely gentoo way of doing things
rafal is offline   Reply With Quote

Old   March 28, 2007, 09:50
Default demangle.h is indeed part of t
  #10
New Member
 
Alexander Grahn
Join Date: Mar 2009
Posts: 12
Rep Power: 17
agrahn is on a distinguished road
demangle.h is indeed part of the binutils source file, but doesn't get installed when installing binutils.

I wish I could simply say

emerge openfoam

but

grahn@fwss41:~ $ emerge --search openfoam
Searching...
[ Results for search key : openfoam ]
[ Applications found : 0 ]

:---(
agrahn is offline   Reply With Quote

Old   April 26, 2007, 05:59
Default About missing demangle.h : att
  #11
Senior Member
 
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,419
Rep Power: 26
mattijs is on a distinguished road
About missing demangle.h : attached a version of error.C (OpenFOAM/db/error/error.C) which does not use demangle.h but uses the cxxabi.h (which is present in most/all gcc installations).

error.C

Tested it on one machine and seems to compile and function ok. Please let me know if there are any problems with it.
mattijs is offline   Reply With Quote

Old   May 8, 2007, 08:37
Default Hi Mattijs, I replaced the
  #12
Senior Member
 
Frank Bos
Join Date: Mar 2009
Location: The Netherlands
Posts: 340
Rep Power: 18
lr103476 is on a distinguished road
Hi Mattijs,

I replaced the error.C in my OpenFOAM 1.3 installation with your latest version. The following errors occur:

/home/frankl/OpenFOAM/OpenFOAM-1.3/src/OpenFOAM/lnInclude/error.C:97: error: definition of implicitly-declared 'Foam::error::~error()'
/home/frankl/OpenFOAM/OpenFOAM-1.3/src/OpenFOAM/lnInclude/error.C: In static member function 'static void Foam::error::printStack(Foam:stream&)':
/home/frankl/OpenFOAM/OpenFOAM-1.3/src/OpenFOAM/lnInclude/error.C:327: error: 'class Foam::IFstream' has no member named 'getLine'
make: *** [Make/linuxGcc4DPOpt/global.o] Error 1
make: *** Waiting for unfinished jobs....

Any ideas?

Regards, Frank
__________________
Frank Bos
lr103476 is offline   Reply With Quote

Old   May 8, 2007, 09:23
Default The error.C file Mattijs poste
  #13
Senior Member
 
Join Date: Mar 2009
Posts: 854
Rep Power: 22
henry is on a distinguished road
The error.C file Mattijs posted is for OpenFOAM-1.4.
henry is offline   Reply With Quote

Old   June 20, 2007, 05:03
Default Thanks, Mattijs, for providing
  #14
New Member
 
Alexander Grahn
Join Date: Mar 2009
Posts: 12
Rep Power: 17
agrahn is on a distinguished road
Thanks, Mattijs, for providing `error.C' which resolves the demangle.h-missing-error.

Next, I had to install the termcap library. Almost no recent software links against it. Hasn't termcap been superseeded by terminfo for ages now?

Now, compilation fails due to a syntax error in file `gambitToFoam.C'. (The recently posted cumulative patch to OpenFOAM-1.4 has been applied.)

Any ideas? Thanks for your help.

Alexander

make[3]: Entering directory `/home/grahn/OpenFOAM/OpenFOAM-1.4/applications/utilities/mesh/conversion/gambit ToFoam'
SOURCE=gambitToFoam.L ; flex++ -f $SOURCE ; mv lex.yy.cc Make/linuxGcc4DPOpt/gambitToFoam.C ; g++ -m32 -Dlinux -DDP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-
parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-40 -IlnInclude -I. -I/home/grahn/OpenFOAM/OpenFOAM-1.4/src/OpenFOAM/lnInclude -fPIC -pthread -c
Make/linuxGcc4DPOpt/gambitToFoam.C -o Make/linuxGcc4DPOpt/gambitToFoam.o
/usr/bin/m4:stdin:15917: Warning: excess arguments to builtin `m4_ifdef' ignored
lex.yy.cc: In member function 'virtual int yyFlexLexer::yylex()':
lex.yy.cc:14036: warning: use of old-style cast
lex.yy.cc:14036: warning: use of old-style cast
lex.yy.cc:14052: warning: use of old-style cast
lex.yy.cc:14612: warning: use of old-style cast
lex.yy.cc: In member function 'int yyFlexLexer::yy_get_next_buffer()':
lex.yy.cc:14860: warning: use of old-style cast
lex.yy.cc:14883: warning: use of old-style cast
lex.yy.cc:14896: warning: use of old-style cast
lex.yy.cc:14896: warning: use of old-style cast
lex.yy.cc:14917: warning: use of old-style cast
lex.yy.cc: In member function 'yy_state_type yyFlexLexer::yy_get_previous_state()':
lex.yy.cc:14965: warning: use of old-style cast
lex.yy.cc:14965: warning: use of old-style cast
lex.yy.cc: In member function 'void yyFlexLexer::yyunput(int, char*)':
lex.yy.cc:15025: warning: use of old-style cast
lex.yy.cc:15026: warning: use of old-style cast
lex.yy.cc:15034: warning: use of old-style cast
lex.yy.cc: In member function 'int yyFlexLexer::yyinput()':
lex.yy.cc:15101: warning: use of old-style cast
lex.yy.cc: In member function 'virtual yy_buffer_state* yyFlexLexer::yy_create_buffer(std::istream*, int)':
lex.yy.cc:15181: warning: use of old-style cast
lex.yy.cc:15190: warning: use of old-style cast
lex.yy.cc: In member function 'virtual void yyFlexLexer::yy_delete_buffer(yy_buffer_state*)':
lex.yy.cc:15212: warning: use of old-style cast
lex.yy.cc:15215: warning: use of old-style cast
lex.yy.cc:15217: warning: use of old-style cast
lex.yy.cc: In member function 'void yyFlexLexer::yyensure_buffer_stack()':
lex.yy.cc:15344: warning: use of old-style cast
lex.yy.cc:15362: warning: use of old-style cast
lex.yy.cc: In member function 'void yyFlexLexer::yy_push_state(int)':
lex.yy.cc:15380: warning: use of old-style cast
lex.yy.cc:15383: warning: use of old-style cast
lex.yy.cc:15383: warning: use of old-style cast
lex.yy.cc: In function 'void* yyalloc(yy_size_t)':
lex.yy.cc:15463: warning: use of old-style cast
lex.yy.cc: In function 'void* yyrealloc(void*, yy_size_t)':
lex.yy.cc:15475: warning: use of old-style cast
lex.yy.cc:15475: warning: use of old-style cast
lex.yy.cc: In function 'void yyfree(void*)':
lex.yy.cc:15480: warning: use of old-style cast
gambitToFoam.L: In function 'int main(int, char**)':
gambitToFoam.L:685: error: expected `]' before ';' token
gambitToFoam.L:685: error: expected `]' before ';' token
gambitToFoam.L:777: error: expected `}' at end of input
gambitToFoam.L:777: error: expected `}' at end of input
gambitToFoam.L:777: error: expected ',' or ';' at end of input
gambitToFoam.L:775: warning: unused variable 'faceIndex'
gambitToFoam.L:777: error: expected `}' at end of input
make[3]: *** [Make/linuxGcc4DPOpt/gambitToFoam.o] Error 1
make[3]: Leaving directory `/home/grahn/OpenFOAM/OpenFOAM-1.4/applications/utilities/mesh/conversion/gambit ToFoam'
make[2]: *** [gambitToFoam] Error 2
make[2]: Leaving directory `/home/grahn/OpenFOAM/OpenFOAM-1.4/applications/utilities/mesh/conversion'
make[1]: *** [conversion] Error 2
make[1]: Leaving directory `/home/grahn/OpenFOAM/OpenFOAM-1.4/applications/utilities/mesh'
make: *** [mesh] Error 2

This is the output from `gcc -v':
################################
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: /var/tmp/portage/sys-devel/gcc-4.1.2/work/gcc-4.1.2/configure --prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/4.1.2 --includedir=/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include --datadir=/usr/share/gcc-data/i686-pc-linux-gnu/4.1.2 --mandir=/usr/share/gcc-data/i686-pc-linux-gnu/4.1.2/man --infodir=/usr/share/gcc-data/i686-pc-linux-gnu/4.1.2/info --with-gxx-include-dir=/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/g++-v4 --host=i686-pc-linux-gnu --build=i686-pc-linux-gnu --disable-altivec --enable-nls --without-included-gettext --with-system-zlib --disable-checking --disable-werror --enable-secureplt --disable-libunwind-exceptions --disable-multilib --enable-libmudflap --disable-libssp --enable-languages=c,c++,java,fortran --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu
Thread model: posix
gcc version 4.1.2 (Gentoo 4.1.2)
agrahn is offline   Reply With Quote

Old   June 20, 2007, 09:48
Default Looks like flex generated code
  #15
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Looks like flex generated code that gcc doesn't understand. What does

flex++ -V

say?
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   June 20, 2007, 10:03
Default It is actually flex that I am
  #16
New Member
 
Alexander Grahn
Join Date: Mar 2009
Posts: 12
Rep Power: 17
agrahn is on a distinguished road
It is actually flex that I am using.

grahn@localhost:~$ flex -V
flex 2.5.33

This is what I found in the flex info manual:

You can also use `flex' to generate a C++ scanner class, using the
`-+' option (or, equivalently, `%option c++)', which is automatically
specified if the name of the `flex' executable ends in a '+', such as
`flex++'. When using this option, `flex' defaults to generating the
scanner to the file `lex.yy.cc' instead of `lex.yy.c'. The generated
scanner includes the header file `FlexLexer.h', which defines the
interface to two C++ classes.

As Allwmake complained about missing flex++, I simply created a hardlink `flex++' pointing to `flex'.
agrahn is offline   Reply With Quote

Old   June 20, 2007, 11:09
Default Your encountering what I encou
  #17
connclark
Guest
 
Posts: n/a
Your encountering what I encountered. Some versions of flex don't like "]]". You need to edit the corresponding .L file and put a space in between the to square closing brackets making it "] ]". You will probably need to do this to a few .L files to get through the compilation.

I also see your using Gentoo (cool)

See my thread here

http://www.cfd-online.com/OpenFOAM_D...tml?1181852126
  Reply With Quote

Old   June 20, 2007, 11:26
Default Thanks, Conn, very much. Now O
  #18
New Member
 
Alexander Grahn
Join Date: Mar 2009
Posts: 12
Rep Power: 17
agrahn is on a distinguished road
Thanks, Conn, very much. Now OpenFOAM compiles till the end.

But the next problem occurs when I try to run the examples from the `Getting Started' section of the README:

grahn@localhost:~/OpenFOAM/grahn-1.4/run/tutorials/icoFoam $ blockMesh . cavity
blockMesh: error while loading shared libraries: /usr/lib/libz.so: invalid ELF header
agrahn is offline   Reply With Quote

Old   June 21, 2007, 02:23
Default I offer merge this thread & th
  #19
Member
 
Ruben I. Mukhamadeev
Join Date: Mar 2009
Location: Obninsk, Kaluga reg., Russian Federation
Posts: 69
Rep Power: 17
benru is on a distinguished road
I offer merge this thread & thread "Cumulative patch for OF-1.4" due to discussion of the same problems with code recompilation

Regards
benru is offline   Reply With Quote

Old   August 31, 2007, 03:31
Default FYI: I am compiling OF 1.4.
  #20
Senior Member
 
Srinath Madhavan (a.k.a pUl|)
Join Date: Mar 2009
Location: Edmonton, AB, Canada
Posts: 703
Rep Power: 21
msrinath80 is on a distinguished road
FYI:

I am compiling OF 1.4.1 on x86_64 as I type. I have found that using the error.C posted above results in the following compilation error:


SOURCE=graph/writers/jplotGraph/jplotGraph.C ; g++ -m64 -Dlinux64 -DDP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -march=opteron -O3 -DNoRepository -ftemplate-depth-40 -DWM_PROJECT_VERSION='"'1.4.1'"' -I/home/madhavan/OpenFOAM/OpenFOAM-1.4.1/src/zlib-1.2.1 -IlnInclude -I. -I/home/madhavan/OpenFOAM/OpenFOAM-1.4.1/src/OpenFOAM/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/jplotGraph.o
global.o: In function `Foam::getSymbolForRaw(Foam:stream&, Foam::string const&, Foam::fileName const&, Foam::word const&)':
global.C.text+0x16b0): multiple definition of `Foam::getSymbolForRaw(Foam:stream&, Foam::string const&, Foam::fileName const&, Foam::word const&)'
printStack.o:printStack.C.text+0x2c0): first defined here
/usr/bin/ld: Warning: size of symbol `Foam::getSymbolForRaw(Foam:stream&, Foam::string const&, Foam::fileName const&, Foam::word const&)' changed from 1344 in printStack.o to 913 in global.o
global.o: In function `Foam::printSourceFileAndLine(Foam:stream&, Foam::HashTable<int,> const&, Foam::fileName const&, Foam::word const&)':
global.C.text+0x2560): multiple definition of `Foam::printSourceFileAndLine(Foam:stream&, Foam::HashTable<int,> const&, Foam::fileName const&, Foam::word const&)'
printStack.o:printStack.C.text+0x800): first defined here
/usr/bin/ld: Warning: size of symbol `Foam::printSourceFileAndLine(Foam:stream&, Foam::HashTable<int,> const&, Foam::fileName const&, Foam::word const&)' changed from 3093 in printStack.o to 3361 in global.o
global.o: In function `Foam::error::printStack(Foam:stream&)':
global.C.text+0x3290): multiple definition of `Foam::error::printStack(Foam:stream&)'
printStack.o:printStack.C.text+0x1420): first defined here
/usr/bin/ld: Warning: size of symbol `Foam::error::printStack(Foam:stream&)' changed from 5959 in printStack.o to 5643 in global.o
collect2: ld returned 1 exit status

If I use the stock error.C the compilation proceeds without any problems.

NB: I built binutils and gcc from scratch, so obviously I am not missing demangle.H
msrinath80 is offline   Reply With Quote

Reply

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
OpenFOAM compilation fails on applicationsutilitiesmesh geoffjay OpenFOAM Installation 12 April 29, 2008 15:26
MergeMeshes fails on OF141 any fix hsieh OpenFOAM Bugs 3 January 29, 2008 19:31
Compilation fails on suse linux 101 su_junwei OpenFOAM Bugs 2 July 20, 2007 04:56
RunFoamX fails jvn OpenFOAM Installation 12 August 11, 2005 11:12
SOR Fails Near Walls Chih-Wei Chiu Main CFD Forum 0 May 9, 2002 01:05


All times are GMT -4. The time now is 15:52.