Installed fortran package manager... now what?


I’m keen to start programming with Fortran and I come from an R/Python background.

I’ve followed the instructions in this helpful tutorial to install gfortran using Atom:

How do I run/compile the code? I’m working through the learnxinyminutes fortran tutorial:

I should be able to run the following in fortran, right?

program hello
  ! This is a comment line, it is ignored by the compiler
  print *, 'Hello, World!'
end program hello

Do I need compile at the command line e.g.

$> gfortran hello.f90 -o hello

Or can I compile/run in Atom? Grateful for any pointers.



Welcome @wildman !

Basically you just need to type:

$ fpm new hello_project
$ cd hello_project
$ fpm build
$ fpm run

And if you don’t use fpm, but have installed gfortran, yes the command line you wrote is OK.

1 Like