Discussion:
HELP with GFORTRAN, XCODE and TERMINAL_MAc
f***@libero.it
11 years ago
Permalink
Hi,

I downloaded gfortran, i.e.gfortran-4.9.0-Mavericks.dmg, and I run sudo rm -r
/usr/local/gfortran /usr/local/bin/gfortran on Terminal and it gives me this
message: rm: /usr/local/gfortran: No such file or directory, is it true? How
can I check if the gfortran is installed on my mac??
Moreover I have a Mac OS X Version 10.9.4 and I installed Xcode6 and also the
command line tools.
Suppose that I have a file called example.f90 (written in text, i.e. txt) how
do I run on my terminal??I tried to put this file on the directory, after
cd/Users/myname/Desktop but the message is always: no such file or directory??
Can someone help me telling all the necessary steps?

The last question: What are the steps to follow in order to write in Xcode the
right file, call it with f.90/f.95 extension and run it on terminal???

Thank you! I am in trouble!!

Francesca
FX
11 years ago
Permalink
Hi Francesca,
Post by f***@libero.it
I downloaded gfortran, i.e.gfortran-4.9.0-Mavericks.dmg, and I run sudo rm -r
/usr/local/gfortran /usr/local/bin/gfortran on Terminal and it gives me this
message: rm: /usr/local/gfortran: No such file or directory, is it true? How
can I check if the gfortran is installed on my mac??
Take a deep breath! You’ll get through this.

1. Do you have command-line tools installed already? If you type “gcc” in a terminal, what does it say?
2. Have you installed successfully installed the package inside gfortran-4.9.0-Mavericks.dmg? It should install like any other software, with Apple installer interface.
3. Once you have done that, type “gfortran” in your terminal: what does it say?
4. If step #3 fails, can you open the Console, and see if there is anything in there related to why your gfortran installer failed to set things up properly?


PS: the “sudo rm -rf …” line is to *remove* gfortran, not to install it.
Post by f***@libero.it
Suppose that I have a file called example.f90 (written in text, i.e. txt) how
do I run on my terminal??I tried to put this file on the directory, after
cd/Users/myname/Desktop but the message is always: no such file or directory??
Can someone help me telling all the necessary steps?
You need to read a short intro to the Terminal. It’s not so hard, but you need to learn the basics if you’ve never done it.
You can, for example, see here: http://blog.teamtreehouse.com/introduction-to-the-mac-os-x-command-line
Post by f***@libero.it
The last question: What are the steps to follow in order to write in Xcode the
right file, call it with f.90/f.95 extension and run it on terminal???
I have never tried Xcode/gfortran integration, but some others have. With the right settings, you can get Xcode to run pretty much any command in its build procedure.


Cheers,
FX
FX
11 years ago
Permalink
1. When I type "gcc" in my terminal, it says: "clang: error: no input files".
So you have the command line compiler tools properly installed.
2. I think yes. When I open the dog file, it gives me a pck file, I click on
this and after some minutes it says that installation is ok. Everything is done
at this point. it is right?
Yes.
3. If I type "gfortran", It says:gfortran: fatal error: no input files
compilation terminated.
So gfortran appears to have installed properly. You can now compile a simple Fortran program, saved in file cosa.f90, but typing "gfortran cosa.f90 -o cosa.exe". And you can then run the executable by typing "./cosa.exe". Both will work if your terminal shell is in the proper directory (for testing, do it in your home directory, as that's the one the gherkin so opens in by default).

It seems to me that your problems really are more related to getting used to the Terminal.
I suggest you go through one or two tutorials on Terminal, which should get you started properly.

Cheers,
FX


PS: please keep the mailing list in Cc in your replies, so others can also chime in
Continue reading on narkive:
Loading...