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

NEURON can dynamically link to Python3.10 #1558

Merged
merged 2 commits into from
Dec 18, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mingw_files/howto-cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
# howto-cmake 36 # builds for 3.6
# howto-cmake 27 35 36 37 38 # builds for all those
# howto-cmake 36 37 38 39 310 # builds for all those

set -e
set -x
Expand Down
3 changes: 2 additions & 1 deletion share/lib/python/neuron/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,8 @@ def nrn_dll_sym_nt(name, type):
if h.nrnversion(8).find("i686") == 0:
b = "bin"
path = os.path.join(h.neuronhome().replace("/", "\\"), b)
p = sys.version_info[0] * 10 + sys.version_info[1]
fac = 10 if sys.version_info[1] < 10 else 100 # 3.9 is 39 ; 3.10 is 310
p = sys.version_info[0] * fac + sys.version_info[1]
for dllname in ["libnrniv.dll", "libnrnpython%d.dll" % p]:
p = os.path.join(path, dllname)
try:
Expand Down
3 changes: 3 additions & 0 deletions src/nrnpython/inithoc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,9 @@ extern "C" PyObject* PyInit_hoc() {
nrn_nobanner_ = 1;
const char* pyver = Py_GetVersion();
nrn_is_python_extension = (pyver[0]-'0')*10 + (pyver[2] - '0');
if (isdigit(pyver[3])) { // minor >= 10 e.g. 3.10 is 310
nrn_is_python_extension = nrn_is_python_extension*10 + pyver[3] - '0';
}
p_nrnpython_finalize = nrnpython_finalize;
#if NRNMPI
if (libnrnmpi_is_loaded) {
Expand Down