mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-25 06:35:12 +00:00
fix: Intel 18+ required (#2577)
* fix: Intel 18+ fully supported * fix: Intel compiler workaround no longer needed Followup on #94 now that Intel 18+ is required.
This commit is contained in:
parent
4f45052d4c
commit
993495c96c
@ -34,7 +34,7 @@ grown beyond Boost.Python in many ways, leading to dramatically simpler
|
|||||||
binding code in many common situations.
|
binding code in many common situations.
|
||||||
|
|
||||||
Tutorial and reference documentation is provided at
|
Tutorial and reference documentation is provided at
|
||||||
`pybind11.readthedocs.io <https://pybind11.readthedocs.io/en/latest>`_).
|
`pybind11.readthedocs.io <https://pybind11.readthedocs.io/en/latest>`_.
|
||||||
A PDF version of the manual is available
|
A PDF version of the manual is available
|
||||||
`here <https://media.readthedocs.org/pdf/pybind11/master/pybind11.pdf>`_.
|
`here <https://media.readthedocs.org/pdf/pybind11/master/pybind11.pdf>`_.
|
||||||
And the source code is always available at
|
And the source code is always available at
|
||||||
@ -113,9 +113,7 @@ Supported compilers
|
|||||||
newer)
|
newer)
|
||||||
2. GCC 4.8 or newer
|
2. GCC 4.8 or newer
|
||||||
3. Microsoft Visual Studio 2015 Update 3 or newer
|
3. Microsoft Visual Studio 2015 Update 3 or newer
|
||||||
4. Intel C++ compiler 17 or newer (16 with pybind11 v2.0 and 15 with
|
4. Intel C++ compiler 18 or newer
|
||||||
pybind11 v2.0 and a
|
|
||||||
`workaround <https://github.com/pybind/pybind11/issues/276>`_)
|
|
||||||
5. Cygwin/GCC (tested on 2.5.1)
|
5. Cygwin/GCC (tested on 2.5.1)
|
||||||
6. NVCC (CUDA 11 tested)
|
6. NVCC (CUDA 11 tested)
|
||||||
7. NVIDIA PGI (20.7 and 20.9 tested)
|
7. NVIDIA PGI (20.7 and 20.9 tested)
|
||||||
|
@ -48,7 +48,7 @@ New features:
|
|||||||
to have a member with the same name as a parent (such as an enum).
|
to have a member with the same name as a parent (such as an enum).
|
||||||
`#2335 <https://github.com/pybind/pybind11/pull/2335>`_
|
`#2335 <https://github.com/pybind/pybind11/pull/2335>`_
|
||||||
|
|
||||||
Assisting in writing more correct code:
|
Code correctness features:
|
||||||
|
|
||||||
* Error now thrown when ``__init__`` is forgotten on subclasses.
|
* Error now thrown when ``__init__`` is forgotten on subclasses.
|
||||||
`#2152 <https://github.com/pybind/pybind11/pull/2152>`_
|
`#2152 <https://github.com/pybind/pybind11/pull/2152>`_
|
||||||
@ -97,7 +97,7 @@ Packaging / building improvements:
|
|||||||
site-packages location in your ``CMAKE_MODULE_PATH``. Or you can use the
|
site-packages location in your ``CMAKE_MODULE_PATH``. Or you can use the
|
||||||
new ``pybind11[global]`` extra when you install ``pybind11``, which
|
new ``pybind11[global]`` extra when you install ``pybind11``, which
|
||||||
installs the CMake files and headers into your base environment in the
|
installs the CMake files and headers into your base environment in the
|
||||||
standard location
|
standard location.
|
||||||
|
|
||||||
* ``pybind11-config`` is another way to write ``python -m pybind11`` if you
|
* ``pybind11-config`` is another way to write ``python -m pybind11`` if you
|
||||||
have your PATH set up.
|
have your PATH set up.
|
||||||
@ -214,6 +214,8 @@ Smaller or developer focused features:
|
|||||||
* NVIDIA PGI compilers now supported and tested in CI.
|
* NVIDIA PGI compilers now supported and tested in CI.
|
||||||
`#2475 <https://github.com/pybind/pybind11/pull/2475>`_
|
`#2475 <https://github.com/pybind/pybind11/pull/2475>`_
|
||||||
|
|
||||||
|
* Intel 18 now explicitly required.
|
||||||
|
|
||||||
* Extensive style checking in CI, with `pre-commit`_ support. Code
|
* Extensive style checking in CI, with `pre-commit`_ support. Code
|
||||||
modernization, checked by clang-tidy.
|
modernization, checked by clang-tidy.
|
||||||
|
|
||||||
|
@ -1512,14 +1512,7 @@ public:
|
|||||||
// see issue #2180
|
// see issue #2180
|
||||||
explicit operator type&() { return *(static_cast<type *>(this->value)); }
|
explicit operator type&() { return *(static_cast<type *>(this->value)); }
|
||||||
explicit operator holder_type*() { return std::addressof(holder); }
|
explicit operator holder_type*() { return std::addressof(holder); }
|
||||||
|
|
||||||
// Workaround for Intel compiler bug
|
|
||||||
// see pybind11 issue 94
|
|
||||||
#if defined(__ICC) || defined(__INTEL_COMPILER)
|
|
||||||
operator holder_type&() { return holder; }
|
|
||||||
#else
|
|
||||||
explicit operator holder_type&() { return holder; }
|
explicit operator holder_type&() { return holder; }
|
||||||
#endif
|
|
||||||
|
|
||||||
static handle cast(const holder_type &src, return_value_policy, handle) {
|
static handle cast(const holder_type &src, return_value_policy, handle) {
|
||||||
const auto *ptr = holder_helper<holder_type>::get(src);
|
const auto *ptr = holder_helper<holder_type>::get(src);
|
||||||
|
@ -47,8 +47,8 @@
|
|||||||
|
|
||||||
// Compiler version assertions
|
// Compiler version assertions
|
||||||
#if defined(__INTEL_COMPILER)
|
#if defined(__INTEL_COMPILER)
|
||||||
# if __INTEL_COMPILER < 1700
|
# if __INTEL_COMPILER < 1800
|
||||||
# error pybind11 requires Intel C++ compiler v17 or newer
|
# error pybind11 requires Intel C++ compiler v18 or newer
|
||||||
# endif
|
# endif
|
||||||
#elif defined(__clang__) && !defined(__apple_build_version__)
|
#elif defined(__clang__) && !defined(__apple_build_version__)
|
||||||
# if __clang_major__ < 3 || (__clang_major__ == 3 && __clang_minor__ < 3)
|
# if __clang_major__ < 3 || (__clang_major__ == 3 && __clang_minor__ < 3)
|
||||||
@ -508,10 +508,10 @@ template <bool... Bs> using select_indices = typename select_indices_impl<index_
|
|||||||
template <bool B> using bool_constant = std::integral_constant<bool, B>;
|
template <bool B> using bool_constant = std::integral_constant<bool, B>;
|
||||||
template <typename T> struct negation : bool_constant<!T::value> { };
|
template <typename T> struct negation : bool_constant<!T::value> { };
|
||||||
|
|
||||||
// PGI cannot detect operator delete with the "compatible" void_t impl, so
|
// PGI/Intel cannot detect operator delete with the "compatible" void_t impl, so
|
||||||
// using the new one (C++14 defect, so generally works on newer compilers, even
|
// using the new one (C++14 defect, so generally works on newer compilers, even
|
||||||
// if not in C++17 mode)
|
// if not in C++17 mode)
|
||||||
#if defined(__PGIC__)
|
#if defined(__PGIC__) || defined(__INTEL_COMPILER)
|
||||||
template<typename... > using void_t = void;
|
template<typename... > using void_t = void;
|
||||||
#else
|
#else
|
||||||
template <typename...> struct void_t_impl { using type = void; };
|
template <typename...> struct void_t_impl { using type = void; };
|
||||||
|
@ -163,7 +163,10 @@ def test_alias_delay_initialization2(capture):
|
|||||||
# PyPy: Reference count > 1 causes call with noncopyable instance
|
# PyPy: Reference count > 1 causes call with noncopyable instance
|
||||||
# to fail in ncv1.print_nc()
|
# to fail in ncv1.print_nc()
|
||||||
@pytest.mark.xfail("env.PYPY")
|
@pytest.mark.xfail("env.PYPY")
|
||||||
@pytest.mark.skipif(not hasattr(m, "NCVirt"), reason="NCVirt test broken on ICPC")
|
@pytest.mark.skipif(
|
||||||
|
not hasattr(m, "NCVirt"),
|
||||||
|
reason="NCVirt does not work on Intel/PGI/NVCC compilers"
|
||||||
|
)
|
||||||
def test_move_support():
|
def test_move_support():
|
||||||
class NCVirtExt(m.NCVirt):
|
class NCVirtExt(m.NCVirt):
|
||||||
def get_noncopyable(self, a, b):
|
def get_noncopyable(self, a, b):
|
||||||
|
Loading…
Reference in New Issue
Block a user