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

Compilation on MacOS #2

Closed JBorrow closed 6 years ago

JBorrow commented 6 years ago

Hi John,

I'm trying to compile on MacOS and have had to make a few minor changes to the codebase; I thought I would list them here (as I am not that familiar with fortran) instead of just making a PR straight up.

This is with gfortran 8.1.0.

1) I needed to put a space in between all stop'' calls, such that they now read stop '<string>'. 2) I needed to update the python script conf/find_module_dependencies.py to be python3 compatible; this is because lower as part of the string library has now become part of the standard library and is just a method on strings 3) I have also added a .gitignore that ignores the compiled files, if you wish for me to upload it.

The first one is the one where I feel like I am probably missing something; let me know if I should revert these changes.

jchelly commented 6 years ago

Hi Josh,

It looks like the stop statements in the program might not be allowed as they are - apart from the missing spaces, the parameter might be limited to an integer or a string of up to 5 digits, although I can't find anything to confirm that still applies in Fortran 90 and later. It should also be using the F2008 'error stop' if available because that can set a non-zero exit code. Probably the best fix is to make a subroutine for abnormal termination and call that. I'll have a look at that now.

If you can make a branch or a pull request with the other changes I'll merge them in. I'd like to find a better solution to module dependencies than the python script but I haven't found one yet (other than switching to cmake).

jchelly commented 6 years ago

Could you try the remove_stop branch? I've replaced all the stops with calls to a terminate() function.

JBorrow commented 6 years ago

That looks like it's fixed it, thanks John!

jchelly commented 6 years ago

Ok, thanks, I've merged the changes into master.