Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build error for Python 3.13 #565

Closed
LecrisUT opened this issue Aug 15, 2024 · 1 comment
Closed

Build error for Python 3.13 #565

LecrisUT opened this issue Aug 15, 2024 · 1 comment

Comments

@LecrisUT
Copy link

LecrisUT commented Aug 15, 2024

This was reported in Fedora upstream: https://bugzilla.redhat.com/show_bug.cgi?id=2254979

/builddir/build/BUILD/nlopt-2.7.1/redhat-linux-build/src/swig/CMakeFiles/nlopt_python.dir/nloptPYTHON_wrap.cxx: In function ‘double func_python(unsigned int, const double*, double*, void*)’:
/builddir/build/BUILD/nlopt-2.7.1/redhat-linux-build/src/swig/CMakeFiles/nlopt_python.dir/nloptPYTHON_wrap.cxx:5103:22: error: ‘PyEval_CallObject’ was not declared in this scope; did you mean ‘PyObject_CallObject’?
 5103 |   PyObject *result = PyEval_CallObject((PyObject *) f, arglist);
      |                      ^~~~~~~~~~~~~~~~~
      |                      PyObject_CallObject
/builddir/build/BUILD/nlopt-2.7.1/redhat-linux-build/src/swig/CMakeFiles/nlopt_python.dir/nloptPYTHON_wrap.cxx: In function ‘void mfunc_python(unsigned int, double*, unsigned int, const double*, double*, void*)’:
/builddir/build/BUILD/nlopt-2.7.1/redhat-linux-build/src/swig/CMakeFiles/nlopt_python.dir/nloptPYTHON_wrap.cxx:5140:19: error: ‘PyEval_CallObject’ was not declared in this scope; did you mean ‘PyObject_CallObject’?
 5140 |   PyObject *res = PyEval_CallObject((PyObject *) f, arglist);
      |                   ^~~~~~~~~~~~~~~~~
      |                   PyObject_CallObject

Basically the following needs to be guarded by python version macros:
https://github.com/stevengj/nlopt/blob/master/src/swig/nlopt-python.i#L154

@jschueller
Copy link
Collaborator

hello @stevengj,
I think it could be worth having a new release with this fix since python 3.13 will be released soon, what do you think ?
it will help downstream like Fedora, conda etc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants