CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

Fortran error

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 8, 2005, 23:59
Default Fortran error
  #1
ty
Guest
 
Posts: n/a
Dera CFD Forum users,

I get the following error when I ran my program on Fortran which was being complied well before, on Linux

[

/opt/intel_fc_80/lib/for_main.o: In function `main': /opt/intel_fc_80/lib/for_main.o(.text+0x1c): undefined reference to `MAIN__'

]

make: *** [-----] Error 1

Can anyone suggest what the error could be, Ty
  Reply With Quote

Old   December 9, 2005, 13:20
Default Re: Fortran error
  #2
vasanth
Guest
 
Posts: n/a
Hi

I would try

> make clean or rm all the .o and .MOD files

and then try

>make

see if this works and let me know if it does not

Vasanth
  Reply With Quote

Old   December 12, 2005, 10:33
Default Re: Fortran error
  #3
zonexo
Guest
 
Posts: n/a
maybe u need to define some libraries static or dynamic ... just a guess
  Reply With Quote

Old   December 12, 2005, 19:16
Default Re: Fortran error
  #4
ty
Guest
 
Posts: n/a
Thank you for the responses, I was away for the weekend and apologise for not responding in time,

As Vasaneth suggested I deleted all .o files in the program files directory, I didn't come across any .MOD files, where are they found? or are they just .o files. The only .MOD files I come across resides in the directory created when the fortran was installed, and are delete / write protected. I don't have adminstrative permission to delete them yet, system files. Deleting .o didn't help, they are created again and the same error message, and I couldn't yet get a reference what Error 1 could be rectified.

Regarding zonexo's suggestion where do I define static/dynamic libraries, in the makefile listing, can you clarify or advise a refernce I could refer to?

Thanks in advance,

ty
  Reply With Quote

Old   December 13, 2005, 09:11
Default Re: Fortran error
  #5
Renato
Guest
 
Posts: n/a
Your error message seems that the compiler is not finding your main program file...

First of all, try to compile your program by hand and without any optimizations. I guess you've been using Intel Fortran compiler, thus:

ifort -c *.f

ifort -o ProgName *.o

NOTE: don't forget that you have to compile your modules first(because of the dependencies)

I've already had this kind of message and the problem was just a lack of the -c keyword in the compiling line... I know that it's a silly thing... but happens ;o)

regards

Renato.
  Reply With Quote

Old   December 15, 2005, 21:08
Default Re: Fortran error
  #6
ty
Guest
 
Posts: n/a
Thankyou,

I now get the error. On one of the programs listings I accidentally put a dot(.) and that was the source of the error. I find it by the "diff -r fn1 fn2" linux command, by comparing my working file with the backed-up file, to get what change was made on the new file. Thankyou anyway guys, your suggestions lead me to many investigations and learning process.

But fortran compiler is annoying, it should have instead pointed out by saying on this line --- there was such and such errors etc, . that is surprising or I don't know if I failed to use the right compilation procedure to get such message, as Renato suggested, i.e. file by file compiling. thx

ty
  Reply With Quote

Reply


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
Compile calcMassFlowC aurore OpenFOAM Programming & Development 13 March 23, 2018 08:43
Accessing phi from a fvPatchField at same patch johndeas OpenFOAM 1 September 13, 2010 21:23
[Netgen] Installation of Netgen in SuSE Linux 92 edvardsenpriv OpenFOAM Meshing & Mesh Conversion 23 January 16, 2009 07:12
How to get the max value of the whole field waynezw0618 OpenFOAM Running, Solving & CFD 4 June 17, 2008 06:07
user defined function cfduser CFX 0 April 29, 2006 11:58


All times are GMT -4. The time now is 12:50.