dttrugman/GrowClust

compilation on Ubuntu 16.04

Closed this issue · 2 comments

I recently cloned GrowClust and compiled following the instructions in the PDF included with the repo. Everything appeared to work fine. However, when I tried running the example I got the following error:

error while loading shared libraries: libgfortran.so.4: cannot open shared object file: No such file or directory

I found this SO post which indicates it is because gfortran-4 is needed, which is part of gcc-7. The gcc version for Ubuntu 16.04 is 4, so it is rather outdated. According to this page a PPA from some "jonathonf" has to be added or the OS needs to be updated to Ubuntu 18.04 to install gcc-7. I ended up adding the PPA and installing gfortran-4. I then had to change the makefile to use gfortran-4. The example seems to run fine now.

I don't know enough about fortran to know if the code can be adapted to be compatible with both gfortran-3 and gfortran-4. If not, a small blurb about this in the documentation may be useful to new users, as Ubuntu 16.04 is a common operating system.

Ok, turns out the gcc installed with the python package Anaconda is version 4.8.5 on my machine. When I remove Anaconda from Path so that the gfortran refers to the system gcc (version 5.4.0) everything seems to work fine. Dumb mistake on my part.