Skip to content

Commit 993495c

Browse files
authored
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.
1 parent 4f45052 commit 993495c

File tree

5 files changed

+14
-18
lines changed

5 files changed

+14
-18
lines changed

README.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ grown beyond Boost.Python in many ways, leading to dramatically simpler
3434
binding code in many common situations.
3535

3636
Tutorial and reference documentation is provided at
37-
`pybind11.readthedocs.io <https://pybind11.readthedocs.io/en/latest>`_).
37+
`pybind11.readthedocs.io <https://pybind11.readthedocs.io/en/latest>`_.
3838
A PDF version of the manual is available
3939
`here <https://media.readthedocs.org/pdf/pybind11/master/pybind11.pdf>`_.
4040
And the source code is always available at
@@ -113,9 +113,7 @@ Supported compilers
113113
newer)
114114
2. GCC 4.8 or newer
115115
3. Microsoft Visual Studio 2015 Update 3 or newer
116-
4. Intel C++ compiler 17 or newer (16 with pybind11 v2.0 and 15 with
117-
pybind11 v2.0 and a
118-
`workaround <https://github.com/pybind/pybind11/issues/276>`_)
116+
4. Intel C++ compiler 18 or newer
119117
5. Cygwin/GCC (tested on 2.5.1)
120118
6. NVCC (CUDA 11 tested)
121119
7. NVIDIA PGI (20.7 and 20.9 tested)

docs/changelog.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ New features:
4848
to have a member with the same name as a parent (such as an enum).
4949
`#2335 <https://github.com/pybind/pybind11/pull/2335>`_
5050

51-
Assisting in writing more correct code:
51+
Code correctness features:
5252

5353
* Error now thrown when ``__init__`` is forgotten on subclasses.
5454
`#2152 <https://github.com/pybind/pybind11/pull/2152>`_
@@ -97,7 +97,7 @@ Packaging / building improvements:
9797
site-packages location in your ``CMAKE_MODULE_PATH``. Or you can use the
9898
new ``pybind11[global]`` extra when you install ``pybind11``, which
9999
installs the CMake files and headers into your base environment in the
100-
standard location
100+
standard location.
101101

102102
* ``pybind11-config`` is another way to write ``python -m pybind11`` if you
103103
have your PATH set up.
@@ -214,6 +214,8 @@ Smaller or developer focused features:
214214
* NVIDIA PGI compilers now supported and tested in CI.
215215
`#2475 <https://github.com/pybind/pybind11/pull/2475>`_
216216

217+
* Intel 18 now explicitly required.
218+
217219
* Extensive style checking in CI, with `pre-commit`_ support. Code
218220
modernization, checked by clang-tidy.
219221

include/pybind11/cast.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1512,14 +1512,7 @@ struct copyable_holder_caster : public type_caster_base<type> {
15121512
// see issue #2180
15131513
explicit operator type&() { return *(static_cast<type *>(this->value)); }
15141514
explicit operator holder_type*() { return std::addressof(holder); }
1515-
1516-
// Workaround for Intel compiler bug
1517-
// see pybind11 issue 94
1518-
#if defined(__ICC) || defined(__INTEL_COMPILER)
1519-
operator holder_type&() { return holder; }
1520-
#else
15211515
explicit operator holder_type&() { return holder; }
1522-
#endif
15231516

15241517
static handle cast(const holder_type &src, return_value_policy, handle) {
15251518
const auto *ptr = holder_helper<holder_type>::get(src);

include/pybind11/detail/common.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@
4747

4848
// Compiler version assertions
4949
#if defined(__INTEL_COMPILER)
50-
# if __INTEL_COMPILER < 1700
51-
# error pybind11 requires Intel C++ compiler v17 or newer
50+
# if __INTEL_COMPILER < 1800
51+
# error pybind11 requires Intel C++ compiler v18 or newer
5252
# endif
5353
#elif defined(__clang__) && !defined(__apple_build_version__)
5454
# 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_
508508
template <bool B> using bool_constant = std::integral_constant<bool, B>;
509509
template <typename T> struct negation : bool_constant<!T::value> { };
510510

511-
// PGI cannot detect operator delete with the "compatible" void_t impl, so
511+
// PGI/Intel cannot detect operator delete with the "compatible" void_t impl, so
512512
// using the new one (C++14 defect, so generally works on newer compilers, even
513513
// if not in C++17 mode)
514-
#if defined(__PGIC__)
514+
#if defined(__PGIC__) || defined(__INTEL_COMPILER)
515515
template<typename... > using void_t = void;
516516
#else
517517
template <typename...> struct void_t_impl { using type = void; };

tests/test_virtual_functions.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,10 @@ def f(self):
163163
# PyPy: Reference count > 1 causes call with noncopyable instance
164164
# to fail in ncv1.print_nc()
165165
@pytest.mark.xfail("env.PYPY")
166-
@pytest.mark.skipif(not hasattr(m, "NCVirt"), reason="NCVirt test broken on ICPC")
166+
@pytest.mark.skipif(
167+
not hasattr(m, "NCVirt"),
168+
reason="NCVirt does not work on Intel/PGI/NVCC compilers"
169+
)
167170
def test_move_support():
168171
class NCVirtExt(m.NCVirt):
169172
def get_noncopyable(self, a, b):

0 commit comments

Comments
 (0)