Installed fortran package manager... now what?

Hello,

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:

https://fortran-lang.discourse.group/t/setting-up-windows-for-fortran-development/1314

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

https://learnxinyminutes.com/docs/fortran95/

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.

Cheers.

5 Likes

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