You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Compilation error in MacOS: no member named 'terminate' in namespace 'std'; did you mean 'template'? #287
I'm installing XTL on MacOS, building the tests as well. During this build I get the error:
In file included from /Users/amwink/software/cpp/bispackage/dep/xtensor-stack/xtl/test/test_xhalf_float.cpp:17:
In file included from /Users/amwink/software/cpp/bispackage/dep/xtensor-stack/xtl/include/xtl/xhalf_float.hpp:14:
/Users/amwink/software/cpp/bispackage/dep/xtensor-stack/xtl/include/xtl/xhalf_float_impl.hpp:4022:8: error: no member named 'terminate' in namespace 'std'; did you mean 'template'?
4022 | std::terminate();
| ~~~~~^~~~~~~~~
| template
/Users/amwink/software/cpp/bispackage/dep/xtensor-stack/xtl/include/xtl/xhalf_float_impl.hpp:4022:17: error: expected unqualified-id
4022 | std::terminate();
| ^
2 warnings and 2 errors generated.
make[2]: *** [test/CMakeFiles/test_xtl.dir/test_xhalf_float.cpp.o] Error 1
make[1]: *** [test/CMakeFiles/test_xtl.dir/all] Error 2
make: *** [all] Error 2
Building of project xtl did not succeed - exiting now
I use the same install script as I did in Linux, where it compiled without errors. Does MacOS(clang) require different setup options than Linux(gcc)?
I think we're missing some include (std::terminate is defined in the header <exception>, which is not included in xhalf_float_impl.hpp. We may be more lucky on Linux where it is probably included by other headers. Adding the missing include to xhalf_float_impl.hpp should probably fix your issue, although I'm a bit surprised we did not catch it in the CI.
Activity
JohanMabille commentedon Oct 14, 2025
I think we're missing some include (
std::terminateis defined in the header<exception>, which is not included inxhalf_float_impl.hpp. We may be more lucky on Linux where it is probably included by other headers. Adding the missing include toxhalf_float_impl.hppshould probably fix your issue, although I'm a bit surprised we did not catch it in the CI.