PDA

View Full Version : Compile a fortran program with KDevelop



jeneverboy
March 12th, 2009, 11:50 PM
hi
I am used to program with fortran in windows. Now I want to program FORTRAN with KDevelop. The problem is that I dont have any idea how this works in LINUX. Does anyone know a good introduction from the beginning to this? Thanks!

monkeyking
March 13th, 2009, 01:03 AM
Do you need help setting up kdev to use a fortran compiler?
Or do you need to install a fortran compiler?

jeneverboy
March 13th, 2009, 10:16 PM
Isn't KDevelop a compiler?

I would like to compile with KDev, if it is possible. Just like you would do with visual in windows.

Also the makefile-thing isnot clear to me. But I saw that on an other forum topic.

jimi_hendrix
March 13th, 2009, 10:35 PM
Isn't KDevelop a compiler?

I would like to compile with KDev, if it is possible. Just like you would do with visual in windows.

Also the makefile-thing isnot clear to me. But I saw that on an other forum topic.

nonononono

KDevelop and Visual Studios are IDE's, they give you a nice coding environment

they have backend compilers that actually do the compiling...not the IDE itself

monkeyking
March 13th, 2009, 10:43 PM
hmm, ok,
I'll try explain shortly.

Kdevelop is just somekind of glueprogram, that has en texteditor, and this program calls/executes the compiler.
This is called an ide "integrated dev. environment"
Normally it contains funky features like,
syntax highlighting, api lookup...


You can write your sourcecode in whatever editor you want.
And then compile it by hand, by typing

gcc yourfile.cpp
In a terminal.


Makefiles are just a program that simply executes a series of compilations, while checking for dependencies in your program.

All compilers as I know them,
are commandline tools.

The gnu compiler for assembler sourcefiles is called g77.

Shin_Gouki2501
March 14th, 2009, 12:04 AM
have you heard?
http://research.sun.com/projects/plrg/faq/index.html


http://projectfortress.sun.com/Projects/Community


interesting?

jeneverboy
March 14th, 2009, 01:49 PM
ok,

So in the terminal i can type
gcc myfilename.f90 to compile a fortran program.

but then I get this:
gcc: error trying to exec 'f951': execvp: No such file or directory

jeneverboy
March 14th, 2009, 02:33 PM
gfortran -o executable myfilename.f90

creates a executable file named executable. But how do I run this?

monkeyking
March 14th, 2009, 02:35 PM
no not gcc,
I've been using g77 to compile fortran stuff
type

g77 your file

jeneverboy
March 14th, 2009, 04:32 PM
And that makes a .exe right?

And an .exe can be run with Wine (for example) on LINUX systems?

I managed to make an .exe