Compiling NEURON/Python

When Python is the interpreter, what is a good
design for the interface to the basic NEURON
concepts.

Moderator: hines

Post Reply
bscoventry
Posts: 22
Joined: Tue Mar 26, 2013 2:07 pm

Compiling NEURON/Python

Post by bscoventry » Sun Feb 15, 2015 9:51 pm

Hi all,

I have been using Matlab calls to run NEURON. While this works for small simulations, the amount of data overhead for our models has caused our run times to be off the scales for simulations. I'm hoping to run python and Neuron so that variables can be shared between NEURON and our control programs in Matlab(soon to be ported to Python). I'm following the procedure in Hines et al 2009 Frontiers paper on a Windows 8 with cygwin machine. When compiling neuron, I get the following error that I am not sure how to track:

Making all in e_editor
make[3]: Entering directory `C:/Users/Brandon/nrn-7.3/src/e_editor'
gcc -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../../src/nrnpython -I../../src/oc -DPROGVERSION=\"ed-1.5\" -g -O2 -MT buffer.o -MD -MP -MF .deps/buffer.Tpo -c -o buffer.o buffer.c
gcc: fatal error: no input files
compilation terminated.
make[3]: *** [buffer.o] Error 1
make[3]: Leaving directory `C:/Users/Brandon/nrn-7.3/src/e_editor'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `C:/Users/Brandon/nrn-7.3/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `C:/Users/Brandon/nrn-7.3'
make: *** [all] Error 2

Any help regarding this error or how to trace it would be much appreciated!

~Brandon

ted
Site Admin
Posts: 5510
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Compiling NEURON/Python

Post by ted » Sun Feb 15, 2015 11:50 pm

Are you sure you need to compile NEURON from source code? The MSWin installers come with Python that includes useful stuff like numpy, matplotlib. I'd suggest one of the latest nrn-7.4.alpha*exe installers from
http://www.neuron.yale.edu/ftp/neuron/versions/alpha/
The cygwin version is suitable for most users; those who need Enthought Canopy should get the mingw installer.

bscoventry
Posts: 22
Joined: Tue Mar 26, 2013 2:07 pm

Re: Compiling NEURON/Python

Post by bscoventry » Mon Feb 16, 2015 10:59 am

Hi Ted,

Thank you for the reply. Maybe I don't need to. I guess I should clarify: I'm trying to run NEURON as a Python module. I have tried to use other precompiled packages (PyNEURON) and while the basic functionality worked, I could not PyNEURON to read in an DLL files for mechanisms, so I thought I'd get to the root of it myself.

Thank you!

Brandon

ted
Site Admin
Posts: 5510
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Compiling NEURON/Python

Post by ted » Mon Feb 16, 2015 12:06 pm

bscoventry wrote:I'm trying to run NEURON as a Python module. I have tried to use other precompiled packages (PyNEURON) and while the basic functionality worked, I could not PyNEURON to read in an DLL files for mechanisms, so I thought I'd get to the root of it myself.
You didn't say how you tried to get "PyNEURON to read in an DLL files for mechanisms" or what the symptom of failure was. However, I should point out that the dll that contains compiled mechanisms is version-specific--a dll created by mknrndll under one version of NEURON will, in general, not be usable by a different version of NEURON. So if you are stuck with PyNEURON, then you are stuck with dlls that you create by compiling mod files under that particular version of PyNEURON. I don't know anything about PyNEURON--does it come with its own mknrndll? If so,
1. Delete the dll(s) that don't work, and also delete all old .o and .c files that may be lying around.
2. Put the mod files you want to compile in the same directory as any hoc or py files that you want to execute with PyNEURON.
3. In that directory, run PyNEURON's mknrndll to compile your mod files. This should generate a new dll in that directory.
4. In that directory do whatever you do with your py and hoc files. NEURON should detect the presence of the dll and read the compiled mechanisms that it contains.

bscoventry
Posts: 22
Joined: Tue Mar 26, 2013 2:07 pm

Re: Compiling NEURON/Python

Post by bscoventry » Mon Feb 16, 2015 4:00 pm

Hi Ted,

Thank you so much for your helpful tips. Step 3 is where I was amiss, I thought NEURON mknrndll would suffice. Using PyNEURONS mknrndll solved the problem. Thank you again!

Brandon

Post Reply