CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Problems compiling under 14 (http://www.cfd-online.com/Forums/openfoam-solving/59562-problems-compiling-under-14-a.html)

grtabor April 16, 2007 05:16

Dear All, I've just downloa
 
Dear All,

I've just downloaded and installed OF1.4. All existing codes (that I have tried) work fine. However I want to alter a code and recompile. I have copied oodles from the new distribution to my personal file space, altered the Make/files file to put the executable in FOAM_USER_APPBIN rather than FOAM_APPBIN, wcleaned, and tried to compile. I get a series of messages of the form:

/tmp/ccXPo0k5.s: Assembler messages:
/tmp/ccXPo0k5.s:141552: Error: unknown pseudo-op: `.weakref'


The full complilation statement is

<gavin@lutoslawski>wmake
Making dependency list for source file oodles.C
SOURCE=oodles.C ; g++ -m32 -Dlinux -DDP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-40 -I/opt/foam/OpenFOAM/OpenFOAM-1.4/src/LESmodels -I/opt/foam/OpenFOAM/OpenFOAM-1.4/src/LESmodels/LESdeltas/lnInclude -I/opt/foam/OpenFOAM/OpenFOAM-1.4/src/transportModels -I/opt/foam/OpenFOAM/OpenFOAM-1.4/src/finiteVolume/lnInclude -I/opt/foam/OpenFOAM/OpenFOAM-1.4/src/meshTools/lnInclude -I/opt/foam/OpenFOAM/OpenFOAM-1.4/src/sampling/lnInclude -IlnInclude -I. -I/opt/foam/OpenFOAM/OpenFOAM-1.4/src/OpenFOAM/lnInclude -fPIC -pthread -c $SOURCE -o Make/linuxGcc4DPOpt/oodles.o
/tmp/ccXPo0k5.s: Assembler messages:
/tmp/ccXPo0k5.s:141552: Error: unknown pseudo-op: `.weakref'
/tmp/ccXPo0k5.s:141553: Error: unknown pseudo-op: `.weakref'
/tmp/ccXPo0k5.s:141554: Error: unknown pseudo-op: `.weakref'
/tmp/ccXPo0k5.s:141555: Error: unknown pseudo-op: `.weakref'
/tmp/ccXPo0k5.s:141556: Error: unknown pseudo-op: `.weakref'
/tmp/ccXPo0k5.s:141557: Error: unknown pseudo-op: `.weakref'
/tmp/ccXPo0k5.s:141558: Error: unknown pseudo-op: `.weakref'
/tmp/ccXPo0k5.s:141559: Error: unknown pseudo-op: `.weakref'
/tmp/ccXPo0k5.s:141560: Error: unknown pseudo-op: `.weakref'
/tmp/ccXPo0k5.s:141561: Error: unknown pseudo-op: `.weakref'
/tmp/ccXPo0k5.s:141562: Error: unknown pseudo-op: `.weakref'
/tmp/ccXPo0k5.s:141563: Error: unknown pseudo-op: `.weakref'
/tmp/ccXPo0k5.s:141564: Error: unknown pseudo-op: `.weakref'
/tmp/ccXPo0k5.s:141565: Error: unknown pseudo-op: `.weakref'
make: *** [Make/linuxGcc4DPOpt/oodles.o] Error 1


I'm a bit confused about what is going wrong here - has anyone else had this experience, or can one of the OpenCFD guys comment on this? (Mattijis, anyone???) I'm running SuSE 9.2 on this workstation - I will try it on another one running 10.something in a minute.

Gavin

hjasak April 16, 2007 05:21

Seen it: the compiler you've d
 
Seen it: the compiler you've downloaded does not like your linker. All you need to do is to rebuild your own compiler and all will be well:

My gcc -v says:

wooster*149-> gcc -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../gcc-4.1.2/configure --prefix=/usr/tmp/gcc-4.1.2 --enable-languages=c,c++ --enable-shared
Thread model: posix
gcc version 4.1.2


Which will tell you how to build it. In case of trouble, bive me a buzz and we'll sort it out together.

Hrv

hjasak April 16, 2007 05:22

BTW, who is lutoslawski??? :-)
 
BTW, who is lutoslawski??? :-)

Hrv

grtabor April 16, 2007 05:50

I'm getting errors on another
 
I'm getting errors on another machine; running SuSE10.something; however they seem to be cropping up earlier:


<gavin@mahler>wmake
Making dependency list for source file oodles.C
SOURCE=oodles.C ; g++ -m64 -Dlinux64 -DDP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -march=opteron -O3 -DNoRepository -ftemplate-depth-40 -I/opt/foam/OpenFOAM/OpenFOAM-1.4/src/LESmodels -I/opt/foam/OpenFOAM/OpenFOAM-1.4/src/LESmodels/LESdeltas/lnInclude -I/opt/foam/OpenFOAM/OpenFOAM-1.4/src/transportModels -I/opt/foam/OpenFOAM/OpenFOAM-1.4/src/finiteVolume/lnInclude -I/opt/foam/OpenFOAM/OpenFOAM-1.4/src/meshTools/lnInclude -I/opt/foam/OpenFOAM/OpenFOAM-1.4/src/sampling/lnInclude -IlnInclude -I. -I/opt/foam/OpenFOAM/OpenFOAM-1.4/src/OpenFOAM/lnInclude -fPIC -c $SOURCE -o Make/linux64Gcc4DPOpt/oodles.o
cc1plus: error: unrecognized option `-Wextra'
cc1plus: error: bad value (opteron) for -march= switch
cc1plus: error: bad value (opteron) for -mcpu= switch
make: *** [Make/linux64Gcc4DPOpt/oodles.o] Error 1

I assume this is just a question of editing something in the wmake scripts...

Rebuilding my compiler sounds painful... any tips?

Witold Lutoslawski - Polish 20thC composer. Cf http://en.wikipedia.org/wiki/Lutoslawski for more details. All my computers are named after composers; hence `mahler' is a fairly weighty twin-processor Opteron box.

Gavin

grtabor April 16, 2007 05:51

For further information:
 
For further information:

<gavin@lutoslawski>gcc -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../configure --prefix=/usr/tmp/gcc-4.1.2 --exec-prefix=/usr/tmp/gcc-4.1.2 --enable-languages=c,c++ --enable-shared --enable-__cxa_atexit --disable-checking
Thread model: posix
gcc version 4.1.2

Gavin

mbeaudoin April 16, 2007 11:30

Hello, I had the exact same
 
Hello,

I had the exact same problems recompiling OpenFOAM 1.4 on an older RedHat system, even though I took the time to recompile gcc for that system beforehand.

From your error message, you can see that your local assembler ("as") is barfing on probably some of the newer assembler code that is generated by gcc 4.2.1.

I don't know why gcc 4.2.1 generates those assembler code even though it was compiled locally with the local assembler, and that the "configure" script for gcc should take care of identifying and adjusting for those "incompatibility" issues. This is probably documented somewhere on the GCC mailing list.

All of this to say that I no longer expect my local default assembler "as" and linker "ld" to be compatible with those spanky new gcc compilers that are proposed for OpenFOAM. With OpenFOAM 1.3, I had some weird linker problems, we had the "missing demangle.h" problem, and now, with OF 1.4, it is the assembler that is complaining.

That's why for now on I will always install along side my new gcc compilers the latest version of the package binutils which provides me with the latest version of "as" and "ld", demangle.h, etc.

And I make sure to adjust my PATH in order for the new gcc to pick up those "newer" versions of the binutils tools instead of the one installed by default with my workstation OS.

For your information, the whole procedure for recompiling OpenFOAM, gcc, binutils, paraview, etc is described on this OpenFOAM How-To:

http://openfoamwiki.net/index.php/Ho...mpile_OpenFOAM

This is pain, I know, but unless you upgrade your workstations to the same OS the people of OpenCFD is using, you will probably stumble on a few of those problems depending if your workstation OS is getting a tad old (like mine).

My two cents...

Martin

rafal April 16, 2007 12:10

Hi, In my opinion Hrv is righ
 
Hi,
In my opinion Hrv is right, this is version
mismatch of several tools. I got this kind
error after upgrading gcc.
I dont know SuSe too much but on Gentoo
when you change gcc you have to follow
some scheme(below). Gentoo is a project of linux
from scratch so the instructions should apply
to all linux flavours
here is the procedure adopted from gentoo:

install binutils gcc-config glibc gcc
env-update
source /etc/profile
install binutils gcc-config glibc gcc
env-update
source /etc/profile
+ emergeing system twice(dont need
on other linux types i assume)

why do you do this twice?
Well, first time you compile your toolchain
with old gcc and than you compile gcc with your
new optimized like you want gcc

on SuSe it can be differently since SuSe has
lots of binaries and nobody compiles everything
hope this helps
rafal

anger April 19, 2007 16:50

Hello, I had the same probl
 
Hello,

I had the same problem about 'weakref' as Gavin.
I'm using a Gnu/Linux machine which origins from a Kanotix installation thus is basically a Debian/Sid.
The commands
apt-get update
apt-get install binutils
resolved the problem for me.

Regards,
-Thomas

shu May 14, 2007 12:03

Under SuSe9.3 I also had this
 
Under SuSe9.3 I also had this problem. I could compile nothing. Then I deinstalled
gcc-4.1.2.linux.tgz and installed gcc-4.1.2.linux-old.tgz. After that everything is ok.


Bitan

oscar_j July 17, 2007 22:34

Hi, Im working with OpenFOA
 
Hi,

Im working with OpenFOAM-1.4 and when I try to compile a code (for example turbFoam, in turbfoam directory) I get:

bash-3.1$ wmake
Making dependency list for source file turbFoam.C
SOURCE=turbFoam.C ; g++ -m32 -Dlinux -DDP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-40 -I/home/oscarj/OpenFOAM/OpenFOAM-1.4/src/finiteVolume/lnInclude -I/home/oscarj/OpenFOAM/OpenFOAM-1.4/src/turbulenceModels -I/home/oscarj/OpenFOAM/OpenFOAM-1.4/src/transportModels -IlnInclude -I. -I/home/oscarj/OpenFOAM/OpenFOAM-1.4/src/OpenFOAM/lnInclude -fPIC -pthread -c $SOURCE -o Make/linuxGcc4DPOpt/turbFoam.o
/tmp/cc5W43cJ.s: Assembler messages:
/tmp/cc5W43cJ.s:104031: Error: unknown pseudo-op: `.weakref'
/tmp/cc5W43cJ.s:104032: Error: unknown pseudo-op: `.weakref'
/tmp/cc5W43cJ.s:104033: Error: unknown pseudo-op: `.weakref'
/tmp/cc5W43cJ.s:104034: Error: unknown pseudo-op: `.weakref'
/tmp/cc5W43cJ.s:104035: Error: unknown pseudo-op: `.weakref'
/tmp/cc5W43cJ.s:104036: Error: unknown pseudo-op: `.weakref'
/tmp/cc5W43cJ.s:104037: Error: unknown pseudo-op: `.weakref'
/tmp/cc5W43cJ.s:104038: Error: unknown pseudo-op: `.weakref'
/tmp/cc5W43cJ.s:104039: Error: unknown pseudo-op: `.weakref'
/tmp/cc5W43cJ.s:104040: Error: unknown pseudo-op: `.weakref'
/tmp/cc5W43cJ.s:104041: Error: unknown pseudo-op: `.weakref'
/tmp/cc5W43cJ.s:104042: Error: unknown pseudo-op: `.weakref'
/tmp/cc5W43cJ.s:104043: Error: unknown pseudo-op: `.weakref'
/tmp/cc5W43cJ.s:104044: Error: unknown pseudo-op: `.weakref'
make: *** [Make/linuxGcc4DPOpt/turbFoam.o] Error 1




My gcc -v says

bash-3.1$ gcc -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../configure --prefix=/usr/tmp/gcc-4.1.2 --exec-prefix=/usr/tmp/gcc-4.1.2 --enable-languages=c,c++ --enable-shared --enable-__cxa_atexit --disable-checking
Thread model: posix
gcc version 4.1.2

Could you help me?

Many thanks
Oscar


All times are GMT -4. The time now is 05:19.