August 23rd, 2011, 02:02 PM
Compliling in Fortran
I'm having some trouble compiling with g95. I have a simple Hello World Program, shown below.
(There are six spaces in front of the top and bottom lines, and nine in front of the middle line.)
It was taken exactly from the wikibooks Fortran instruction guide. However, when I try to compile it, the assembler gives me an error:
I am using g95 for Linux x86. My operating system is Linux Mint.
Does anyone know how I can fix this and get the program to compile? Thanks!
August 23rd, 2011, 08:55 PM
Sounds like you don't have the whole compiler installed. Here's what I did using Ubuntu:
Then I typed out hello.f
sudo apt-get install gfortran
and compiled and ran it:
PRINT *, "Hello World!"
END PROGRAM hello
Maybe I should read up more on Fortran 95. I'm more familiar with F77 style code. For one thing, I would have written it as
mb@motorhead:~/fortran$ f95 hello.f -o hello
WRITE (*,*) "Hello World"
Up the Irons
What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
"Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
Down with Sharon Osbourne
"I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo
September 28th, 2011, 05:36 PM
f90 is a whole lot more fun than f77.
Originally Posted by Scorpions4ever