esheldon / esutil

A variety of python utilities focusing on numerical, scientific, and astrophysical computing
GNU General Public License v2.0
35 stars 19 forks source link

esutil pip install fails on github actions using ubuntu-latest (22.04) #80

Closed erykoff closed 3 months ago

erykoff commented 1 year ago

I use pip in my github actions for redmapper. And the esutil installation failed today, apparently caused by the update of ubuntu-latest from 20.04 to 22.04 in November/December (it was a rolling release). Specifically requesting ubuntu-20.04 fixed the issue (temporarily).

The pip install error was the following:

      esutil/htm/htmc.h:111:47: error: ISO C++17 does not allow dynamic exception specifications
        111 |                         const char* filename) throw (const char *);
            |                                               ^~~~~

Which is strange because it should be explicitly setting c++11, but I noticed that the build line looks like:

      gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/opt/hostedtoolcache/Python/3.8.15/x64/lib/python3.8/site-packages/numpy/core/include -Iesutil/include -Iesutil/recfile -Iesutil/htm -Iesutil/htm/htm_src -I/opt/hostedtoolcache/Python/3.8.15/x64/include/python3.8 -c esutil/htm/htm_src/SpatialInterface.cpp -o build/temp.linux-x86_64-3.8/esutil/htm/htm_src/SpatialInterface.o

(That is, no use of the -std=c++11 which should be there.)

esheldon commented 1 year ago

thanks for this

esheldon commented 1 year ago

If the flag isn't being passed, this might be a python/pip issue

jobovy commented 1 year ago

I think the issue is that @erykoff is pip installing the latest release, which doesn't include #75, so doesn't set -std=c++11. You could just try adding it to CFLAGS, that should work.

jobovy commented 1 year ago

Also, the reason that this bug occurred when GHA switched to Ubuntu 22.04 is that the default GCC version changed to 11, which uses the C++17 standard by default:

esheldon commented 1 year ago

I tagged a new version and pushed to pypi

esheldon commented 1 year ago

is this working now?