Using Geany With g95


As part of my research, I’ve recently started developing in Fortran (because TAMU’s IBM-powered supercomputer doesn’t support Matlab, thereby breaking my heart) in an Ubuntu environment. After some Googling about, I settled on g95 for my compiler, installed it, and started looking around for an IDE, mostly to (hopefully) force myself into keeping some sensible version management for my code. I came across Geany and liked the idea of a lightweight program with few dependencies, so I installed it.

Now, I haven’t really used an IDE since my freshman programming class and this is my first encounter with any flavor of Fortran, so, when I tried to compile my first program, only for Geany to fail to find the compiler, there were definitely some thoughts of panic. Neither Google nor the g95/Geany documentation provided any answers, but, luckily, I found the right setting to change.

So, for anyone else who is trying to get Geany and g95 to cooperate: go to Build –> Set Includes and Arguments. In the window that pops up, change every instance of gfortran to g95. You don’t have to change the arguments–they’ll carry over just fine.

Also, if you want to get BLAS and LAPACK working, you can install liblapack3gf and liblapack-dev via Synaptic or the terminal:

$ sudo apt-get install liblapack3gf liblapack-dev

Then return to Geany’s Set Includes and Arguments submenu and add -lblas and -llapack to the argument lists.

g95 -lblas -llapack -Wall -o "%e" "%f"

I include them in the Build command but not the Compile command so that I can distinguish between issues in my code and problems with linking.

Hopefully, that’ll help another poor soul out there.


Leave a Reply

Your email address will not be published.