jchelly / gadgetviewer

Simple tool for interactive visualisation of Gadget and SWIFT N-body simulations
GNU General Public License v3.0
24 stars 9 forks source link

Can't compile with GCC/11.2.0 #17

Closed mladenivkovic closed 2 years ago

mladenivkovic commented 2 years ago

Hi John

I've recently updated my system and can't get the code to compile using gcc 11.2.0, failing with the following error:

make[3]: Entering directory '/home/mivkov/local/gadgetviewer/main/src'
/home/mivkov/local/spack/opt/spack/linux-ubuntu20.04-skylake/gcc-9.3.0/gcc-11.2.0-sf5dve2qduhb7ukkr6prxiubaorcwseo/bin/gfortran -DHAVE_CONFIG_H -I. -I../../.    -I ../../f90_gui/src/ -I ../../drawing/src/ -I ../../f90_util/src -I ../../hdf5/src -I ../../read_eagle/src -fopenmp -heap-arrays -O3 -fallow-argument-mismatch -g -O2 -c -o additional_data.o additional_data.F90
additional_data.F90:1022:23:

  986 |              call cleanup()
      |                           2
......
 1022 |       do iaux = i, j, 1
      |                       1
Error: Index variable 'iaux' redefined at (1) in procedure 'cleanup' called from within DO loop at (2)
jchelly commented 2 years ago

I've pushed a change to master which I think should fix this but I don't have a gcc 11.2 installation to try it. Could you let me know if it works?

jchelly commented 2 years ago

It turns out that my laptop running ubuntu 21.10 has gcc 11.2. This patch does seem to work but to build from master rather than a release you need a few extra packages. I had to do

sudo apt install autoconf libtool texinfo

It needs gtk2 too, which I guess is going to become a problem soon, but you must have that if you were able to configure it.

mladenivkovic commented 2 years ago

Works for me now, thanks!