GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — compilation fails with cpython master due to removed function · Issue #1932 · pybind/pybind11

compilation fails with cpython master due to removed function #1932

New issue
Copy link
New issue
Copy link
Closed
Closed
compilation fails with cpython master due to removed function#1932
Copy link

Description

@tacaswell
tacaswell
opened on Sep 24, 2019
Issue body actions

Issue description

Use with cpython master branch (of scipy) fails with

  creating build/temp.linux-x86_64-3.9/scipy/fft/_pocketfft
    compile options: '-DPOCKETFFT_PTHREADS -I/home/tcaswell/.virtualenvs/bleeding/include/site/python3.9 -I/home/tcaswell/.virtualenvs/bleeding/include -I/home/tcaswell/.pybuild/bleeding/include/python3.9 -c'
    extra options: '-std=c++14 -fvisibility=hidden'
    g++: scipy/fft/_pocketfft/pypocketfft.cxx
    In file included from scipy/fft/_pocketfft/pypocketfft.cxx:15:
    /home/tcaswell/.virtualenvs/bleeding/include/site/python3.9/pybind11/pybind11.h: In member function ‘void pybind11::gil_scoped_acquire::dec_r
    /home/tcaswell/.virtualenvs/bleeding/include/site/python3.9/pybind11/pybind11.h:1953:13: error: ‘PyThreadState_DeleteCurrent’ was not declare
     1953 |             PyThreadState_DeleteCurrent();
          |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~
          |             PyThreadState_Delete
    error: Command "g++ -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPOCKETFFT_PTHREADS -I/home/tcaswell/.virthon3.9/site-packages/numpy/core/include -I/home/tcaswell/.virtualenvs/bleeding/include -I/home/tcaswell/.pybuild/bleeding/include/python3.9 -c s/_pocketfft/pypocketfft.o.d -std=c++14 -fvisibility=hidden" failed with exit status 1

This is due to cpython removing this function for py3.9 : python/cpython#15315 / https://bugs.python.org/issue37878

This function is used at

pybind11/include/pybind11/pybind11.h

Lines 1939 to 1957 in f3109d8

PYBIND11_NOINLINE void dec_ref() {
--tstate->gilstate_counter;
#if !defined(NDEBUG)
if (detail::get_thread_state_unchecked() != tstate)
pybind11_fail("scoped_acquire::dec_ref(): thread state must be current!");
if (tstate->gilstate_counter < 0)
pybind11_fail("scoped_acquire::dec_ref(): reference count underflow!");
#endif
if (tstate->gilstate_counter == 0) {
#if !defined(NDEBUG)
if (!release)
pybind11_fail("scoped_acquire::dec_ref(): internal error!");
#endif
PyThreadState_Clear(tstate);
PyThreadState_DeleteCurrent();
PYBIND11_TLS_DELETE_VALUE(detail::get_internals().tstate);
release = false;
}
}

Reproducible example code

Trying to install scipy from source with cpython master.

Activity

  1. tacaswell
    added a commit that references this issue on Sep 24, 2019

    FIX: do not use un-documented CPython functions

    This issue will close once commit a8eac30 is merged into the 'master' branch.
    a8eac30
  2. wjakob commented on Sep 24, 2019

    @wjakob
    wjakob
    on Sep 24, 2019
    Member
    More actions

    I opened a ticket on the Python bug tracker: https://bugs.python.org/issue38266

  3. bstaletic commented on Jul 10, 2020

    @bstaletic
    bstaletic
    on Jul 10, 2020
    Collaborator
    More actions

    CPython "undeleted" this function.

  4. bstaletic
    closed this as completedon Jul 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402520 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.