CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Bugs (http://www.cfd-online.com/Forums/openfoam-bugs/)
-   -   Compilation fails on Linuxx86 (http://www.cfd-online.com/Forums/openfoam-bugs/62551-compilation-fails-linuxx86.html)

agrahn March 28, 2007 07:33

The topmost error is: #######
 
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:http://www.cfd-online.com/OpenFOAM_D...part/proud.gifstream&)':
/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

henry March 28, 2007 07:38

Try again after installing dem
 
Try again after installing demangle.h which is required to compile OpenFOAM.

agrahn March 28, 2007 08:08

Henry, Is demangle.h the on
 
Henry,

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

Alexander

henry March 28, 2007 08:14

We use SuSE and demangle.h ins
 
We use SuSE and demangle.h installs automatically when the code development package is installed. I do not have any experience with Gentoo.

rafal March 28, 2007 08:42

emerge binutils should solve
 
emerge binutils
should solve the problem
rafal

agrahn March 28, 2007 08:48

Thanks, Rafal, but binutils (2
 
Thanks, Rafal, but binutils (2.16.1-r3) is already installed.

Alexander

agrahn March 28, 2007 09:13

Rafal, would you please try to
 
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

rafal March 28, 2007 09:28

demangle.h is a part of the sy
 
demangle.h is a part of the sys-devel/binutils.
I untar it and in /include there is demangle.h
rafal

rafal March 28, 2007 09:40

I assume (didnt test) that unt
 
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 http://www.cfd-online.com/OpenFOAM_D...part/happy.gif

agrahn March 28, 2007 09:50

demangle.h is indeed part of t
 
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 ]

:---(

mattijs April 26, 2007 05:59

About missing demangle.h : att
 
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).

http://www.cfd-online.com/OpenFOAM_D...hment_icon.gif 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.

lr103476 May 8, 2007 08:37

Hi Mattijs, I replaced the
 
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:http://www.cfd-online.com/OpenFOAM_D...part/proud.gifstream&)':
/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

henry May 8, 2007 09:23

The error.C file Mattijs poste
 
The error.C file Mattijs posted is for OpenFOAM-1.4.

agrahn June 20, 2007 05:03

Thanks, Mattijs, for providing
 
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)

gschaider June 20, 2007 09:48

Looks like flex generated code
 
Looks like flex generated code that gcc doesn't understand. What does

flex++ -V

say?

agrahn June 20, 2007 10:03

It is actually flex that I am
 
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'.

connclark June 20, 2007 11:09

Your encountering what I encou
 
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 http://www.cfd-online.com/OpenFOAM_D...part/happy.gif (cool)

See my thread here

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

agrahn June 20, 2007 11:26

Thanks, Conn, very much. Now O
 
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

benru June 21, 2007 02:23

I offer merge this thread & th
 
I offer merge this thread & thread "Cumulative patch for OF-1.4" due to discussion of the same problems with code recompilation

Regards

msrinath80 August 31, 2007 03:31

FYI: I am compiling OF 1.4.
 
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:http://www.cfd-online.com/OpenFOAM_D...part/proud.gifstream&, Foam::string const&, Foam::fileName const&, Foam::word const&)':
global.Chttp://www.cfd-online.com/OpenFOAM_D...lipart/sad.gif.text+0x16b0): multiple definition of `Foam::getSymbolForRaw(Foam:http://www.cfd-online.com/OpenFOAM_D...part/proud.gifstream&, Foam::string const&, Foam::fileName const&, Foam::word const&)'
printStack.o:printStack.Chttp://www.cfd-online.com/OpenFOAM_D...lipart/sad.gif.text+0x2c0): first defined here
/usr/bin/ld: Warning: size of symbol `Foam::getSymbolForRaw(Foam:http://www.cfd-online.com/OpenFOAM_D...part/proud.gifstream&, 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:http://www.cfd-online.com/OpenFOAM_D...part/proud.gifstream&, Foam::HashTable<int,> const&, Foam::fileName const&, Foam::word const&)':
global.Chttp://www.cfd-online.com/OpenFOAM_D...lipart/sad.gif.text+0x2560): multiple definition of `Foam::printSourceFileAndLine(Foam:http://www.cfd-online.com/OpenFOAM_D...part/proud.gifstream&, Foam::HashTable<int,> const&, Foam::fileName const&, Foam::word const&)'
printStack.o:printStack.Chttp://www.cfd-online.com/OpenFOAM_D...lipart/sad.gif.text+0x800): first defined here
/usr/bin/ld: Warning: size of symbol `Foam::printSourceFileAndLine(Foam:http://www.cfd-online.com/OpenFOAM_D...part/proud.gifstream&, 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:http://www.cfd-online.com/OpenFOAM_D...part/proud.gifstream&)':
global.Chttp://www.cfd-online.com/OpenFOAM_D...lipart/sad.gif.text+0x3290): multiple definition of `Foam::error::printStack(Foam:http://www.cfd-online.com/OpenFOAM_D...part/proud.gifstream&)'
printStack.o:printStack.Chttp://www.cfd-online.com/OpenFOAM_D...lipart/sad.gif.text+0x1420): first defined here
/usr/bin/ld: Warning: size of symbol `Foam::error::printStack(Foam:http://www.cfd-online.com/OpenFOAM_D...part/proud.gifstream&)' 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


All times are GMT -4. The time now is 04:48.