Gfortran
By Daisy at Thu, Jun 21 2007 11:27am |
Hi
I just installed gfortran in my mac intel using your xcode/gfortran plugin.
When I tried to compile a test program on the terminal, I get this message:
gfortran: error trying to exec 'as': execvp: No such file or directory
Can anyone tell me what to do?
P.S. I had an old gfortran version that worked fine but was lost when the IT guy re-installed my system!



Re: Gfortran
Hi,
This usually means that the other developer tools aren't installed. For example if you type:
which gcc
at a prompt, what does it return? If it can't find anything, then you need to install the Xcode 2.4 on your system.
Let us know if that works,
Dave
Gfortran
Hi Dave
Thanks a lot.
I re-installed xcode and everything is working ok.
Daisy
Gfortran
Hi Dave
Thanks a lot.
I re-installed xcode and everything is working ok.
Daisy
gfortran
Hello,
I am totally an alien in mac world and I need help.
Despite of all FAQ and forums, I don't know how to install gfortran.
Thank you in advance.
AK
Curious little fortran question
I have a seemingly simple issue…
My initial goal was to get some python libraries and this has led me down an unwieldy road; I have now installed gcc and gfortran. The curious thing is that while in terminal “which gcc” or “gfortran” directs me to:
/usr/bin/gcc etc.
Shouldn’t this be: /usr/local/bin/gcc ?
I understand I can have multiple copies of these compilers but am worried that other programs will have issues locating the correct compiler. Is there a way to fix this or is this not a problem? Thanks very much.
Jon
Re: Curious little fortran question
Hi Jon,
If you have Xcode installed, then this is probably the gcc you are seeing. If you type which gfortran, that should point to the one in /usr/local/bin, assuming /usr/local/bin is in your default PATH variable. If not, you can add it. If you want to override which gcc is called you can either modify your path (not recommended), explicitly alias gcc to the one in /usr/local/bin or always use the full path to that specific gcc when compiling code.
Hope that helps,
Dave
line continuations for fixed format fortran
I have just gotten xcode (2.4) and the gfortran plugin installed and successfully ran a small test program. But when I try and bring in some of the fortran 77 fixed format code from my pc, I think I am running into issues with the line continuation in column 6.
My simple code looks something like this: (I put in dashes where I have spaces)
------program test
c
------REAL*8 krho, !rate of radical entry (1/s)
-----1 kp, !rate of propagation (L/mol/s)
-----2 fc, !frequency of term by comb in particles (1/s)
-----3 ktw !rate of water termination (L/mol/s)
------COMMON/params/krho,kp,fc,ktw
c
------krho = 8.3D0
------write(*,*)'Hello World'
c
------return
------end
The error that I receive is for each of the line continuations (1,2,3) and are of type 1. I tried all sorts of different spacing and tabbing widths, but nothing solved the problem. The error syntax is as:
/test/main.f:3.24:
REAL*8 krho, !rate of radical entry (1/s)
1
Error: Syntax error in data declaration at (1)
/test/main.f:4.7:
1 kp, !rate of propagation (L/mol/s)
1
Error: Unclassifiable statement at (1)
/test/main.f:5.7:
etc.
I miss the green background on column 6 in my visual fortran on the pc to set this column apart. Are there some settings I can change or something I am missing to get this code to work? I look forward to be able to run my programs on my mac!
Thanks very much!
line continuations for fixed format fortran
Hi Mary_tee,
did you try the F90 style line continuation with an ampersand (&) as the last sign? This did it for me when I moved my code over to gfortran.
Your code should look like this:
------REAL*8 krho, & !rate of radical entry (1/s)
-------kp, & !rate of propagation (L/mol/s)
-------fc, & !frequency of term by comb in particles (1/s)
-------ktw !rate of water termination (L/mol/s)
------COMMON/params/krho,kp,fc,ktw
And maybe you might want to convert those COMMONs into modules ...
Good luck!
Peter
how to install gfortran
Hi,
you downloaded the installer and let it do it's job, right?
Depending on your version of XCode, you need to pick the fitting version in the installer. Please let us know what exactly you have (version of OS and developer tools) and what you want, then we might be able to help you.
Regards,
Peter