CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   recompilation OF 1.5 applications libstdc++.so (https://www.cfd-online.com/Forums/openfoam/64337-recompilation-1-5-applications-libstdc-so.html)

jamba May 7, 2009 11:29

recompilation OF 1.5 applications libstdc++.so
 
Hi all,

I have a problem recompiling OpenFOAM applications. The error message I keep getting is
----------------------
/home/pc/OpenFOAM/ThirdParty/gcc-4.3.1/platforms/linux64/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.3.1/../../../../lib64/libstdc++.so: file not recognized: File format not recognized
collect2: ld returned 1 exit status
make: *** [/home/pc/OpenFOAM/OpenFOAM-1.5/applications/bin/linux64GccDPOpt/interFoam] Error 1

--------------------------
I run OpenSuSE + my gcc version is 4.3.1 on the home direc and the 4.3.1 that comes in Third Party software with OF

Thanks a lot for your help!
Jamba

arnaud.pere May 6, 2010 07:09

Same problem on Suse x64 with OpenFoam 1.6.x snapshot
 
Hello, as I am facing exactly the same problem on another platform and another OpenFoam version, I was wondering if you got an answer on this ?

My version :
Linux 2.6.16.60-0.21-smp #1 SMP Tue May 6 12:41:02 UTC 2008 x86_64 x86_64 x86_64 GNU/Linux

I get several times the folowing linkage error :

gcc-4.3.3/platforms/linux64/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.3.3/../../../../lib64/libstdc++.so: file not recognized: Format
de fichier non reconnu
collect2: ld returned 1 exit status

Any clues anyone ?

wyldckat May 6, 2010 22:02

Greetings Arnaud,

There are multiple solutions for that problem. The main issue lies on a conflict of available tools, namely OpenFOAM's pre-built gcc 4.3.3 and (I'm guessing) openSUSE's gcc 4.4.1.

Solution 1 - Swapping gcc 4.3.3 libraries for the system libraries - run these commands (advice: one by one, just in case... because none of them should complain with errors):
Code:

cd ~/OpenFOAM/ThirdParty-1.6/gcc-4.3.3/platforms/linux/lib
mv libstdc++.so.6 libstdc++.so.6.orig
ln -s `locate libstdc++.so.6.0 | grep "^/usr/lib" | head -n 1` libstdc++.so.6
mv libgcc_s.so.1 libgcc_s.so.1.orig
ln -s `locate libgcc_s.so. | grep "^/lib" | head -n 1` libgcc_s.so.1

Solution 2 - Rebuilding gcc 4.3.3 - follow the posts starting on this post: OpenFoam Installation in Redhat Enterprise linux 5 post #4

Solution 3 - Using the system's gcc 4.4.? - gcc-4.4 and above... post #7

Best regards,
Bruno

arnaud.pere May 7, 2010 05:24

Well, no luck
 
Hello, thank you for your reply !

First point, my platform is not an OpenSuse but a Suse Enterprise 10.2 :
Code:

> cat /etc/SuSE-release
SUSE Linux Enterprise Server 10 (x86_64)
VERSION = 10
PATCHLEVEL = 2

So that the system compiler is GCC 4.1.2 (quite old I'm afraid)


So as you can guess, I was using the compiler provided in Thirdparty (gcc 4.3.3)
  1. I had already tried the first method but only with the first library which did not work at all. So I tried with the two suggested : the result is exactly the same as previously posted.
  2. I had already tried to recompile gcc provided with thirdparty from source (I'm currently using a binary version because I couldn't manage to make the compilation work and didn't have enough time to check why. Maybe I should give a look again.
  3. As you can see, my system compiler is far too old and complains about many errors newer versions wouldn't. This can't work for me.
Well, this looks like a deadend if I can't manage to compile the right version of gcc from scratch. :(
In parallel, collegues are going to try compilation on the latest OpenSuse and if success we will migrate this "old" Suse Enterprise server to OpenSuse

wyldckat May 7, 2010 15:43

Greetings Arnaud,

OK, then might I suggest following the instructions at this thread, more specifically posts #13 and #18. Those posts have instructions to fix OpenFOAM's MPFR and a tweaked makeGcc script for strict x86_64 compiling of gcc :) The surrounding posts could also have vital information for you!

And even if your SuSe box is a bit old, it can still crank up the speed on the latest OpenFOAM ;)

Good luck and keep us posted on your efforts!

Best regards,
Bruno

arnaud.pere May 10, 2010 11:21

Hello again,
Well, things are in progress...

Thanks for the redirection to previous post : this helped me a lot and I could successfully compile gcc 4.3.3 & co !
Currently, OpenFoam is being compiled (started a bit less than an hour ago, but still no errors, so I would say it's going better than before)
In the meantime, I tried briefly to compile paraview but did get a "cmake not found" error : I'm going to check in previous posts if I can find a clue.

I'l let you know how this goes

wyldckat May 10, 2010 11:34

Greetings Arnaud,

You can get a pre-built cmake from the 32 bit binary package of ThirdParty. Just unpack the file ThirdParty-1.6.linuxGcc.gtgz the same way you did the other packages, and you'll get cmake good to go... or so I hope. Well not quite, since you will also need to install a package that could be named ia32libs (it's the name in Ubuntu, I'm not sure what is its name in SuSe :() for it to run. It provides libraries for running 32 bit applications in 64bit Linux boxes.
Or you could download the cmake source from www.cmake.org and build it. Paraview 3.6.1 needs at the very least "cmake 2.6.4".

Also, you can follow this thread: New user needs help - it provides a very step-by-step on how to install Qt 4.3.5 + Paraview.

Best regards,
Bruno

arnaud.pere May 10, 2010 12:45

Well, we are progressing :

Now openfoam compiles successfully ! Great step forward ! Thanks for your help again !
Paraview compiles successfully too, I get the splash screen on start, but that's all : segmentation fault before anything else happens.

wyldckat May 10, 2010 12:55

I think your SuSe is running in French or similar. In other words, you possibly need the trick for forcing standard English:
Code:

export LC_ALL=C
You can add this code line to the script paraFoam, somewhere before paraview is called, preferably just after the first large block of comments.

The second possibility, is that PV3FoamReader needs to be rebuilt.

If it still crashes, another possibility is that there is a clash of loaded libraries. Try running paraview directly form it's binary folder "OpenFOAM/ThirdParty-1.6/paraview-3.6.1/platforms/linux64/bin/", but without the OpenFOAM environment being active/sourced! If it runs, the guilty party is library clashes. Somehow, OpenFOAM and Paraview probably weren't built with the same gcc version.

Good luck!

Bruno

arnaud.pere May 10, 2010 13:11

You reply too fast !
I had juste found previous messages from you on another post : http://www.cfd-online.com/Forums/ope...ion-fault.html

=> As it's a Suse french version, I tried the LC_LANG => no luck
=> I'm not sure if I used the system compiler ou openfoam's to compile paraview and saw this could have an effect => currently trying to fix this... and... yes, it works !!!

Thanks again for all your help
Best regards,
Arnaud

wyldckat May 10, 2010 13:17

You're welcome :) I'm glad it's working now :)

Best regards,
Bruno


All times are GMT -4. The time now is 09:32.