esheldon / esutil

A variety of python utilities focusing on numerical, scientific, and astrophysical computing

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

fails to compile and install with the compiling flag -std=c++17

zzxihep opened this issue · comments

When I try to install esutil in my computer using pip, The install process reports errors. The reason seems like that my compiler default C++ standard is C++17, and the c++ code includes throw exception flags that are only supported in C++11. Maybe you can add a -std=c++11 flag when compiling, or delete the exception statement in the header file. The failure report is below:

esutil/htm/htmc.h:29:36: error:ISO C++17 does not allow dynamic exception specifications 29 | HTMC(int depth=10) throw (const char *); | ^~~~~ esutil/htm/htmc.h:30:33: error:ISO C++17 does not allow dynamic exception specifications 30 | void init(int depth=10) throw (const char *); | ^~~~~ esutil/htm/htmc.h:39:11: error:ISO C++17 does not allow dynamic exception specifications 39 | ) throw (const char *); | ^~~~~ esutil/htm/htmc.h:46:30: error:ISO C++17 does not allow dynamic exception specifications 46 | ) throw (const char *); | ^~~~~ esutil/htm/htmc.h:78:31: error:ISO C++17 does not allow dynamic exception specifications 78 | throw (const char *); | ^~~~~ esutil/htm/htmc.h:100:32: error:ISO C++17 does not allow dynamic exception specifications 100 | PyObject* dec) throw (const char *);

Thanks for the report.

What system are you using that defaults to C++17?

My system is Manjaro, and gcc version is 11.1.0

I got the same error. I'm using fedora fc 34. Redhat switched to g++17 a year ago (https://developers.redhat.com/articles/2021/08/06/porting-your-code-c17-gcc-11#). Would it be possible to adjust the code? Thanks

This broke using clang on osx. I think we need to only do this on linux.

This can probably be closed now?