How is neuron python module created

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

Moderator: hines

Post Reply
blloyd
Posts: 11
Joined: Tue Aug 16, 2011 4:33 am

How is neuron python module created

Post by blloyd »

Hi

Is the neuron python module created by wrapping C/C++ code automatically (e.g. like boost-python), or is the code wrapped by hand?

How much effort would it be to re-write the configure system to use CMake or another, more portable build configure system?

Thanks for any hints/ideas...

Regards, Bryn
hines
Site Admin
Posts: 1682
Joined: Wed May 18, 2005 3:32 pm

Re: How is neuron python module created

Post by hines »

It is not wrapped. I don't think boost would work since dynamically and user created classes, variables, functions, etc need to be
available to both python and hoc. The native interface is in nrn/src/nrnpython.
There are thoughts about replacing the native interface with a generic API and then using ctypes with a pure python replacement of
the nrnpython c++ code.

I'm perfectly happy with autotools but it certainly is complex. I've never used cmake.
There is a lot of effort that has been invested in the Makefile.am files. I wonder
if am2cmake allows an easy switch?
blloyd
Posts: 11
Joined: Tue Aug 16, 2011 4:33 am

Re: How is neuron python module created

Post by blloyd »

Because of my problems to compile on Windows, which obviously might related to the compiler and not the configure system, I would have liked to try out some things.
However, autotools is unreadable for my eyes and therefore uneditable.

I am usually quite quick at putting together a cmake configuration for a library, but it depends if only the compiler/linker is called or if autotools is starting any complicated scripts to wrap the code, or similar. Note that lots of scientific code is using cmake.

The am2cmake script works for a basic preparation, but things like configured headers and platform dependent stuff needs to done manually.
If there is real interest and if I have time I might have a look into writing a prototype.

BTW. I see that some "external" code in neuron (at least sundials) is shipped with cmake...
Post Reply