amuse icon indicating copy to clipboard operation
amuse copied to clipboard

amuse-simplex-2023.5.0 build fails on Debian 12 amd64/Python 3.11.4

Open paulkerry1 opened this issue 2 years ago • 5 comments

Describe the bug The amuse-simplex-2023.5.0 build fails on Debian 12 amd64 at this point...

mpicxx -g -O2 -fPIC -ansi -std=c++11 -ffast-math -fomit-frame-pointer -c -o cxxutils.o -c cxxutils.cc -I../../include cxxutils.cc: In function ‘bool file_present(const std::string&)’: cxxutils.cc:58:10: error: cannot convert ‘std::ifstream’ {aka ‘std::basic_ifstream’} to ‘bool’ in return 58 | return dummy;

all other amuse packages successfully build and install correctly using pip. I have also downloaded the amuse-simplex-2023.5.0 source and have tried to build it separately.

Logs I am attaching the build.log

Environment (please complete the following information):

  • OS and version: Debian 12 amd64
  • Compiler: /bin/mpicxx --version g++ (Debian 12.2.0-14) 12.2.0
  • this is using standalone Python 3.11.4 (not in a venv or anaconda environment) rather than the o/s standard Python 3.11.2

Additional context Add any other context about the problem here. build.log

Best regards Paul.

paulkerry1 avatar Jul 26 '23 11:07 paulkerry1

I can confirm this one on Kubuntu 22.04 with g++ (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0 and Python 3.10.12.

I think the problem may be with the C++ version this is being compiled as. As of C++11, converting an fstream to a bool needs to be done explicitly, where in C++98 that wasn't the case. So possibly the compiler flags were changed to specify C++11, but this wasn't updated.

Let's see if I can make fixing this my first contribution to Amuse :smiley:

LourensVeen avatar Sep 04 '23 13:09 LourensVeen

It seems like simplex embeds an ancient version of HEALPix, which doesn't work with C++11 because it was written in C++98 and never updated.

HEALPix is still maintained, and just had a new release a month ago. What's the policy in this case? Do we try to upgrade to a newer version of the library, or do we fork it and apply local fixes? It may be a bit of work to port simplex to a version of HEALPix that's 12 years into the future, but on the other hand, maintaining a fork isn't free either.

LourensVeen avatar Sep 04 '23 14:09 LourensVeen

I've pushed a branch with quick fixes to https://github.com/LourensVeen/amuse/tree/issue_974_simplex_c++11_fixes

I'll wait with making a PR until I know whether this is the preferred approach.

LourensVeen avatar Sep 04 '23 15:09 LourensVeen

Would it not be possible to still compile Simplex as C++98 code?

Generally, the fewer changes we have to do, the better - but if we have to do more, I would prefer updating Simplex to use a standard, modern version of Healpix to forking the old library and applying fixes to it.

rieder avatar Sep 04 '23 15:09 rieder

Would it not be possible to still compile Simplex as C++98 code?

no, it's not (says me from 6 months ago pushing the update to C++11, due to hdf5 requirements)...

rieder avatar Oct 06 '23 11:10 rieder