neuronsimulator / nrn

NEURON Simulator
http://nrn.readthedocs.io
Other
375 stars 113 forks source link

Python 3.13 support #2640

Open sanjayankur31 opened 6 months ago

sanjayankur31 commented 6 months ago

Filing this early because the Fedora Python maintainers have started to test all our packages with Python 3.13, and NEURON does not currently build with it.

https://bugzilla.redhat.com/show_bug.cgi?id=2254189

neuron fails to build with Python 3.13.0a2.

/builddir/build/BUILD/nrn-8.2.2/src/nrnpython/nrnpython.cpp:157:13: error: ‘Py_SetPythonHome’ was not declared in this scope; did you mean ‘Py_GetPythonHome’?
  157 |             Py_SetPythonHome(mywstrdup(_p_pyhome));
      |             ^~~~~~~~~~~~~~~~
      |             Py_GetPythonHome
/builddir/build/BUILD/nrn-8.2.2/src/nrnpython/nrnpython.cpp:165:9: error: ‘PySys_SetArgv’ was not declared in this scope
  165 |         PySys_SetArgv(nrn_global_argc, wcargv);
      |         ^~~~~~~~~~~~~

According to https://docs.python.org/3.13/whatsnew/3.13.html: Remove the following old functions to configure the Python initialization, deprecated in Python 3.11:

https://docs.python.org/3.13/whatsnew/3.13.html

For the build logs, see: https://copr-be.cloud.fedoraproject.org/results/@python/python3.13/fedora-rawhide-x86_64/06712032-neuron/

For all our attempts to build neuron with Python 3.13, see: https://copr.fedorainfracloud.org/coprs/g/python/python3.13/package/neuron/

alkino commented 6 months ago

This is an already known problem. It should not be really long to fix this. Thanks for the report.

alkino commented 5 months ago

I was giving a try, and I was not able to install the dependencies of nrn with python 3.13. We depend on matplotlib that depends of contourpy that depends of meson.

meson is not yet ready for python 3.13: https://github.com/mesonbuild/meson/issues/12714

Here we are.

JCGoran commented 5 months ago

@sanjayankur31 The removal of the initialization functions was fixed in https://github.com/neuronsimulator/nrn/pull/2317, can you try to re-build with the latest master?