Skip to content

Commit

Permalink
Trac #32515: linuxmint-17, ubuntu-trusty: scipy build error with pybi…
Browse files Browse the repository at this point in the history
…nd11

On `linuxmint-17-minimal`
(https://github.com/sagemath/sage/runs/3593003595)
{{{
  gcc -pthread -shared -Wl,-rpath-link,/sage/local/lib -L/sage/local/lib
-Wl,-rpath,/sage/local/lib -L. -Wl,-rpath-link,/sage/local/lib
-L/sage/local/lib -Wl,-rpath,/sage/local/lib -shared -Wl,-rpath-
link,/sage/local/lib -L/sage/local/lib -Wl,-rpath,/sage/local/lib
build/temp.linux-x86_64-3.9/scipy/cluster/_optimal_leaf_ordering.o
-L/sage/local/lib -Lbuild/temp.linux-x86_64-3.9 -o build/lib.linux-
x86_64-3.9/scipy/cluster/_optimal_leaf_ordering.cpython-39-x86_64-linux-
gnu.so -Wl,--version-script=build/temp.linux-x86_64-3.9/link-version-
scipy.cluster._optimal_leaf_ordering.map
  C compiler: g++ -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv
-O3 -Wall -Wno-unused -O2 -g -fPIC

  creating /tmp/tmpif5aglmi/tmp
  creating /tmp/tmpif5aglmi/tmp/tmpif5aglmi
  compile options: '-I/sage/local/include/python3.9 -c'
  extra options: '-std=c++14'
  g++: /tmp/tmpif5aglmi/main.cpp
  g++: error: unrecognized command line option '-std=c++14'
  C compiler: g++ -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv
-O3 -Wall -Wno-unused -O2 -g -fPIC

  creating /tmp/tmpjrgp9vmy/tmp
  creating /tmp/tmpjrgp9vmy/tmp/tmpjrgp9vmy
  compile options: '-I/sage/local/include/python3.9 -c'
  extra options: '-std=c++11'
  g++: /tmp/tmpjrgp9vmy/main.cpp
  C compiler: g++ -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv
-O3 -Wall -Wno-unused -O2 -g -fPIC

  creating /tmp/tmpik_q_vbd/tmp
  creating /tmp/tmpik_q_vbd/tmp/tmpik_q_vbd
  compile options: '-I/sage/local/include/python3.9 -c'
  g++: /tmp/tmpik_q_vbd/main.c
  C compiler: g++ -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv
-O3 -Wall -Wno-unused -O2 -g -fPIC

  creating /tmp/tmpv4ojh26z/tmp
  creating /tmp/tmpv4ojh26z/tmp/tmpv4ojh26z
  compile options: '-I/sage/local/include/python3.9 -c'
  extra options: '-pthread'
  g++: /tmp/tmpv4ojh26z/main.c
  C compiler: g++ -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv
-O3 -Wall -Wno-unused -O2 -g -fPIC

   creating build/temp.linux-x86_64-3.9/scipy/fft
  creating build/temp.linux-x86_64-3.9/scipy/fft/_pocketfft
  compile options: '-DPOCKETFFT_PTHREADS -I/sage/local/lib/python3.9
/site-packages/pybind11/include -I/sage/local/lib/python3.9/site-
packages/pybind11/include -I/sage/local/lib/python3.9/site-
packages/numpy/core/include -Ibuild/src.linux-
x86_64-3.9/numpy/distutils/include -I/sage/local/include/python3.9 -c'
  extra options: '-std=c++11 -pthread -fvisibility=hidden -msse -msse2
-msse3'
  g++: scipy/fft/_pocketfft/pypocketfft.cxx
  In file included from scipy/fft/_pocketfft/pypocketfft.cxx:16:0:
  /sage/local/lib/python3.9/site-
packages/pybind11/include/pybind11/numpy.h:328:5: error:
'is_trivially_copyable' is not a member of 'std'
       std::is_trivially_copyable<T>,
       ^
  /sage/local/lib/python3.9/site-
packages/pybind11/include/pybind11/numpy.h:328:5: error:
'is_trivially_copyable' is not a member of 'std'
  /sage/local/lib/python3.9/site-
packages/pybind11/include/pybind11/numpy.h:328:33: error: template
argument 2 is invalid
       std::is_trivially_copyable<T>,
                                   ^
  /sage/local/lib/python3.9/site-
packages/pybind11/include/pybind11/numpy.h:968:49: error:
'is_pod_struct' is not a member of 'pybind11::detail'
   struct format_descriptor<T,
detail::enable_if_t<detail::is_pod_struct<T>::value>> {
                                                   ^
  /sage/local/lib/python3.9/site-
packages/pybind11/include/pybind11/numpy.h:968:49: error:
'is_pod_struct' is not a member of 'pybind11::detail'
  /sage/local/lib/python3.9/site-
packages/pybind11/include/pybind11/numpy.h:968:72: error: template
argument 1 is invalid
   struct format_descriptor<T,
detail::enable_if_t<detail::is_pod_struct<T>::value>> {
  ^
  /sage/local/lib/python3.9/site-
packages/pybind11/include/pybind11/numpy.h:968:75: error: template
argument 2 is invalid
   struct format_descriptor<T,
detail::enable_if_t<detail::is_pod_struct<T>::value>> {
     ^
  /sage/local/lib/python3.9/site-
packages/pybind11/include/pybind11/numpy.h:968:80: error: expected
unqualified-id before '>' token
   struct format_descriptor<T,
detail::enable_if_t<detail::is_pod_struct<T>::value>> {

error: Command "g++ -Wno-unused-result -Wsign-compare -DNDEBUG -g
-fwrapv -O3 -Wall -Wno-unused -O2 -g -fPIC -DPOCKETFFT_PTHREADS
-I/sage/local/lib/python3.9/site-packages/pybind11/include
-I/sage/local/lib/python3.9/site-packages/pybind11/include
-I/sage/local/lib/python3.9/site-packages/numpy/core/include -Ibuild/src
.linux-x86_64-3.9/numpy/distutils/include
-I/sage/local/include/python3.9 -c scipy/fft/_pocketfft/pypocketfft.cxx
-o build/temp.linux-x86_64-3.9/scipy/fft/_pocketfft/pypocketfft.o -MMD
-MF build/temp.linux-x86_64-3.9/scipy/fft/_pocketfft/pypocketfft.o.d
-std=c++11 -pthread -fvisibility=hidden -msse -msse2 -msse3" failed with
exit status 1
}}}

Likely caused by the `pybind11` update (from 2.6.0 to 2.7.1;
https://pybind11.readthedocs.io/en/stable/changelog.html) done as part
of the Jupyter upgrade in #31280.

Broken:
- `linuxmint-17` (gcc 4.8.4-2ubuntu1~14.04.3, `__GLIBCXX__ = 20150426`),
- `ubuntu-trusty` (4.8.4-2ubuntu1~14.04.4, `__GLIBCXX__ = 20150426`)

OK:
- `centos-7` 4.8.5 20150623 (Red Hat 4.8.5-44, `__GLIBCXX__ = 20150623`)
- `debian-jessie` (gcc 4.9.2-10+deb8u2),
- `linuxmint-18` (gcc 5.4.0-6ubuntu1~16.04.6),
- `fedora-26` (7.3.1 20180130 (Red Hat 7.3.1-2))

Opened `pybind11` upstream issue:
pybind/pybind11#3269, PR
pybind/pybind11#3270 (merged in the 2.7
maintenance branch)

URL: https://trac.sagemath.org/32515
Reported by: mkoeppe
Ticket author(s): Matthias Koeppe
Reviewer(s): Jonathan Kliem
  • Loading branch information
Release Manager committed Oct 7, 2021
2 parents 52915b6 + d0e1e95 commit 686e5c2
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion build/pkgs/pybind11/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.7.1
2.7.1.p0
25 changes: 25 additions & 0 deletions build/pkgs/pybind11/patches/3270.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
From 8920453affdcaad3e4a3a02d39181f5b5bf67fb7 Mon Sep 17 00:00:00 2001
From: Matthias Koeppe <mkoeppe@math.ucdavis.edu>
Date: Tue, 14 Sep 2021 21:57:58 -0700
Subject: [PATCH] include/pybind11/numpy.h: gcc 4.8.4 does not have
is_trivially_copyable

Manually edited -- the sdist has a layout different from the git repo.

---
include/pybind11/numpy.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/pybind11/numpy.h b/include/pybind11/numpy.h
index 7313897fe1..34b7536d38 100644
--- a/pybind11/include/pybind11/numpy.h
+++ b/pybind11/include/pybind11/numpy.h
@@ -319,7 +319,7 @@ template <typename T> using remove_all_extents_t = typename array_info<T>::type;

template <typename T> using is_pod_struct = all_of<
std::is_standard_layout<T>, // since we're accessing directly in memory we need a standard layout type
-#if defined(__GLIBCXX__) && (__GLIBCXX__ < 20150422 || __GLIBCXX__ == 20150623 || __GLIBCXX__ == 20150626 || __GLIBCXX__ == 20160803)
+#if defined(__GLIBCXX__) && (__GLIBCXX__ < 20150422 || __GLIBCXX__ == 20150426 || __GLIBCXX__ == 20150623 || __GLIBCXX__ == 20150626 || __GLIBCXX__ == 20160803)
// libstdc++ < 5 (including versions 4.8.5, 4.9.3 and 4.9.4 which were released after 5)
// don't implement is_trivially_copyable, so approximate it
std::is_trivially_destructible<T>,

0 comments on commit 686e5c2

Please sign in to comment.