Quantcast
Channel: Intel® Software - Intel® C++ Compiler
Viewing all articles
Browse latest Browse all 1175

Intel c++ compiler error with pybind11 using -std=c++17

$
0
0

Hello,

 

I am getting a compile error when using the Intel c++ compiler (ICC - 19.0.0.046 20180317) when compiling a simple code, basically importing pybind11 with the option -std=c++17. The error log is very large, but starts as follows

In file included from /home/soprano/work/pybind11/include/pybind11/cast.h(16),
                 from /home/soprano/work/pybind11/include/pybind11/attr.h(13),
                 from /home/soprano/work/pybind11/include/pybind11/pybind11.h(43),
                 from test.cpp(1):
/home/soprano/work/pybind11/include/pybind11/detail/internals.h(175): error: a constexpr function cannot have a parameter of nonliteral type "std::__exception_ptr::exception_ptr"
              [](std::exception_ptr p) -> void {
                ^

/home/soprano/work/pybind11/include/pybind11/cast.h(2078): error: no instance of overloaded function "pybind11::detail::collect_arguments" matches the argument list
            argument types are: (const char *const)
      return detail::collect_arguments<policy>(std::forward<Args>(args)...).call(derived().ptr());
             ^
/home/soprano/work/pybind11/include/pybind11/cast.h(2064): note: this candidate was rejected because at least one template argument could not be deduced
  unpacking_collector<policy> collect_arguments(Args &&...args) {
                              ^
/home/soprano/work/pybind11/include/pybind11/cast.h(2057): note: this candidate was rejected because at least one template argument could not be deduced
  simple_collector<policy> collect_arguments(Args &&...args) {
                           ^
          detected during:

The command line call was

icpc -std=c++17 test.cpp -I/pybind11/include/path -I/python/include/path

 

However, if I change the option to -std=c++14 or c++11, it works fine. g++ also compiles with no problems when using the c++17 option. It seems like a compiler bug. The code used is presented below.

// test.cpp
#include <pybind11/pybind11.h>

int main(){
    return 0;
}

Does anyone have any idea of what this might be?

Best regards,

Arthur Besen Soprana


Viewing all articles
Browse latest Browse all 1175

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>