first time linux user, need help setting up ubuntu to write code in fortran
Hello,
I am a college student taking a class that requires programming in Fortran. I decided to install Ubuntu on an old laptop as the only operating system (both to use for fortran and to check out Linux [love it]). Ubuntu is installed, working fine as far as I can tell, and is connected to the internet and updated. Also, I found the terminal and have that pinned to the launcher. I have no real prior knowledge of Linux, but have used C and MATLAB before. I need a code editor (not even sure if that's the right term, I need something to physically write the code), a compiler, and eventually need to be able to execute my code. From Ubuntu's software center, I installed gfortran and gnuplot, which is something that I will eventually need, but need to write the code before using that. I also installed all the add-ons for both. I looked around a little in these forums for some help and also downloaded Intel's "Fortran Composer XE for Linux", which came as a .tgz file. I couldn't find anything in Intel's suite to physically install it to my machine (there's a script file labelled install, but double clicking only opens the script, it doesn't run it). Like I said, I am a first-time Linux user and am very frustrated at my lack of knowledge on the subject. If someone could help me I would be very thankful. P.S. can anyone recommend a good book on programming in fortran? Found some websites (and obv here), but I kind of want to have a book as a reference |
Quote:
Right-click on the downloaded file select Properties>>Permissions & check the box that says "allow to execute file as a program". If the file doesn't execute you have to untar manually. |
thanks. i untarred it and am installing it now
|
No need, you're making this too complicated
Composer - any text editor, take your pick. Ubuntu already has many installed, and you can install many more. Emacs, Pico, Nano, Vim, the list goes on and on...most have syntax highlighting built in for the big languages (C, C++, Fortran, etc) Compiler - you already downloaded gfortran, that's all you need Running - you already found the terminal, that's how you run it You already have everything you need. Open a terminal, create and cd into a working directory Code:
mkdir ~/programming Code:
emacs test.f90 Code:
double precision :: pi Code:
gfortran -o test test.f90 Code:
./test |
Every linux distribution comes with good vi (visual editor). So you already have a text editor.
For the compiler you noted that you have downloaded. Quote:
Quote:
|
In c and c++, we use gcc and g++ respectively at the terminal to check if the compiler is installed. Try to run a command for Fortran to check if it has been installed. For your next installation try to Install a work station, software development box and in customizing your box load it with lots of development tools including Fortran.That works for Fedora.
|
Quote:
Quote:
|
Quote:
IDEs are probably something that you will hear mentioned, but now is almost certainly not the right time, unless your course is explicitly IDE-based. Something like Eclipse (...or a derivative...) has lots of facilities, but it will just confuse the issue at a time when you are probably struggling with a lot of other new stuff. It may not even be what you want to adopt, once you have stopped struggling with the compiler, the language syntax, the environment. For 'simpler' text editors, the traditional debate (or 'flame war') has been between vi (and derivatives, such as vim, which are 'almost the same thing' from a learning point of view) and emacs. vi is probably easier to get started with and emacs offers more clever stuff once you have learnt it, but that's a very broad brush distinction. I think you'd have to say that, at this point, trying vi is a good thing, but you won't know whether you like it until you have tried something else as well. Personally, I don't use either out of preference; when there is a GUI available, I use Kate. This is a Kde program, but does run under other GUIs (eg, Gnome), but running it under another GUI does pull in a lot of kde libraries, so might not be the best choice if the PC has limited memory. When a GUI is a bad idea, or when it won't start, etc, I use Joe (Joe's Own Editor), but that's because I got used to Wordstar many years ago, and Joe is a Wordstar-alike...and the key mappings are quite nice, but I'm not sure if any of that is a sufficient argument for anyone who hasn't used Wordstar before. |
First: Thank you so much. You've helped me a hell of a lot more than my professor has.
Now I have a couple more questions if you would be so kind: I decided to say screw it and install Linux onto my newer laptop alongside Windows and I'm trying to figure out exactly which version to install. I'm going to use Fedora, mostly because everyone I know who has used Linux uses Fedora. I looked at a couple different spins, and I want to combine a couple of them together and I'm trying to figure out the easiest way how to do that. The two spins I think I want are the Scientific and Electronic-Lab spins. I downloaded both .iso's and also the non-Live Media .iso and am wondering if the non-Live Media DVD contains both spins. I know I need the Scientific so if anything I was thinking install the Scientific and then see if there's a way to download/install the second spin. Also, can anyone suggest software that will allow me to use the blu-ray drive I have (if I decide to ditch Windows I still want to be able to watch movies). I know everything in Linux is supposed to be free, but I know there are also exceptions to every rule so if it costs money, as long as it works I'm OK with that. And finally a question on the media I have on Windows. If I decide to completely get rid of Windows (I'm thinking probably in a year if I'm comfortable enough with it), is there a way to import files from the Windows partition of my hard drive (and vice-versa)? |
ok, so now I just looked at it a little bit more and saw I can install it using yum, which I'm assuming is software I can download. So it says I can install it using the following:
# yum groupinstall 'Electronic Lab' I just enter that in the terminal right? (Once I have yum installed, which I'm sure is easy). Oh and another question, other than "Linux for Dummies" (which I'm sure is helpful and I'm considering buying it), is there a book that any of you would recommend as a reference for Linux and/or Fortran? |
You are correct, the software included in all of those different "spins" can simply be installed using yum. Yum is already pre-installed in Fedora, it's the primary package management system. Nearly all of your software installation and updating will be done via yum.
Same goes for the packages you select during installation. If you miss any, you can just install them later on using yum. |
Quote:
http://rute.2038bug.com/index.html.gz |
In addition to the above, www.linuxtopia.org has more books/manuals than you'll ever need :)
|
All times are GMT -5. The time now is 03:31 PM. |