CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Installation (http://www.cfd-online.com/Forums/openfoam-installation/)
-   -   crt1.o error when compiling OF (http://www.cfd-online.com/Forums/openfoam-installation/123806-crt1-o-error-when-compiling.html)

Tobi September 21, 2013 12:51

crt1.o error when compiling OF
 
Hi all,

I want to compile OF with gcc-4.7.3 and some flags.
The first compilation works good (standard flag -O3) but the second compilation is not working. Flags are:
Code:

-pipe -O2 -march=bdver1 -mtune=bdver1
After starting Allwmake I get the following error:
Code:

/usr/bin/ld: cannot find crt1.o: No such file or directory
/usr/bin/ld: cannot find crti.o: No such file or directory


What I did is to create a symbolic link that is mentioned here: http://stackoverflow.com/questions/6...ot-find-crt1-o

Its not working. The files are available in /usr/lib64/

How can I manage that?
Or is it due to gcc-4.7.3 ?

Tobi September 22, 2013 09:06

Hi all,

first problem solved.
I had to export the x86_64 libs path into the LIBRARY_PATH variable like:

Code:

LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:$LIBRARY_PATH
export LIBRARY_PATH

Now this error is gone but I still have problems with /usr/bin/ld like:
Code:

/usr/bin/ld: cannot find -lgcc
/usr/bin/ld: cannot find -lgcc_s

/usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libc.so when searching for -lc
/usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libc.a when searching for -lc

I think that OF is not compiling well :( although the OF librarys and binaries are build now...


Does that depend on the Gcc-4.7.3 version?

Tobi September 22, 2013 09:09

I think I know the error! The first line which I compile is:
Code:

gcc -m32 -Wall -O2 ...
I should have -m64 not -m32. ?

I made a copy fault: linuxGcc47 into linux64Gcc47_v2 :D

wyldckat September 22, 2013 13:24

Hi Tobi,

Sorry, I didn't manage to answer you yesterday. I'm glad that you figured it out.

And yes, with OpenFOAM, usually the errors regarding "crt1.o" and "crti.o" are due to inconsistencies in using the compilers. In this case, you were probably having a conflict between the objects available in the Scotch library (the same build is used for all "linux64"), versus the ones being built on OpenFOAM.

Best regards,
Bruno

CFDUser_ July 30, 2014 08:45

Hi Tobi and Bruno,

I am getting the same error. Actually I dont have access to admin. I should manage as user for ma hpc. Can you people guide me to rectify this error?

As tobi said I dont know where to put -m64 insted of -m32

Thanks & Regards
CFDUser_

CFDUser_ July 30, 2014 11:54

Quote:

Originally Posted by Tobi (Post 452968)
I think I know the error! The first line which I compile is:
Code:

gcc -m32 -Wall -O2 ...
I should have -m64 not -m32. ?

I made a copy fault: linuxGcc47 into linux64Gcc47_v2 :D

Hi Tobi,

I badly in need to solve this problem. Thank god that you are online. If you are free can you guide me where should I change permissions?


CFDUser_

wyldckat August 4, 2014 13:37

Greetings CFDUser_,

I hope you don't mind, but I'll quote part of the message you sent me over private message:
Quote:

I have a hpc with user rights. I have one solver compiled in admin system. I found some bugs in the solver and corresponding libs. So I tried to compile in my user account.

Even though it is straight forward by compiling to FOAM_USER_LIBBIN and FOAM_USER_APPBIN, compiling libs unable to find depended libs in FOAM_USER_LIBBIN.

I have exported LD_LIBRARY_PATH and verified in LD_LIBRARY_PATH's list. Path is there but still could not find the dependent libs.

To get-ride of this error I have specified searchable path to compile libs(-L$(FOAM_USER_LIBBIN)) and succesfully compiled remaining libs.

But the same thing is not working for compiling solvers. In-fact it is working to find dependent libs but getting new problem called cannot find crt1.o and crti.o.
As I mentioned in the previous post of mine, issues with "crt*.o" are usually due to conflicts between the compiler originally used to build the original libraries and the compiler currently being used.

Several days have passed since you asked about this, so I don't know if you've managed to solve this issue or not. If you haven't, please provide as many details as you can, such as:
  • Which version of OpenFOAM is in the machine you're using?
  • Which Linux Distribution is being used?
  • Do you know how that version of OpenFOAM was installed?
  • What does this command give you?
    Code:

    uname -m
  • What exact steps did you take to compile the libraries and applications on your user folder?
Best regards,
Bruno

CFDUser_ August 5, 2014 00:03

Thanks Bruno for the reply. Some how I managed to compile. Still I believe there is something wrong in ma system. Any way there is no compilation problem now. I will get back to you with the details you asked. Currently I don't have access to send.

Regards,
CFDUser_


All times are GMT -4. The time now is 14:40.