Page 1 of 1

NEURON does not compile with python3.3

Posted: Wed May 08, 2013 2:39 pm
by lneisenman
When trying to compile NEURON with python3.3.1 on Ubuntu 13.04 64 bit I get the following error:
(./configure --prefix=`pwd` --with-iv --with-nrnpython=python3)

make[4]: Entering directory `/home/larry/neuron/nrn/src/nrnpython'
/bin/bash ../../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I../.. -I../../src/nrnoc -I../../src/oc -I../../src/parallel -I../../src/nrnjava -I../../src/nrncvode -I../../src/ivos -I../../src/sundials -I. -I../../src/nrniv -I../../src/ivoc -I../../src/nrnoc -I../../src/oc -I../../src/nrnmpi -I../../src/gnu -I/usr/include/python3.3m -I/home/larry/neuron/iv/include -DOOP=1 -DCABLE=1 -DUSECVODE=1 -DUSEMATRIX=1 -DUSEBBS=1 -g -O2 -MT nrnpy_hoc.lo -MD -MP -MF .deps/nrnpy_hoc.Tpo -c -o nrnpy_hoc.lo nrnpy_hoc.cpp
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../.. -I../../src/nrnoc -I../../src/oc -I../../src/parallel -I../../src/nrnjava -I../../src/nrncvode -I../../src/ivos -I../../src/sundials -I. -I../../src/nrniv -I../../src/ivoc -I../../src/nrnoc -I../../src/oc -I../../src/nrnmpi -I../../src/gnu -I/usr/include/python3.3m -I/home/larry/neuron/iv/include -DOOP=1 -DCABLE=1 -DUSECVODE=1 -DUSEMATRIX=1 -DUSEBBS=1 -g -O2 -MT nrnpy_hoc.lo -MD -MP -MF .deps/nrnpy_hoc.Tpo -c nrnpy_hoc.cpp -fPIC -DPIC -o .libs/nrnpy_hoc.o
nrnpy_hoc.cpp: In function 'char* nrnpy_PyString_AsString(PyObject*)':
nrnpy_hoc.cpp:1836:44: error: 'struct PyUnicodeObject' has no member named 'str'
nrnpy_hoc.cpp:1837:32: error: 'struct PyUnicodeObject' has no member named 'length'
nrnpy_hoc.cpp:1838:24: error: 'struct PyUnicodeObject' has no member named 'length'
nrnpy_hoc.cpp:1842:10: error: 'struct PyUnicodeObject' has no member named 'length'
make[4]: *** [nrnpy_hoc.lo] Error 1
make[4]: Leaving directory `/home/larry/neuron/nrn/src/nrnpython'
make[3]: *** [all] Error 2
make[3]: Leaving directory `/home/larry/neuron/nrn/src/nrnpython'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/larry/neuron/nrn/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/larry/neuron/nrn'
make: *** [all] Error 2


Larry

Re: NEURON does not compile with python3.3

Posted: Fri May 10, 2013 9:02 pm
by hines
This is fixed in http://www.neuron.yale.edu/hg/neuron/nr ... 41cf0aff14
Note that this changeset was applied to the 'Release 7.3' branch. You can switch from trunk to this branch with
hg update 'Release 7.3'
The experimental trunk may have problems with Python 3 due the addition of some files requiring cython.
Also, note that communication of Python 3 strings (unicode) into the hoc world is almost always a memory leak as the string must be converted to
an ascii c null terminated string. I will need to properly free these strings in the future.

Re: NEURON does not compile with python3.3

Posted: Wed May 15, 2013 9:32 am
by lneisenman
That did the trick. Thanks for the heads up on the potential memory leak.

Larry