This forum has been archived. All content is frozen. Please use KDE Discuss instead.

starting to write FORTRAN codes...how in KDE?

Tags: None
(comma "," separated)
sedo_5
Registered Member
Posts
23
Karma
0
OS
Hi everyone!

For a number of reasons, I have to write some Fortran codes and, being a Kde user (I currently use Sabayon Linux), I would like to use KDevelop as first option (since I've used it rarely for some C++ coding). Of course, if not possible I would consider other ways.
The problem is that I know almost nothing about both Kdevelop and Fortran.
As far as I've understood, reading here and there on the internet, Kdevelop isn't directly able to act as a good IDE for Fortran programming, but can compile and debug these codes if some libraries and compilers are set/installed (anyway I've heard that this could not be that straightforward).
Now, I understand that one could use even a simple text editor to write the code and then compile it from the terminal...but I'd really prefer to use an IDE.
So, as far as I know, the choices are:
1) downloading a third part compiler like the ones offered for free by Intel and Oracle --> question: do they also come with an IDE?
2) write the code on a text editor and using a compiler on the terminal --> question: what do I need to compile a Fortran code? (can you also tell me the packages name, either if you use Sabayon like me or any other distro?)
3) trying to use Kdevelop (preferred choice for me, but I've heard it's not a simple task to perform, since it's not well suited for Fortran...I hope some of you can contradict me!) --> question: how to do that?
4) using other suggested IDEs which could be better suitable for Fortran (Eclipse, Code:Blocks,...) --> question: which packages do I need?
5) probably the most important question: do you have any personal experience and suggestion? hearing some hints from someone that has already solved the problem could allow me to start as easily as possible...

Thank you all in advance
Renzo
User avatar
scummos
Global Moderator
Posts
1175
Karma
7
OS
Hi!

I've no idea about fortran, but I can tell you that KDevelop doesn't do anything special there. Using KDevelop for fortran is about the same as using kate, except for a few different buttons (build, launch etc, which you could get to actually build and launch your application indeed).

Greetings


I'm working on the KDevelop IDE.
User avatar
Hans
Administrator
Posts
3304
Karma
24
OS
I've done some work in Fortran (it's quite common in the science world). For my projects I didn't see any benefits with an IDE. so I just used my preferred text editor (vim) with some plugins. Which features are you looking for in an IDE?

1. As far as I know, the Intel compiler doesn't come with an IDE. Don't know about Oracle.
2. The GNU Fortran (gfortran) compiler is free and should be available from your package manager. I think you can download the Intel Fortran compiler (ifort) from Intel's homepage.
3-4. No idea.
5. If I were you I would start with Kate + gfortran and see how it works. There's a build plugin you can use (see settings) if you want a quick way to compile your code.


Problem solved? Please click on "Accept this answer" below the post with the best answer to mark your topic as solved.

10 things you might want to do in KDE | Open menu with Super key | Mouse shortcuts
sedo_5
Registered Member
Posts
23
Karma
0
OS
Ok, I gotta say that you convinced me in using just Kate + gfortran !
I've only been using Kate as a text editor, now I realize it has so much potentials, especially for programming!
I'm going to make some tests soon, I'll let you know if I encounter some problem with this method...(I'm a real newbie in fortran!)

Well, probably Kdevelop would give a better environment when programming, but for not so complex codes I think Kate would do more than fine!

PS: anyway, if someone else has some suggestions about using kdevelop instead of kate...let me know

Thanks
Renzo
User avatar
scummos
Global Moderator
Posts
1175
Karma
7
OS
Although I'm working for KDevelop myself I don't see what it would give you here over kate. A build plugin is available for kate too, and that's basically all you need. I don't really see a point in using KDevelop here, except if you want quickopen for just files or so. Try it out, but personally I don't think it's worth much.

The text editor is the same anyway for both applications, KDevelop will just give you a different set of toolbars (with largely non-functional buttons in this case).

Cheers


I'm working on the KDevelop IDE.
sedo_5
Registered Member
Posts
23
Karma
0
OS
ok, I'm trying to work with kate and I have to say that the number of plugins/extension make it very similar to a full IDE! I'm very impressed!
Anyway, just to complete this thread (so I can edit it to "Solved"), can you make a simple example how to practically compile a program in fortran?
I mean, even something very similar like "2+2=4", telling me the steps to compile it (with gfortran) , just to assure I have all I need and to test if it works.

PS: I've found a good list of examples (here http://en.wikibooks.org/wiki/Fortran/Fortran_examples and also other files from internet) but I've had some difficulties in compiling them...

thanks (and sorry for the stupid question...)
User avatar
Milian Wolff
KDE Developer
Posts
61
Karma
1
OS
I also did some Fortran work recently and used KDevelop for it. The main reason was that when you use CMake you get all the glory project management features and can easily run/debug it from within KDevelop. Here's a simple CMakeLists.txt that should help you get started:

Code: Select all
cmake_minimum_required(VERSION 2.8)
enable_language(Fortran)

project(MyProject)

add_executable(myExe myFile.f90)


current KDE projects: Quanta, KDevelop, Kate
ztdep
Registered Member
Posts
1
Karma
0
I think you can try codeblock. It support fortran with an IDE.
fsanchez
Registered Member
Posts
1
Karma
0
Milian Wolff wrote:I also did some Fortran work recently and used KDevelop for it. The main reason was that when you use CMake you get all the glory project management features and can easily run/debug it from within KDevelop. Here's a simple CMakeLists.txt that should help you get started:

Code: Select all
cmake_minimum_required(VERSION 2.8)
enable_language(Fortran)

project(MyProject)

add_executable(myExe myFile.f90)


Hi! I've been programming Fortran using Kate + ifort for about 5 years, and I never knew this. Thank you, this simple comment has helped a lot.

For other people who see this, I only want to add that if you are using Intel compiler, you also need to add the following flag in the project configuration:

-Wl,-rpath /path/to/intel/binaries


otherwise, an error claiming for missing libraries will appear.

Regards.


Bookmarks



Who is online

Registered users: Bing [Bot], claydoh, Google [Bot], rblackwell