Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Compiling for Apple Intel

Status
Not open for further replies.

DanSandbergUCONN

Programmer
Jun 13, 2007
14
US
Hi All -

I'm a programmer but not too familiar with Fortran 77. I have a ".f" file that compiles just fine on my windows PC and linux but using the program AbsoftTools for the Intel Mac the compiler fails after 100+ errors. I get lots of errors like

cf90-197 af90fe: ERROR MAIN, File = ../mndoci fortran code/mndoci49.f, Line = 874, Column = 73
Unexpected syntax: ", or )" was expected but found "EOS".

I feel like with this many errors on a file that compiles fine on another platform probably means I need to adjust the preferences on the AbsoftTools program.

Here are the settings I normally use:

target: MRWE application
use VAX/VMS library
FPU: round to nearest

F77:
general: 20000//1024
suppress warnings, quiet
compatability: integer*4
static storage
fold to upper case

misc: data variables are static
format: vax tab format
wide format

Any suggestions?
 
What is VAX tab format? Does it substitute spaces for tabs and does it make each tab 8 spaces?

Is there a 72 character limit on the lines? Try the following
Code:
      program main
      print *, 'It works'
      stop
      end
Build that and run it. It should say It works. Now move the stop to column 70 and build the program. If it doesn't build, you have a 72 character limit on lines.
 
The test program didn't even work! Here is the output:

Scanning...
makedepend -quiet "-pre./build/" -Y -modInfo -errdel -f "/tmp/dep1_n5DicK" -info -march=em64t -mrwe -c -w -q -N109 -info "./Untitled.f"
Scan completed
f77 -o "./build/Untitled.o" -march=em64t -mrwe -c -w -q -N109 "./Untitled.f"

program main
^
cf90-400 af90fe: ERROR $MAIN, File = ./Untitled.f, Line = 1, Column = 2
The characters found in the label field are not valid.
^
cf90-211 af90fe: ERROR $MAIN, File = ./Untitled.f, Line = 1, Column = 6
Continuation is not allowed for this statement.

f90: Copyright Absoft Corporation 1994-2006; Absoft Fortran Compiler Version 10.0b
f90fe: 4 source lines
f90fe: 2 Errors, 0 Warnings, 0 Other messages, 0 ANSI
f90fe failed.
Make:
*** Ignoring Error code 256 from f77
mkdir -p "./project.out.app/Contents/Resources"
/Developer/Tools/Rez -o "./project.out.app/Contents/Resources/project.out.rsrc" -append -d SystemSevenOrLater=1 -useDF -i "/Applications/Absoft10/RIncludes" "./mrweprefs.r"
/Developer/Tools/Rez -o "./project.out.app/Contents/Resources/project.out.rsrc" -append -d SystemSevenOrLater=1 -useDF -i "/Applications/Absoft10/RIncludes" "./project.r"
mkdir -p "./project.out.app/Contents/MacOS"
touch "./project.out.app"
touch "./project.out.app/Contents/MacOS"
/Developer/Tools/SetFile -a B "./project.out".app
f95 "./build/Untitled.o" -framework Carbon -w -Xlinker -Y -Xlinker 10 -lV77 -L"/Applications/Absoft10/lib" -lafio_carbon -lmrwe -laf90math -lafio_carbon -laf77math -lm -lamisc -labsoftmain_mrwe -o "./project.out.app/Contents/MacOS/project.out"
ERROR: File not found: ./build/Untitled.o
Make:
*** Ignoring Error code 256 from f95
 
In F77, everything needs to start from column 7.
 
Ahh. Thanks so much! Okay I successfully built the application but I can't figure out how to run it. When I use the ./project.out.app/Contents/MacOS/project.out command in the terminal window nothing happens and I get no error. When I double click the executable a window quickly opens and then closes. I do have "Pause after execution" selected under the MWRE preferences but I must still be doing something wrong. I think this is probably more of an AbsoftTools issue than a FORTRAN 77 issue but if anyone has any insight it would be much appreciated.
 
I should actually mention that when I specify that the program should be compiled as a terminal application then it works in terminal and Xcode but when I specify the file should be compiled to an MWRE then it fails.

However, the file that compiles on my PC as an executable doesn't work regardless. I'd appreciate help with either problem.

Thanks!
 
Don't know a lot about macs. What is an MWRE application? Tried looking for it on the net but came out blank.

On PCs, how are you building it? Is it something like

g77 Untitled.f

If that is the case, the executable is called a.exe. If you didn't specify a -o executable. Create a cmd prompt and run it from there. Note not command - there are 2 on Windows: cmd is 32 bit, command is 16 bit. Use the 32 bit version) prompt and run it from there.
 
Well this program AbsoftTools is a compiler. So I load the .f file and any supporting files and the compiler automatically generates the build command.

For macs the executable is .app instead of .exe. An MWRE is a mac application that has a pre-specified user interface. It is a stand-alone application so it does not require terminal or xcode.

Anyway, you were correct right off the bat about my errors. I must have 72 columns per line because any line longer than 72 characters generates an error. I'm going through the 15,000+ lines of code and addressing this problem by inserting a continuation.

Now, I do have some errors that are on lines with fewer than 72 characters but I'm hoping maybe when I finish fixing the long-lines these other errors will disappear.

I'm working on this project in collaboration with another programmer and he swears this compiles fine on his PC. I'm surprised I need to make so many changes to get it working on my Mac.

 
Before you try that have a look at the Absoft compile parameters. Is there one where you can specify your line length? I can't get the page for the compile parameters for Absoft. Could be something like -W.
 
Yes it is actually, -V -W, which specifies VAX Wide input format. Success compiling the program as a terminal application and as a stand-alone mac application! Thanks again xwb - I really appreciate the help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top