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

Compiler problem?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 10, 2011, 03:08
Question Compiler problem?
  #1
New Member
 
N/A
Join Date: Jul 2010
Posts: 29
Rep Power: 16
kamakura117 is on a distinguished road
Hello kind folks,

I am experiencing an issue that it fairly irritating, and I have been unable to resolve it after clearing out all my libraries and completely reinstalling the system compilers. I am using Ubuntu 10.10, and have previously installed openFOAM just fine on another machine. Even further, openFOAM actually runs just fine - at least with the tutorials and simple problems that I am currently learning on. Now, the problem that I am having is the following:

When I open up the terminal, I get this error:

/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: ld returned 1 exit status

It indicates to me, that the main() function is not being called properly; however, I can't find much information on what crt1.o is in the first place. Also, if I remove the openFOAM related commands in the .bashrc, I am free of this problem.

Any help would be appreciated. While I am successfully running openFOAM, it is very annoying to know that there is some hidden incompatibility.

Many thanks in advance.
kamakura117 is offline   Reply With Quote

Old   April 10, 2011, 05:55
Default
  #2
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings Jesse,

That is very odd. OK, lets try and debug this:
  1. Are you 100% certain that this error occurs as soon as you start the terminal? Or is it when you run a command?
  2. The file "crt1.o" is an object that is prepended to an executable being built. Basically that error message usually occurs if a person tries to build an OpenFOAM library using:
    Code:
    wmake
    instead of
    Code:
    wmake libso
  3. Quote:
    Also, if I remove the openFOAM related commands in the .bashrc, I am free of this problem.
    You have more than one command? What exactly do you have in ".bashrc" that is related to OpenFOAM? Or in other words, what commands, other than sourcing OpenFOAM's "bashrc" (the line that start with dot-space or the command source), do you have in ".bashrc" that is related to OpenFOAM?

To be clearer on point 3, the only command line I expect to be in ".bashrc" is something like this:
Code:
. /opt/openfoam171/etc/bashrc
(notice the dot-space before '/') - or this:
Code:
source /opt/openfoam171/etc/bashrc
Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   April 10, 2011, 10:52
Default
  #3
New Member
 
N/A
Join Date: Jul 2010
Posts: 29
Rep Power: 16
kamakura117 is on a distinguished road
Hi Bruno,

1. I am absolutely sure that it is when I open the terminal window.
2. Right, and that's what is confusing. I am not building anything; however, I did have this error when I both installed the Debian package and built it myself.
3. I am sourcing the bash file and setting the environmental variables that were required for running openFoam, since I preferred installing it elsewhere. Now, I reverted back to the Debian package installer, since I imagine that is the convention.

The dot has been noticed. Again, openFoam actually operates just fine on this machine; it's just that I have this terminal error - induced only by the bashrc source.

Many thanks,
kamakura117 is offline   Reply With Quote

Old   April 10, 2011, 14:38
Default
  #4
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi Jesse,

This feels familiar... it seems similar to this thread: http://www.cfd-online.com/Forums/ope...g-anymore.html

The only thing I can think of doing next would be to use a divide-and-conquer strategy for isolating which command inside bashrc or settings.sh (sourced by bashrc) at the OpenFOAM folder is triggering that error.

Wait, now thank I think about, the only executable that I know that is called from settings.sh is mpicc, if you are using the SYSTEMOPENMPI option. It's used to figure out where are the libraries and include folders for OpenMPI. They are:
Code:
mpicc --showme:compile
mpicc --showme:link
The other possibility is the script "openfoam-*/etc/apps/paraview3/bashrc", where it tries to verify if ParaView is installed where it's expected.

Other than these, you'll have to isolate by hand where the problem is. I usually use commands to print location messages, like these:
Code:
echo "Got here 01"
...
(some code)
...
echo "Got here 02"
Best regards and good luck!
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   April 10, 2011, 17:51
Default
  #5
New Member
 
N/A
Join Date: Jul 2010
Posts: 29
Rep Power: 16
kamakura117 is on a distinguished road
Alright, I will give it a go with a different MPI package and see how that goes. One of my machines use MPICH2 and the other MPI-LAM.

If that's not the case, I'll just continue debugging or eventually just image the other HDD. :-)

Cheers,

Jesse
kamakura117 is offline   Reply With Quote

Reply

Tags
compiler, crt1.o


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
ATTN ALL: SOLUTON TO UDF COMPILE PROBLEM Rizwan Fluent UDF and Scheme Programming 40 March 18, 2018 07:05
Can I solve this problem by Fluent? Kai_kc FLUENT 1 October 27, 2010 06:29
natural convection problem for a CHT problem Se-Hee CFX 2 June 10, 2007 07:29
Adiabatic and Rotating wall (Convection problem) ParodDav CFX 5 April 29, 2007 20:13
Is this problem well posed? Thomas P. Abraham Main CFD Forum 5 September 8, 1999 15:52


All times are GMT -4. The time now is 16:26.