GithubHelp home page GithubHelp logo

neuronsimulator / nrn Goto Github PK

View Code? Open in Web Editor NEW
354.0 28.0 114.0 150.63 MB

NEURON Simulator

Home Page: http://nrn.readthedocs.io

License: Other

Makefile 0.02% Shell 1.10% AMPL 1.48% C++ 58.01% Python 23.75% C 11.77% Batchfile 0.09% sed 0.01% CMake 2.93% Dockerfile 0.03% NASL 0.04% AGS Script 0.01% Cython 0.74% Perl 0.01% Cuda 0.04%
neuron neuroscience high-performance-computing simulation

nrn's Introduction

Build Status Actions Status Actions Status codecov Documentation Status

NEURON

NEURON is a simulator for models of neurons and networks of neuron. See http://neuron.yale.edu for installers, source code, documentation, tutorials, announcements of courses and conferences, and a discussion forum.

Installing NEURON

NEURON provides binary installers for Linux, Mac and Windows platforms. You can find the latest installers for Mac and Windows here. For Linux and Mac you can install the official Python 3 wheel with:

pip3 install neuron

If you want to build the latest version from source, we support CMake as build system. Autotools build system has been removed after 8.0 release. See detailed installation instructions: docs/install/install_instructions.md.

It is possible to install the Linux Python wheels on Windows via the Windows Subsystem for Linux (WSL) - check the installation instructions above.

Documentation

Changelog

Refer to docs/changelog.md

Contributing to NEURON development

Refer to NEURON contribution guidelines

Funding

NEURON development is supported by NIH grant R01NS11613 (PI M.L. Hines at Yale University).

Collaboration is provided by the Blue Brain Project, a research center of the École polytechnique fédérale de Lausanne (EPFL) with funding from the Swiss government's ETH Board of the Swiss Federal Institutes of Technology. Additional funding from the European Union Seventh Framework Program (FP7/20072013) under grant agreement no. 604102 (HBP) and the European Union's Horizon 2020 Framework Programme for Research and Innovation under Specific Grant Agreement no. 720270 (Human Brain Project SGA1), no. 785907 (Human Brain Project SGA2) and no. 945539 (Human Brain Project SGA3).

nrn's People

Contributors

1uc avatar adamjhn avatar alexsavulescu avatar alkino avatar brunomaga avatar c-conte avatar cattabiani avatar ferdonline avatar fouriaux avatar heerener avatar helveg avatar iomaganaris avatar jcgoran avatar jorblancoa avatar markovg avatar matz-e avatar mgeplf avatar minrk avatar nrnhines avatar ohm314 avatar olupton avatar pramodk avatar pramodskumbhar avatar ramcdougal avatar rgourdine avatar sgamiye avatar sharkovsky avatar st4rl3ss avatar weinaji avatar wwlytton avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nrn's Issues

Is it possible to uninsert a mechanism from python?

It seems that I can not uninsert a mechanism using the python syntax (I know I can do it with h("...")) but will there be a python syntax?

In [1]: from neuron import h
NEURON -- Release 7.4 (1351:8f462ea7e030) 2015-07-21
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2015
See http://www.neuron.yale.edu/neuron/credits

In [2]: h("create soma")
Out[2]: 1

In [3]: h.soma.insert('pas')
Out[3]: <nrn.Section at 0x7efd337b2ad0>

In [4]: h.soma.uninsert('pas')
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-4-3410dc5f141b> in <module>()
----> 1 h.soma.uninsert('pas')

Issue while using NEURON via python interpreter and multi-send enabled

Hi Michael,

I have been using nrniv to launch python script as nrniv -python script.py. But while using python interpreter I am seeing segfault and bit confused about this. Below are details:

I have following two compilations:

1.  ../configure --without-iv --without-x --without-readline --disable-rx3d --with-paranrn --with-nrnpython --prefix=`pwd`/install 

2.  ../configure --without-iv --without-x --without-readline --disable-rx3d --with-paranrn --with-nrnpython --with-multisend --prefix=`pwd`/install

So only change is enabling --with-multisend with 2nd installation.

I have simple test program to reproduce the issue:

○ → cat test.hoc

begintemplate test
proc init() {
}
endtemplate test

○ → cat test.py

from neuron import h
with open('test.hoc', "r") as f:
    h(f.read())

Now running above script via nrniv works fine:

○ → /Users/kumbhar/workarena/repos/bbp/nrn/build/install/x86_64/bin/nrniv -python test.py
NEURON -- VERSION 7.5 master (65f9c33) 2017-11-07
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2016
See http://neuron.yale.edu/neuron/credits
>>>

○ → /Users/kumbhar/workarena/repos/bbp/nrn/build_multisend/install/x86_64/bin/nrniv -python test.py
NEURON -- VERSION 7.5 master (65f9c33) 2017-11-07
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2016
See http://neuron.yale.edu/neuron/credits

>>>

All looks good! Now running same via python interpreter :

○ → export PYTHONPATH=/Users/kumbhar/workarena/repos/bbp/nrn/build/install/lib/python/
○ → python test.py
NEURON -- VERSION 7.5 master (65f9c33) 2017-11-07
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2016
See http://neuron.yale.edu/neuron/credits

○ → export PYTHONPATH=/Users/kumbhar/workarena/repos/bbp/nrn/build_multisend/install/lib/python/
○ → python test.py
NEURON -- VERSION 7.5 master (65f9c33) 2017-11-07
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2016
See http://neuron.yale.edu/neuron/credits

Segmentation fault: 11

So the multi-send enabled build fails with segfault!

I quickly looked into stack trace and its failing while hoc parsing:

…..
(gdb) r test.py
Starting program: /usr/bin/python test.py
[Thread debugging using libthread_db enabled]
NEURON -- VERSION 7.5 master (feafd0c+) 2016-11-05
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2016
See http://neuron.yale.edu/neuron/credits


Program received signal SIGSEGV, Segmentation fault.
yyparse () at parse.y:615
615	parse.y: No such file or directory.
	in parse.y
(gdb) bt
#0  yyparse () at parse.y:615
#1  0x00007ffff19b58b0 in hoc_ParseExec (yystart=8648608)
    at /gpfs/neuron-install-path//nrn/src/nrnoc/../oc/code.c:480
#2  0x00007ffff1737f1a in hoc_oc (buf=0xa84c80 "begintemplate test\nproc init() {\n}\nendtemplate test\n\n")
    at /gpfs/neuron-install-path//nrn/src/oc/hoc.c:1380
#3  0x00007ffff19bb5cf in hoc_obj_run (cmd=0x83f7a0 "P\241\206", ob=0x7ffff1c07090)
    at /gpfs/neuron-install-path//nrn/src/nrnoc/../oc/hoc_oop.c:335
#4  0x00007ffff143b81b in OcJumpImpl::execute (this=0x7eb790,
    stmt=0xa84c80 "begintemplate test\nproc init() {\n}\nendtemplate test\n\n", ob=0x0)
    at /gpfs/neuron-install-path//nrn/src/nrniv/../ivoc/ocjump.cpp:201
#5  0x00007ffff143bb14 in valid_stmt1 (stmt=0x83f7a0 "P\241\206", ob=0x7ffff1c07090)
    at /gpfs/neuron-install-path//nrn/src/nrniv/../ivoc/ocjump.cpp:31
#6  hoc_valid_stmt (stmt=0x83f7a0 "P\241\206", ob=0x7ffff1c07090)
    at /gpfs/neuron-install-path//nrn/src/nrniv/../ivoc/ocjump.cpp:37
#7  0x00007ffff1c12d3b in nrnexec (self=0x83f7a0, args=0x7ffff1c07090, kwrds=0xd43)
    at /gpfs/neuron-install-path//nrn/src/nrnpython/nrnpy_hoc.cpp:160
#8  hocobj_call (self=0x83f7a0, args=0x7ffff1c07090, kwrds=0xd43)
    at /gpfs/neuron-install-path//nrn/src/nrnpython/nrnpy_hoc.cpp:645
#9  0x0000003346443c63 in PyObject_Call () from /usr/lib64/libpython2.6.so.1.0
#10 0x00000033464d4f64 in PyEval_EvalFrameEx () from /usr/lib64/libpython2.6.so.1.0
#11 0x00000033464d7647 in PyEval_EvalCodeEx () from /usr/lib64/libpython2.6.so.1.0
#12 0x00000033464d7722 in PyEval_EvalCode () from /usr/lib64/libpython2.6.so.1.0
#13 0x00000033464f1b9c in ?? () from /usr/lib64/libpython2.6.so.1.0
#14 0x00000033464f1c70 in PyRun_FileExFlags () from /usr/lib64/libpython2.6.so.1.0
#15 0x00000033464f315c in PyRun_SimpleFileExFlags () from /usr/lib64/libpython2.6.so.1.0
#16 0x00000033464ff892 in Py_Main () from /usr/lib64/libpython2.6.so.1.0
#17 0x0000003330a1ed1d in __libc_start_main () from /lib64/libc.so.6
#18 0x0000000000400649 in _start ()
(gdb)

I don't have complete picture of what changes by just enabling multi-send at configure time. But if I look at compile output, I see following difference :

make_diff

So the warning messages on the left is when we enable multi-send. Do we enable some extra file wrapping related stuff (for performance reason) when when we enable multi-send?

OSX build error with GCC compiler and shared libraries with python

Hi Michael,

Another issue I am seeing with shared libraries on OS X is with GCC compiler. The configure line is:

'--without-iv' '--without-x' '--without-readline' '--disable-rx3d' '--with-paranrn' 
'--with-multisend' 'MPICC=/usr/local/bin/mpicc' 'MPICXX=/usr/local/bin/mpic++' 
'macdarwin=no' '--with-nrnpython=/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7' 
'CFLAGS=-O2 -g' 'CXXFLAGS=-O2 -g'

During install we get error:

copying /Users/kumbhar/neuron-install/share/nrn/lib/python/neuron/rxd/section1d.py -> build/lib.macosx-10.12-intel-2.7/neuron/rxd
copying /Users/kumbhar/neuron-install/share/nrn/lib/python/neuron/rxd/species.py -> build/lib.macosx-10.12-intel-2.7/neuron/rxd
running build_ext
building 'neuron.hoc' extension
creating build/temp.macosx-10.12-intel-2.7
/usr/local/bin/mpicc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 
-g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX
 -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os 
-Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -I/Users/kumbhar/neuron-build/nrn/src/oc -I../oc -I/Users/kumbhar/neuron-build/nrn/src/nrnmpi -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c inithoc.cpp -o build/temp.macosx-10.12-intel-2.7/inithoc.o
gcc-4.9: error: unrecognized command line option '-Wshorten-64-to-32'
error: command '/usr/local/bin/mpicc' failed with exit status 1
make[3]: *** [install-exec-hook] Error 1
make[2]: *** [install-exec-am] Error 2
make[1]: *** [install-am] Error 2
make: *** [install-recursive] Error 1

Here clang specific flags (e.g. -Wshorten-64-to-32) are getting added for GCC compiler.
Do you think this is worth fixing? Or we should do --disable-pysetup with GCC on OS X ?

INSTALL file inaccuracy

INSTALL and Readme.md mentions to run ./configure,
however, it does not mention to run
sh ./build.sh first

remove Section and SectionList

Hello,

I'm a new user of Neuron in the python environment. There is a couple of questions I came across when trying to go through the tutorials and other toolkits.

The first is related to an old question in the neuron forum: is there any better way available now to delete a section or a section list?
link to the question: https://www.neuron.yale.edu/phpBB/viewtopic.php?t=1484

And second, I went a bit into the nrn.py code to understand what exactly is going on but saw all pass inside functions. Therefore, I assume this is a superclass that would be inherited by some subclass? The question would be, if it's possible, where can I find the code? It would help a lot to understand the logic behind...

Finally, for the manipulation of sections. I saw in some of the examples that people create a SectionList for subsections. However, I feel like in python one can also use a python list for this purpose. Both python list and neuron list contain pointers pointing to sections. For neuron list, as it's a stack of sections (did I misunderstand here?), I don't know if there is an easier way to access one particular section other than searching through the SectionList? And if there is, would you recommend to use neuron list or python list for handling sections?
Looking forward to your answer.

Best regards.
Weiwei

nrn-7.5.tar.gz tarball missing cray Random123 header

Hi Michael,

I updated some of my builds to include latest 7.5 tarball and saw below error with Cray compiler:

CC-5 craycc: ERROR File = /users/kumbhar/nrn-7.5/src/Random123/features/compilerfeatures.h, Line = 211
  The source file "crayfeatures.h" is unavailable.
  #include "crayfeatures.h"

We added crayfeatures.h in the past and is part of git repository. But somehow it is missing in the tarball :

$ ll ~/tmp/nrn-7.5/src/Random123/features/
total 80
-rw-r--r-- 1 kumbhar d38  2669 Dec 18  2016 clangfeatures.h
-rw-r--r-- 1 kumbhar d38 11033 Dec 18  2016 compilerfeatures.h
-rw-r--r-- 1 kumbhar d38  1672 Dec 18  2016 fujitsufeatures.h
-rw-r--r-- 1 kumbhar d38  7413 Dec 18  2016 gccfeatures.h
-rw-r--r-- 1 kumbhar d38  5967 Dec 18  2016 iccfeatures.h
-rw-r--r-- 1 kumbhar d38  1685 Dec 18  2016 llvmfeatures.h
-rw-r--r-- 1 kumbhar d38  5068 Dec 18  2016 msvcfeatures.h
-rw-r--r-- 1 kumbhar d38  3663 Dec 18  2016 nvccfeatures.h
-rw-r--r-- 1 kumbhar d38  2007 Dec 18  2016 open64features.h
-rw-r--r-- 1 kumbhar d38  2794 Dec 18  2016 openclfeatures.h
-rw-r--r-- 1 kumbhar d38  5915 Dec 18  2016 pgccfeatures.h
-rw-r--r-- 1 kumbhar d38 10004 Dec 18  2016 sse.h
-rw-r--r-- 1 kumbhar d38  4286 Dec 18  2016 sunprofeatures.h
-rw-r--r-- 1 kumbhar d38  6115 Dec 18  2016 xlcfeatures.h

Could you have a look and update tarball?

segfault while using NEURON with PGI compiler

Built NEURON with PGI compiler as:

./build.sh
./configure '--without-iv' '--disable-rx3d' 'CC=/tools/pgi/16.5/linux86-64/16.5/bin/pgcc' 'CXX=/tools/pgi/16.5/linux86-64/16.5/bin/pgc++'  'linux_nrnmech=no' '--with-paranrn' '--with-nrnpython=/usr/bin/python2.6' '--disable-pysetup' 'CFLAGS=-fPIC -O2' 'CXXFLAGS=-fPIC -O2' '--enable-shared'
make -j12 VERBOSE=1

When I try to run test, see segfault:

NEURON -- VERSION 7.5 branches/trunk (f1bde0f+) 2016-10-24
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2016
See http://neuron.yale.edu/neuron/credits

Segmentation fault (core dumped)

The stack trace shows:

(gdb) r -python ringtest.py
Starting program: /install-path/x86_64/bin/nrniv -python ringtest.py
[Thread debugging using libthread_db enabled]
NEURON -- VERSION 7.5 branches/trunk (f1bde0f+) 2016-10-24
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2016
See http://neuron.yale.edu/neuron/credits


Program received signal SIGSEGV, Segmentation fault.
sym_extra_alloc ()
  at /nrn-path/src/oc/symbol.c:354
354	/nrn-path/src/oc/symbol.c: No such file or directory.
	in /nrn-path/src/oc/symbol.c
Missing separate debuginfos, use: debuginfo-install glibc-2.12-1.192.el6.x86_64 libX11-1.6.3-2.el6.x86_64 libXau-1.0.6-4.el6.x86_64 libgcc-4.4.7-17.el6.x86_64 libibverbs-1.2.1mlnx1-OFED.3.4.0.1.4.34100.x86_64 libnl-1.1.4-2.el6.x86_64 librdmacm-1.1.0mlnx-OFED.3.4.0.0.4.34100.x86_64 libstdc++-4.4.7-17.el6.x86_64 libxcb-1.11-2.el6.x86_64 ncurses-libs-5.7-4.20090207.el6.x86_64 numactl-2.0.9-2.el6.x86_64 python-libs-2.6.6-66.el6_8.x86_64 readline-6.0-4.el6.x86_64
(gdb) bt
#0  sym_extra_alloc ()
  at /nrn-path/src/oc/symbol.c:354
#1  0x00007ffff74a99ff in hoc_symbol_limits ()
  at /nrn-path/src/oc/code2.c:98
#2  0x00007ffff7dbdbd2 in hoc_register_limits ()
  at /nrn-path/src/nrnoc/init.c:771
#3  0x00007ffff7dbc85f in hoc_last_init ()

nocmodl : Verbatim block in DERIVATIVE block causes abort / assert failure

I assume it’s “valid” to have verbatim block in DERIVATIVE block.
Here is very trivial example from NEURON source directory:

--- a/src/nrnoc/hh.mod
+++ b/src/nrnoc/hh.mod
@@ -77,6 +77,9 @@ INITIAL {
 ? states
 DERIVATIVE states {
         rates(v)
+        VERBATIM
+
+        ENDVERBATIM
         m' =  (minf-m)/mtau
         h' = (hinf-h)/htau
         n' = (ninf-n)/ntau

Here I added empty VERBATIM block with an empty line. If I try to compile this with nocmodl then I get:

nocmodl ~/nrn-git/src/nrnoc/hh.mod
Translating ……/hh.mod into ……../hh.c
Assertion failed: (0), function copyitems, file /Users/kumbhar…./nrn/src/nmodl/deriv.c, line 918.
Abort trap: 6

This is because copyitems implementation in deriv.c (called from massagederiv) doesn’t handle Item of type VERBATIM :

void copyitems(q1, q2, qdest) /* copy items before item */
    Item* q1, *q2, *qdest;
{
    Item* q;
    for (q = q2; q != q1; q = q->prev) {
        switch(q->itemtype) {

        case STRING:
            Linsertstr(qdest, STR(q));
            break;
        case SYMBOL:
            Linsertsym(qdest, SYM(q));
            break;
        default:
            /*SUPPRESS 622*/
            assert(0);
        }
    }
}

Is this a bug? Could we update/fix this?

MPI init from Python

Typically a Neuron sim defined in Python is run with mpi like:

mpirun -n x nrniv -mpi -python script.py

But, if first we want to start only python interpreter and then at certain point initialize MPI, I would like to do:

.....
from neuron import h    # this should initiliaze mpi?
# Or, h.nrn_mpi_init(...)  # expose this to initialize 
....
pc = h.ParallelContext()
id = int(pc.id())
nhost = int(pc.nhost())
print("I am {} of {}".format(id, nhost))

And we will launch this with mpirun -n x python script.py

As described in some neuron tutorials, MPI4py can be used to initialize MPI, which happens at import time. But MPI4py might be unavailable/difficult to have on some platforms.

Would it be possible to expose some API to python or hoc to achieve the above use cases?
This would help us in the ongoing changes to neurodamus.
@jamesgking @pramodk

Unaligned soma contour stacks

Hi again,

This issue is the follow up of #76.
I am given a NeuroLucida file with (what I think is) a soma contour stack. Example:

("CellBody"
(Color Red)
(CellBody)
( -11.25 -22.78 1.66 0.28) ; 1, 1
( -13.04 -17.52 1.66 0.28) ; 1, 2
( -15.60 -11.61 1.66 0.28) ; 1, 3
( -15.39 -4.32 1.66 0.28) ; 1, 4
( -12.88 1.02 1.66 0.28) ; 1, 5
( -11.10 3.84 1.66 0.28) ; 1, 6
( -8.55 6.01 -4.57 0.28) ; 1, 7
( -6.64 3.38 -4.57 0.28) ; 1, 8
( -3.51 -3.52 -4.57 0.28) ; 1, 9
)

To make it a proper NRN contour stack I have broken it into 2 CellBody blocks. One for each stack:

("CellBody"
(Color Red)
(CellBody)
( -11.25 -22.78 1.66 0.28) ; 1, 1
( -13.04 -17.52 1.66 0.28) ; 1, 2
( -15.60 -11.61 1.66 0.28) ; 1, 3
( -15.39 -4.32 1.66 0.28) ; 1, 4
( -12.88 1.02 1.66 0.28) ; 1, 5
( -11.10 3.84 1.66 0.28) ; 1, 6
)

("CellBody"
(Color Red)
(CellBody)
( -8.55 6.01 -4.57 0.28) ; 1, 7
( -6.64 3.38 -4.57 0.28) ; 1, 8
( -3.51 -3.52 -4.57 0.28) ; 1, 9
)

However this is still not interpreted as a contour stack because both stacks are not aligned along Z.
Indeed, the code checks that the 2D bounding boxes (in the XY plane) of each stack overlap. In my case, for example, they don't and the soma stack ends up being not reconstructed. This will potentially happen for somas that lie in a plane almost parallel to the XY-plane.

I guess the intent of the bounding box constraint is to avoid reconstructing 2 distinct cell bodies as a soma stack but there could be other mean to achieve that (maybe a simple threshold on the distance between the stacks would be more conservative ?)

Thanks again for your help

Issue while re-building from existing build directory ?

Hi Michael,

Recently I am seeing below error message if I follow below workflow :

  • I have compiled neuron as usual
  • then I modify some mod files (e.g. hh.mod)
  • then I do make -j8 in build directory
(export MODLUNIT=/gpfs/bbp.cscs.ch/project/proj16/kumbhar/sources/viz_ddt/sources/nrnmpi/../neuron/share/lib/nrnunits.lib; ../nmodl/nocmodl /gpfs/bbp.cscs.ch/project/proj16/kumbhar/sources/viz_ddt/sources/nrnmpi/../neuron/src/nrnoc/hh.mod)
Translating /gpfs/bbp.cscs.ch/project/proj16/kumbhar/sources/viz_ddt/sources/nrnmpi/../neuron/src/nrnoc/hh.mod into /gpfs/bbp.cscs.ch/project/proj16/kumbhar/sources/viz_ddt/sources/nrnmpi/../neuron/src/nrnoc/hh.c
Thread Safe
sed "s/_reg()/_reg_()/" /gpfs/bbp.cscs.ch/project/proj16/kumbhar/sources/viz_ddt/sources/nrnmpi/../neuron/src/nrnoc//gpfs/bbp.cscs.ch/project/proj16/kumbhar/sources/viz_ddt/sources/nrnmpi/../neuron/src/nrnoc/hh.c > /gpfs/bbp.cscs.ch/project/proj16/kumbhar/sources/viz_ddt/sources/nrnmpi/../neuron/src/nrnoc//gpfs/bbp.cscs.ch/project/proj16/kumbhar/sources/viz_ddt/sources/nrnmpi/../neuron/src/nrnoc/hh.c.tmp
/bin/sh: /gpfs/bbp.cscs.ch/project/proj16/kumbhar/sources/viz_ddt/sources/nrnmpi/../neuron/src/nrnoc//gpfs/bbp.cscs.ch/project/proj16/kumbhar/sources/viz_ddt/sources/nrnmpi/../neuron/src/nrnoc/hh.c.tmp: No such file or directory
make[3]: *** [/gpfs/bbp.cscs.ch/project/proj16/kumbhar/sources/viz_ddt/sources/nrnmpi/../neuron/src/nrnoc/hh.c] Error 1
make[3]: Leaving directory `/gpfs/bbp.cscs.ch/project/proj16/kumbhar/sources/viz_ddt/sources/nrnmpi/src/nrnoc'

If I remove build directory and start fresh then everything build fine. I am not sure if this is reproducible on other systems but I wonder if something is changed recently.

neuron build on OS X without --disable-pysetup

Hi Michael,

I have been using --disable-pysetup. If I remove that, on OS X we get error like:

	fi
 /usr/local/bin/ginstall -c -m 644 nrnconf.h '/Users/travis/build/pramodskumbhar/spack-packages/spack/opt/spack/darwin-elcapitan-x86_64/clang-7.3.0-apple/neuron-develop-gmfle/x86_64/lib'
 /usr/local/bin/gmkdir -p '/Users/travis/build/pramodskumbhar/spack-packages/spack/opt/spack/darwin-elcapitan-x86_64/clang-7.3.0-apple/neuron-develop-gmfle/share/nrn'
 /usr/local/bin/ginstall -c libtool '/Users/travis/build/pramodskumbhar/spack-packages/spack/opt/spack/darwin-elcapitan-x86_64/clang-7.3.0-apple/neuron-develop-gmfle/share/nrn'
running install
error: must supply either home or prefix/exec-prefix -- not both
make[3]: *** [install-exec-hook] Error 1
make[2]: *** [install-exec-am] Error 2
make[1]: *** [install-am] Error 2
make: *** [install-recursive] Error 1

If we scroll to the end of build log here, we can see this error. Is this something relevant?

This builds fine on linux.

BBCOREPOINTER and solve method compatibility

I had a synapse model where I didn't specify a solve method and I had a BBCOREPOINTER variable.

I got the following error while compiling the model for NEURON:

Translating ProbAMPANMDA_EMS.mod into ProbAMPANMDA_EMS.c
Notice: adrunge is not thread safe. Complain to Hines
"/home/cremones/soft/nrn/install/share/nrn/libtool" --tag=CC --mode=compile mpicc -DHAVE_CONFIG_H  -I. -I.. -I"/home/cremones/soft/nrn/install/include/nrn" -I"/home/cremones/soft/nrn/install/x86_64/lib"      -g -O2 -c -o ProbAMPANMDA_EMS.lo ProbAMPANMDA_EMS.c
libtool: compile:  mpicc -DHAVE_CONFIG_H -I. -I.. -I/home/cremones/soft/nrn/install/include/nrn -I/home/cremones/soft/nrn/install/x86_64/lib -g -O2 -c ProbAMPANMDA_EMS.c  -fPIC -DPIC -o .libs/ProbAMPANMDA_EMS.o
ProbAMPANMDA_EMS.c:300:71: error: expected declaration specifiers or ‘...’ before ‘)’ token
  static void bbcore_write(double*, int*, int*, int*, _threadargsproto_);

The error was fixed by explicitly specifying solve method to cnexp, but it would be useful to give an error from nocmodl when:

  1. if BBCOREPOINTER is explicitly used in the model
  2. the method specified is not threadsafe.

The rationale would be that if we are using BBCOREPOINTER, then the model should be compatible with CoreNeuron.

Thank you.

incompatible mechanism version when importing neuron module from python

when I run

./x86_64/special -python

everything works as expected, and my custom mod files are imported correctly.
However, if I first run python and then try to import the module, the whole thing crashes.

~ $ python
Python 2.7.12 (default, Nov 19 2016, 06:48:10) 
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from neuron import h
NEURON -- VERSION 7.5 master (4d65a2c+) 2017-08-17
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2016
See http://neuron.yale.edu/neuron/credits

loading membrane mechanisms from x86_64/.libs/libnrnmech.so
Additional mechanisms from files
 mwe-modfiles//intfire1.mod
Mechanism 7.5.0 needs to be re-translated.
It's pre version 6.0 "c" code is incompatible with this neuron version.

This happens regardless of the code in the mod files. In the example above, I tried copy-pasting the intfire1.mod artificial cell.

This wouldn't be an issue, except that it breaks my jupyter notebook worfklow.

I am using commit 8ae0ca8.

Thanks

Building NEURON on Mac OSX with Python Anaconda

Thanks to @pramodk's help, I have been able to jump through all the hoops necessary to compile NEURON on Mac OSX using Python installed via Anaconda.
This issue is solved, but I'd like to leave a trace of the steps necessary for building, in case other people have similar problems.

Summary

  1. You need to add at least the following options to configure step
./configure macdarwin=no --with-nrnpython=$HOME/anaconda3/bin/python PYINCDIR=$HOME/anaconda3/include/python3.5m/ PYLIBDIR=$HOME/anaconda3/lib/
  1. when executing, you need to set DYLD_LIBRARY_PATH and PYTHONHOME
export DYLD_LIBRARY_PATH=$HOME/anaconda3/lib/:$DYLD_LIBRARY_PATH
export PYTHONHOME=$HOME/anaconda3/

More details

Problem with CarbonCore.framework

At first, I got the following problem:

gcc -g -arch i386 -Dncpu="\"x86_64\"" -I. ./launch.c ./mac2uxarg.c -framework Carbon
In file included from /usr/include/dispatch/dispatch.h:51:0,
                 from /System/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h:15,
                 from /System/Library/Frameworks/CoreFoundation.framework/Headers/CFPropertyList.h:13,
                 from /System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:55,
                 from /System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:19,
                 from /System/Library/Frameworks/Carbon.framework/Headers/Carbon.h:20,
                 from ./mac2uxarg.c:10:
/usr/include/dispatch/object.h:143:15: error: expected identifier or '(' before '^' token
 typedef void (^dispatch_block_t)(void);
               ^
/usr/include/dispatch/object.h:362:3: error: unknown type name 'dispatch_block_t'
   dispatch_block_t notification_block);
   ^
./mac2uxarg.c: In function 'fullname':
./mac2uxarg.c:93:7: warning: 'PBGetCatInfoSync' is deprecated (declared at /System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Files.h:8732) [-Wdeprecated-declarations]
       err = PBGetCatInfoSync(&myPB);
       ^
make[2]: *** [install] Error 1

This was fixed by specifying macdarwin=no in the configure line

Linking with Anaconda Python

First, you need to find where you anaconda was installed.
Mine was installed at $HOME/anaconda3.
During the configure phase, you need to carefully specify the correct paths.

For example, I am using python3.5 and the following (minimal) configure line

./configure macdarwin=no --with-nrnpython=$HOME/anaconda3/bin/python PYINCDIR=$HOME/anaconda3/include/python3.5m/ PYLIBDIR=$HOME/anaconda3/lib/

Setting runtime environment

when you execute, you need to make sure that DYLD_LIBRARY_PATH and PYTHONHOME are both correctly set.

export DYLD_LIBRARY_PATH=$HOME/anaconda3/lib/:$DYLD_LIBRARY_PATH
export PYTHONHOME=$HOME/anaconda3/
nrniv -python
NEURON -- VERSION 7.5 master (e0950a1+) 2017-11-14
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2016
See http://neuron.yale.edu/neuron/credits

loading membrane mechanisms from x86_64/.libs/libnrnmech.so
Additional mechanisms from files

>>>

Issue with nocmodl when if statement is used in DERIVATIVE block

Hi Michael,

With Giuseppe, we were trying to do following :

DERIVATIVE states   {
    if (enable == 1) {
      m' = (mInf-m)/mTau
      h' = (hInf-h)/hTau
    }
}

Basically we want to compute states under certain conditions. Above example gives an error :

NaTs2_t.c:259:81: error: function definition is not allowed here
 static int states (double* _p, Datum* _ppvar, Datum* _thread, _NrnThread* _nt) { {
                                                                                ^

This is because _ode_matsol1 is missing }:

 static int _ode_matsol1 (double* _p, Datum* _ppvar, Datum* _thread, _NrnThread* _nt) {
 if ( enable  == 1.0 ) {
   Dm = Dm  / (1. - dt*( ( ( ( - 1.0 ) ) ) / mTau )) ;
   Dh = Dh  / (1. - dt*( ( ( ( - 1.0 ) ) ) / hTau )) ;
 return 0;
}
 /*END CVODE*/

May be this should be fixed in nocmodl?

Making pattern.mod compatible with CoreNEURON

Hi Michael,

We started testing PatternStim functionality with one of the simulation. Currently coreneuron version of MOD file is marked as THREADSAFE but not in NEURON. Due to this (extra voltage (v) variable) we end up with an error:

PatternStim prop sizes differ psize 3 2   dpsize 4 4
Error: PatternStim is different version of MOD file than the one used by NEURON!

What do you propose for compatibility?

In the generated dataset there are no instances of patternstim. We can check if there is an instance in the dataset of coreneuron before throwing an error. But I would like to ask about general use case of pattern.mod.

Python 3 support

Many of the examples need to be updated for Python 3 support. Obvious things to look for: print, xrange.

Consolidating Python build

Currently, neuron has three separate setup.py files, but only builds one actual package.

I think this can be simplified to a single Python build, with conditionals appropriately defined in setup.py for building with/without Cython (remove makefile rules for Cython files) and numpy.

Currently, make install doesn't result in an importable package, so I do the following to get packages where they ought to end up:

make install
cd src/nrnpython
# remove installs to non-standard locations:
rm -rf $PREFIX/lib/python/neuron
rm -rf $PREFIX/share/nrn/lib/python
# redo standard install:
python setup.py install

Additionally, running the current standard command for installing Python packages from source: pip install . doesn't get the needed files because of the separate builds for rxd, crxd.

Would you be interested in nrnpython installation behaving more like a standard Python package? To me, that would mean:

  1. standard python setup.py install or pip install . in src/nrnpython
  2. single setup.py, building rxd, crxd as appropriate instead of 3 separate setup.pys
  3. standard Python installation, no more non-standard share/nrn/lib/python or lib/python/neuron (both of which appear to include the same files?)

fail to play a vector to iclamp in for loop

Hi,
I've got some issue when simulating in the python-neuron environment, where I want to inject currents with arbitrary time serials into multiple locations. If I'm setting the current clamps in a for loop, only the last stimulation would work. On the other hand, it also doesn't work when I try to define a current injection in a function (see the inject_curr below). Can anyone point out what's the problem?
Following is an example code:

from neuron import *
from nrn import *
import matplotlib.pyplot as plt
import numpy as np

h.t = 0.
tstop = 10**2.
h.dt = 2**-4.


axon = Section()
axon.L = 3000
axon.nseg = 3000
axon.insert('hh')
axon.insert('pas')

VecAxon = h.Vector()
VecAxon.record(axon(0.1)._ref_v)

stimlist = h.List()
veclist = h.List()

def inject_curr(sec, curr_loc, t):
    VecT = h.Vector(t)
    VecStim = h.Vector(10*np.sin(t/5))
    stim = h.IClamp(sec(curr_loc))
    stim.dur = 1e9
    stim.delay = 0
    VecStim.play(stim._ref_amp, VecT)
    stimlist.append(stim)
    veclist.append(VecStim)
    return VecStim, sec

    
time = h.Vector()
time.record(h._ref_t)
tt = np.linspace(h.t, tstop, np.fix((-h.t+tstop)/h.dt +1))

VecStim1, axon = inject_curr(axon, .5, tt)

for i in range(5):
    t = h.Vector(np.array([i*20, i*20+5]))
    VecStim = h.Vector([100, -20])
    loc = .1+i*.1
    stim = h.IClamp(axon(loc))
    stim.dur = 1e9
    stim.delay = 0
    VecStim.play(stim._ref_amp, t)
    stimlist.append(stim)
    veclist.append(VecStim)

h.finitialize(-68)
run(tstop)

plt.figure()
plt.plot(tt,VecAxon)
plt.plot(tt,(np.array(VecStim1)/50 -68.))
plt.show()

Best regards

no nrnversion.h when downloaded as zip

Small building issue:
When you download from github as zip-file, the file nrnversion.h is missing
and compilation fails.

When you git clone nrn, all is fine.

PWManager printfile does not accept more than 98 characters

It seems that the PWManager does not accept more than 98 characters, you can run the following example and see.

from neuron import gui
from neuron import h
import os

h("create soma")
a = h.Shape()
p = h.PWManager()
print(p.name(p.count()-1))
p.paper_place(p.count()-1,1)




base_string = os.getcwd() + "/"
string_98 = base_string + 'a'*(98-len(base_string))
string_99 = base_string + 'a'*(98-len(base_string)+1)



p.printfile(string_98, 0, 0)
print('Done saving filename with 98 characters')

raw_input('continue?')
p.printfile(string_99, 0, 0)
print('Done saving filename with 99 characters')

This is the output that I get

Done saving filename with 98 characters
continue?
*** buffer overflow detected ***: /home/amsalem/anaconda2/bin/python terminated
Aborted (core dumped)

Vector.as_numpy() not available and raising hoc error

We have been facing errors when trying to use Vector.as_numpy(). E.g.

from neuron import h
v = h.Vector(2)
v.append(1)
print(v.as_numpy())
nrniv: Vector.as_numpy() error
 near line 0
 objref hoc_obj_[2]
                   ^
        Vector[0].as_numpy()
oc_restore_code tobj_count=1 should be 0
Traceback (most recent call last):
  File "test_vec.py", line 4, in <module>
    print(v.as_numpy())
RuntimeError: hoc error

In our use case we are launching directly with nrniv -python test_vec.py, and have found the problem with the system Python (2.7.5) and spack deployed 3.6.5.

Having read this forum entry, it seems again a problem in detecting the dll location. In lib/python/neuron/__init__.py it fails (after removing the try-catch) with:

line 449, in nrn_dll()
    the_dll = ctypes.cdll[hoc.__file__]
AttributeError: module 'hoc' has no attribute '__file__'

It seems therefore that nrn, being a compiled in module, doesn't expose its path, even though it eventually made it in some Python versions. Are we lacking some build flag or any other configuration option?

Alternatively we were wondering if as_array() couldn't be implemented using the Numpy C-API directly, as it would almost certainly be more performant. Any thoughts regarding that?

Python/Python.h on Mac OS High Sierra

When I try to compile NEURON on Mac OS High Sierra, I get
In file included from ../../../src/nrnpython/grids.c:9:
../../../src/nrnpython/grids.h:10:10: fatal error: 'Python/Python.h' file not found
#include <Python/Python.h>
^~~~~~~~~~~~~~~~~

I have a feeling this has something to do with High Sierra. I can't find Python/Python.h on my system.

There was also a similar issue in MacVim it seems:
macvim-dev/macvim#552

What's also a bit strange, is that I get:
In file included from ../../../src/nrnpython/rxd_vol.c:3:
../../../src/nrnpython/grids.h:10:10: fatal error: 'Python/Python.h' file not found
although I use '--disable-rxd', is this expected ?

segfault in libnrnoc.so

I am using a genetic algorithm which makes use of NEURON internally.
Sometimes the optimizer throws an exception and I think this is due to an issue of NEURON.
After the optimizer crashes, I can see some segfaults with dmesg. Besides that, the optimizer is able to run let's say 10k isolated simulation, that's why I think that the scripts I use are fine.

I don't have the very latest version of NEURON installed, so maybe this issue has already been fixed?
If you think this issue isn't related to NEURON, any ideas what the source could be?

Ubuntu 16.04
NEURON -- VERSION 7.5 master (a535c69) 2017-07-03

dmesg output:

[245638.095254] nrniv[55518]: segfault at 0 ip 00007f8467b74fc2 sp 00007ffd45bafbb0 error 4 in libnrnoc.so.0.0.0[7f8467b38000+53000]
[245638.101086] nrniv[55494]: segfault at 0 ip 00007f7072bebfc2 sp 00007ffe8f3d7230 error 4 in libnrnoc.so.0.0.0[7f7072baf000+53000]
[245638.148074] nrniv[55489]: segfault at 0 ip 00007f22bd46bfc2 sp 00007fffd3710520 error 4 in libnrnoc.so.0.0.0[7f22bd42f000+53000]
[245638.200100] nrniv[55482]: segfault at 0 ip 00007f5781166fc2 sp 00007ffc07c837c0 error 4 in libnrnoc.so.0.0.0[7f578112a000+53000]
[263274.876058] nrniv[83302]: segfault at 0 ip 00007fa6e71d0fc2 sp 00007ffcf3440aa0 error 4 in libnrnoc.so.0.0.0[7fa6e7194000+53000]
[263274.879951] nrniv[83283]: segfault at 0 ip 00007f5035bdcfc2 sp 00007ffe360661d0 error 4 in libnrnoc.so.0.0.0[7f5035ba0000+53000]
[263274.891081] nrniv[83290]: segfault at 0 ip 00007f2418a7efc2 sp 00007fff4d425e60 error 4 in libnrnoc.so.0.0.0[7f2418a42000+53000]
[263274.994994] nrniv[83294]: segfault at 0 ip 00007f4a78117fc2 sp 00007ffd87d30730 error 4 in libnrnoc.so.0.0.0[7f4a780db000+53000]

MUSIC example using Python

Hi there,

I'm interested in writing an application for real-time spike visualization and weight modification in large networks. I thought MUSIC would be a good candidate for this, to write a little app that receives and sends events to NEURON.

I saw on the NEURON forums that MUSIC has been made available from within Python (in this announcement). However, I couldn't find any examples that indicate how to use it. Are there any good examples or tutorials for this?

Alternatively, if MUSIC is not the way for real time spike communication with a running simulation, is there another easy method? Maybe a way for connecting a NetCon to a network socket directly?

Cheers,
Lucas.

NEURON installation with XL compiler and shared libraries on Power8 system

Hi Michael,

We were mostly using XL compilers for BlueGene. I am trying NEURON on Power8 system with XL compiler in Juelich. Builds are working with:

  • shared as well as static builds with GCC compiler
  • static build with XL compiler

For shared library build with XL compiler I am getting error as:

make[3]: Entering directory `/tmp/pcp0043/spack-stage/spack-stage-DFTxaL/nrn/build/src/ivoc'
/bin/sh ../../libtool  --tag=CXX   --mode=link /gpfs/software/opt/openmpi-2.0.2-xl/bin/mpic++ -I/home/pramod/nrn/src/gnu -I/home/pramod/nrn/src/mesch -I../../src/oc -I/home/pramod/nrn/src/oc -I/home/pramod/nrn/src/nrnmpi -I/home/pramod/nrn/src/ivos  -O2 -g   -o ivoc nrnmain.o ivocmain.o classreg.o datapath.o ocjump.o symdir.o ../oc/nocable.o ../oc/modlreg.o ../oc/libocxt.la ../oc/liboc.la libivoc.la ../nrnmpi/libnrnmpi.la ../oc/liboc.la ../memacs/libmemacs.la ../mesch/libmeschach.la ../gnu/libneuron_gnu.la ../ivos/libivos.la  ../readline/libreadline.la -lncurses   -lm -ldl
libtool: link: /gpfs/software/opt/openmpi-2.0.2-xl/bin/mpic++ -I/home/pramod/nrn/src/gnu -I/home/pramod/nrn/src/mesch -I../../src/oc -I/home/pramod/nrn/src/oc -I/home/pramod/nrn/src/nrnmpi -I/home/pramod/nrn/src/ivos -O2 -g -o .libs/ivoc nrnmain.o ivocmain.o classreg.o datapath.o ocjump.o symdir.o ../oc/nocable.o ../oc/modlreg.o  ../oc/.libs/libocxt.so ./.libs/libivoc.so ../nrnmpi/.libs/libnrnmpi.so ../oc/.libs/liboc.so ../memacs/.libs/libmemacs.so ../mesch/.libs/libmeschach.so ../gnu/.libs/libneuron_gnu.so ../ivos/.libs/libivos.so ../readline/.libs/libreadline.so -lncurses -lm -ldl -Wl,-rpath -Wl,/home/pramod/install/powerpc64le/lib
/usr/bin/ld: .libs/ivoc: hidden symbol `__dso_handle' in /usr/lib/gcc/ppc64le-redhat-linux/4.8.5/crtbegin.o is referenced by DSO
/usr/bin/ld: final link failed: Bad value
make[3]: *** [ivoc] Error 1
make[3]: Leaving directory `/tmp/pcp0043/spack-stage/spack-stage-DFTxaL/nrn/build/src/ivoc'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/tmp/pcp0043/spack-stage/spack-stage-DFTxaL/nrn/build/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/tmp/pcp0043/spack-stage/spack-stage-DFTxaL/nrn/build'
make: *** [all] Error 2
==> Error: ProcessError: Command exited with status 2:
    'make'

The configure like I used is:

'/home/pramod/nrn/configure' '--prefix=/home/pramod/install' '--without-iv' '--without-x' '--without-readline' '--disable-rx3d' '--with-paranrn' '--with-multisend' 'MPICC=/gpfs/software/opt/openmpi-2.0.2-xl/bin/mpicc' 'MPICXX=/gpfs/software/opt/openmpi-2.0.2-xl/bin/mpic++' '--with-nrnpython=/gpfs/software/opt/python/2.7.13/bin/python2.7' 'PYINCDIR=/gpfs/software/opt/python/2.7.13/include/python2.7' 'PYLIBDIR=/gpfs/software/opt/python/2.7.13/lib' 'PYTHON_BLD=/gpfs/software/opt/python/2.7.13/bin/python2.7' 'PYTHON_BLD=/gpfs/software/opt/python/2.7.13/bin/python2.7' 'CFLAGS=-O2 -g' 'CXXFLAGS=-O2 -g'

According to this link, I checked the __dso_handle symbol and it does appear:

cd nrn/build
$ nm ./src/oc/.libs/libocxt.so | grep __dso_handle
000000000003fdb8 d __dso_handle

Do you have any suggestion to try?

(for shared library build, we can use GCC compilers and it's not big issue)

Enable daily build on travis?

HI Michael,

This is not an issue but it would be good if we enable daily/weekly build on travis here.

We have to add cron job for the master branch as shown below:

neuron_travis

Two weeks ago travis build was failed due to transient issue with Travis and hence the build status is shown as error on README file. Having cron job would be useful to have up to date status.

Error with latest changes to nocmodl: "xxx not really a STATE; Ie. No differential equation for it."

Hi Michael,

The latest changes to nmodl/nocmodl in NEURON is causing this error:

Translating ProbAMPANMDA_EMS.mod into ProbAMPANMDA_EMS.c
Notice: This mechanism cannot be used with CVODE
A_AMPA not really a STATE; Ie. No differential equation for it.
 at line 329 in file ProbAMPANMDA_EMS.mod
^

I haven't looked into all details but obvisouly MOD file doesn't have differential equations and looks like:

STATE {

        A_AMPA       
        B_AMPA       
        ....
}

BREAKPOINT {

        SOLVE state
        ......
}

PROCEDURE state() {
        A_AMPA = A_AMPA*A_AMPA_step
        B_AMPA = B_AMPA*B_AMPA_step
        A_NMDA = A_NMDA*A_NMDA_step
        B_NMDA = B_NMDA*B_NMDA_step
}

So is it expected adapt/modify all such mod files? (sample mod file is here]

issue:compiling package in linux

when I want to compile this package i get error.
commands:
$git clone https://github.com/neuronsimulator/nrn --depth=1
$cd nrn
$./build.sh
$configure --prefix=pwd --with-nrnpython ==without-iv
$make
My info:
In file included from ./ivstream.h:11:0,
from ./../../nrnconf.h:364,
from file.cpp:2:
./ivstrm.h:44:22: fatal error: iostream.h: No such file or directory
compilation terminated.
Makefile:616: recipe for target 'file.lo' failed
make[5]: *** [file.lo] Error 1
make[5]: Leaving directory '/home/marjan/nrn/src/ivos'
Makefile:633: recipe for target 'all-recursive' failed
make[4]: *** [all-recursive] Error 1
make[4]: Leaving directory '/home/marjan/nrn/src/ivos'
Makefile:500: recipe for target 'all' failed
make[3]: *** [all] Error 2
make[3]: Leaving directory '/home/marjan/nrn/src/ivos'
Makefile:515: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/home/marjan/nrn/src'
Makefile:652: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/marjan/nrn'
Makefile:510: recipe for target 'all' failed
make: *** [all] Error 2
$ sudo lsb_release -a
No LSB modules are available.
Distributor ID: LinuxMint
Description: Linux Mint 18.2 Sonya
Release: 18.2
Codename: sonya
I installed these dependencies:
$sudo apt-get update
$sudo apt-get install git
$sudo apt-get install libtool automake autoconf m4 autotools-dev
$sudo apt-get install libncursesw5-dev ncurses-base ncurses-bin ncurses-term libncurses5-dev
$sudo apt-get install gcc
$sudo apt-get install build essential g++
$sudo apt-get install python-dev
$sudo apt-get install linux-headers-$(uame -r)
$sudo apt-get install libc6-dev
$sudo apt-get install libstdc++6
$sudo apt-get install libstdc++-4.8-dev

please help me!what should I do?

Regression with last changes to ivocmain.cpp

Hi Michael,

With the latest master, I am seeing segfault with below backtrace:

[New LWP 361645]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib64/libthread_db.so.1".
Core was generated by `/gpfs/bbp.cscs.ch/home/kumbhar/workarena/systems/bbpv/softwares/install/spack/t'.
Program terminated with signal 11, Segmentation fault.
#0  0x00002aaaafa05c31 in __strlen_sse2 () from /usr/lib64/libc.so.6
Missing separate debuginfos, use: debuginfo-install glibc-2.17-196.el7_4.2.x86_64 hdf5-1.8.12-10.el7.x86_64 libaec-1.0.2-1.el7.x86_64 libbitmask-2.0-sgi716r63.rhel73.x86_64 libcpuset-1.0-sgi716r94.rhel73.x86_64 libgcc-4.8.5-16.el7_4.1.x86_64 libgomp-4.8.5-16.el7_4.1.x86_64 libibverbs-41mlnx1-OFED.4.1.0.1.1.41102.x86_64 libmlx4-41mlnx1-OFED.4.1.0.1.0.41102.x86_64 libmlx5-41mlnx1-OFED.4.1.0.1.5.41102.x86_64 libnl-1.1.4-3.el7.x86_64 libnuma-3.0sgi-sgi716r61.rhel73.x86_64 libstdc++-4.8.5-16.el7_4.1.x86_64 ncurses-libs-5.9-14.20130511.el7_4.x86_64 python-libs-2.7.5-58.el7.x86_64 xpmem-1.6-sgi716r125.rhel73.x86_64 zlib-1.2.7-17.el7.x86_64
(gdb) bt
#0  0x00002aaaafa05c31 in __strlen_sse2 () from /usr/lib64/libc.so.6
#1  0x00002aaaafa0593e in strdup () from /usr/lib64/libc.so.6
#2  0x0000000000406c12 in ivocmain (argc=5, argv=0x7fffffffc568, env=0x7fffffffc598)
    at /gpfs/bbp.cscs.ch/home/kumbhar/workarena/systems/bbpv/softwares/sources/spack/var/spack/stage/neuron-develop-ontw6g46ztduqvwirtiozbvszgnc73sw/nrn/src/ivoc/ivocmain.cpp:624
#3  0x00000000004064d6 in main (argc=5, argv=0x7fffffffc568, env=0x7fffffffc598)
    at /gpfs/bbp.cscs.ch/home/kumbhar/workarena/systems/bbpv/softwares/sources/spack/var/spack/stage/neuron-develop-ontw6g46ztduqvwirtiozbvszgnc73sw/nrn/src/ivoc/nrnmain.cpp:53
(gdb) quit

Compilation problem -- linking with python

Hello,

I am having a problem with python during link time while compiling latest master. Here is the error code I see:

Making all in nrniv
make[3]: Entering directory `/gpfs/bbp.cscs.ch/project/proj16/cremones/SpikeExchangePerformanceModeling/balanced-random-net/src/neuron/build-viz/src/nrniv'
/bin/sh ../../libtool --tag=CXX   --mode=link mpic++  -DLAYOUT=0 -DDISABLE_HOC_EXP -DDISABLE_TIMEOUT -O3 -g -DCORENEURON_BUILD   -o nrniv nvkludge.o ../ivoc/nrnmain.o ../ivoc/ivocmain.o ../oc/modlreg.o ../oc/ockludge.o ../nrnoc/libnrnoc.la ../oc/liboc.la libnrniv.la ../ivoc/libivoc.la ../oc/liboc.la ../nrnmpi/libnrnmpi.la     ../gnu/libneuron_gnu.la ../scopmath/libscopmath.la ../sparse13/libsparse13.la ../sundials/libsundials.la ../memacs/libmemacs.la ../mesch/libmeschach.la ../ivos/libivos.la   ../nrnpython/libnrnpython.la -L/nix/store/m95ad3zjmcq5hdmc4dnhcwjhi0vbsz98-python-2.7.11/lib -lpython2.7 -lpthread -ldl  -lutil  -R/nix/store/m95ad3zjmcq5hdmc4dnhcwjhi0vbsz98-python-2.7.11/lib ../readline/libreadline.la -L/nix/store/0qbm6w87r0b01bzsa592g91nykwr41ax-ncurses-5.9/lib -lncursesw    -lm -ldl
libtool: link: mpic++ -DLAYOUT=0 -DDISABLE_HOC_EXP -DDISABLE_TIMEOUT -O3 -g -DCORENEURON_BUILD -o .libs/nrniv nvkludge.o ../ivoc/nrnmain.o ../ivoc/ivocmain.o ../oc/modlreg.o ../oc/ockludge.o  ../nrnoc/.libs/libnrnoc.so ./.libs/libnrniv.so ../ivoc/.libs/libivoc.so ../oc/.libs/liboc.so ../nrnmpi/.libs/libnrnmpi.so ../gnu/.libs/libneuron_gnu.so ../scopmath/.libs/libscopmath.so ../sparse13/.libs/libsparse13.so ../sundials/.libs/libsundials.so ../memacs/.libs/libmemacs.so -L/nix/store/0qbm6w87r0b01bzsa592g91nykwr41ax-ncurses-5.9/lib ../mesch/.libs/libmeschach.so ../ivos/.libs/libivos.so ../nrnpython/.libs/libnrnpython.so /nix/store/ksvsbr7pg4z69bv6fbbc8h7x7rm2104m-gcc-4.9.3/lib/../lib64/libstdc++.so -L/nix/store/m95ad3zjmcq5hdmc4dnhcwjhi0vbsz98-python-2.7.11/lib -lpython2.7 -lpthread -lutil ../readline/.libs/libreadline.so -lncursesw -lm -ldl -Wl,-rpath -Wl,/gpfs/bbp.cscs.ch/project/proj16/cremones/SpikeExchangePerformanceModeling/balanced-random-net/src/install-viz/x86_64/lib -Wl,-rpath -Wl,/nix/store/ksvsbr7pg4z69bv6fbbc8h7x7rm2104m-gcc-4.9.3/lib/../lib64 -Wl,-rpath -Wl,/nix/store/m95ad3zjmcq5hdmc4dnhcwjhi0vbsz98-python-2.7.11/lib
../nrnpython/.libs/libnrnpython.so: undefined reference to `nrnpy_call_python_with_section'
collect2: error: ld returned 1 exit status

This was configured using the following line

configure --prefix=$INSTALL_DIR --without-iv --with-paranrn --with-nrnpython  --disable-rx3d

Thank you

Nonfatal error during Neuron make install

When I build the latest commit in master (5524b18)

I'm getting the following error on Mac OS X High Sierra (Python 2.7.14 provided by pyenv), when compiling Neuron:

byte-compiling /Users/werner/local/nrnnogui/lib/python2.7/site-packages/neuron/hclass3.py to hclass3.pyc
File "/Users/werner/local/nrnnogui/lib/python2.7/site-packages/neuron/hclass3.py", line 30
class hc(hoc.HocObject, metaclass=MetaHocObject):
^
SyntaxError: invalid syntax

It seems it's not a fatal error, because the build process finishes 'normally'

configure options: ../configure --with-nrnpython --without-x --disable-rx3d

Segfault while using PGI compiler and starting nrniv

Hi Michael,

This is just as placeholder, I will look into details after SFN.

I did compile neuron with pgi during last months but didn't run tests.
Today while revisiting some benchmarks, I see following error:

Compiled neuron as :

./configure '--without-iv' '--without-x' '--without-readline' '--disable-rx3d' '--with-paranrn' '--with-multisend' 'MPICC=/gpfs/bbp.cscs.ch/apps/viz/tools/pgi/16.5/linux86-64/2016/mpi/openmpi-1.10.2/bin/mpicc' 'MPICXX=/gpfs/bbp.cscs.ch/apps/viz/tools/pgi/16.5/linux86-64/2016/mpi/openmpi-1.10.2/bin/mpic++' '--with-nrnpython=/usr/bin/python' 'PYINCDIR=/usr/include/python2.6' 'PYLIBDIR=/usr/lib' 'PYTHON_BLD=/usr/bin/python' '--disable-pysetup' 'PYTHON_BLD=/usr/bin/python' 'CFLAGS=-O2 -g -fpic' 'CXXFLAGS=-O2 -g -fpic' --prefix=`pwd`/install
make 
make install

And trying to launch nrniv gives:

gdb ./install/x86_64/bin/nrniv
(gdb) r
Starting program: /gpfs/bbp.cscs.ch/home/kumbhar/tmp/nrn/install/x86_64/bin/nrniv
[Thread debugging using libthread_db enabled]
NEURON -- VERSION 7.5 hinesmaster (feafd0c) 2016-11-05
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2016
See http://neuron.yale.edu/neuron/credits

Program received signal SIGSEGV, Segmentation fault.
0x0000003330b3394f in __strlen_sse42 () from /lib64/libc.so.6
Missing separate debuginfos, use: debuginfo-install glibc-2.12-1.209.el6_9.2.x86_64 libgcc-4.4.7-18.el6.x86_64 libibverbs-1.2.1mlnx1-OFED.4.0.1.5.3.40200.x86_64 libnl-1.1.4-2.el6.x86_64 librdmacm-1.1.0mlnx-OFED.4.0.1.6.1.40200.x86_64 libstdc++-4.4.7-18.el6.x86_64 ncurses-libs-5.7-4.20090207.el6.x86_64 numactl-2.0.9-2.el6.x86_64 python-libs-2.6.6-66.el6_8.x86_64
(gdb) nt
Undefined command: "nt".  Try "help".
(gdb) bt
#0  0x0000003330b3394f in __strlen_sse42 () from /lib64/libc.so.6
#1  0x00007ffff747e9b2 in hoc_install (s=0x1 <Address 0x1 out of bounds>, t=326, d=0, list=0x7ffff7692be0) at ./symbol.c:102
#2  0x00007ffff7ddce11 in class2oc (name=0x7ffff7b1fe5f "Shape", cons=0x7ffff79dd8a0 <sh_cons(Object*)>,
    destruct=0x7ffff79dd8b0 <sh_destruct(void*)>, m=0x7ffff7d79920, checkpoint=0, mobjret=0x7ffff7d79b40, strret=0x0)
    at ./../oc/hoc_oop.c:1518
#3  0x00007ffff79dd8fb in Shape_reg () at ./shape.cpp:567
#4  0x00007ffff79dd9a4 in hoc_class_registration () at ../ivoc/classreg.cpp:29
#5  0x00007ffff7dd2b9a in hoc_init () at ./../oc/hoc_init.c:314
#6  0x00007ffff7479914 in hoc_main1_init (pname=0x7fffffffd708 "/gpfs/bbp.cscs.ch/home/kumbhar/tmp/nrn/install/x86_64/bin/nrniv",
    envp=0x4028d800007fff) at ./hoc.c:776
#7  0x00000000004028d8 in ivocmain (argc=1, argv=0x7fffffffd348, env=0x7fffffffd358) at ./ivocmain.cpp:688
#8  0x00000000004022ab in main (argc=1, argv=0x7fffffffd348, env=0x7fffffffd358) at ./nrnmain.cpp:25

hh.mod incompatibility with coreneuron

Hello,

using latest masters from both NEURON and coreneuron results in incompatibility in the hh.mod file.
The error is:

hh prop sizes differ psize 25 19   dpsize 6 6
Error: hh is different version of MOD file than the one used by NEURON!

After discussion with @pramodk , it turns out that this workaround solves the problem:

sed -i -e 's/GLOBAL minf/RANGE minf/g' src/nrnoc/hh.mod
sed -i -e 's/TABLE minf/:TABLE minf/g' src/nrnoc/hh.mod

However, I would extremely appreciate to avoid having to manually modify the source files.

Would it be possible to have a configure option that does this automatically?

Thank you very much!

Undesired NetCons are polluting my coreneuron dataset! (Assertion `iw == nweight' failed)

Hello,

when I create cells in a python script, with the intent of producing a coreneuron dataset later on, I follow this paradigm:

pc = h.ParallelContext()
cell = myCell()
pc.set_gid2node(1, 0)  # Assign GID 1 to rank 0
nc = h.NetCon(cell.soma[0](1)._ref_v, None, sec=cell.soma[0])  # Create a NetCon as a spike detector for this cell
pc.cell(1, nc)                 # Associate the above NetCon spike detector with GID 1

Unfortunately, if I don't take any special care to destroy the nc NetCon, this leads to the error

Assertion `iw == nweight' failed

while coreneuron is reading that dataset.

The Workaround

so far has been to manually clean up the NetCon before calling pc.nrnbbcore_write. There are two ways to do this:

  1. manually set nc = None after pc.cell;
  2. wrap the code above in a function, so nc gets automatically dereferenced

Question

In the short-term, do you have a better/cleaner (or simply a standard) way to deal with this issue?
In the long-term, would it be possible somehow for NEURON to distinguish relevant NetCons from irrelevant ones, and automatically avoid writing the irrelevant ones to the coreneuron dataset?

Thank you

Additional extracellular batteries

The following is a request for the capacity to add extracellular batteries between e_pas and e_extracellular, corresponding to n-1 layers.

Neurolucida somas are not interpreted as contour stack

Hi there,

I have a question concerning soma contour stacks. If my understanding is correct NRN detects a soma contour stack if it finds multiple "CellBody" blocks that have overlapping XY-bounding boxes (ie. stacks are more or less on top of each others olong the Z-axis).

I am provided with ASC files coming from NeuroLucida, and from what I can see they "intent" to provide soma stacks but they don't follow what I just described right before. Indeed, all stacks are stuffed into the same CellBody block. Example:

("CellBody"
(Color Red)
(CellBody)
( -11.25 -22.78 1.66 0.28) ; 1, 1
( -13.04 -17.52 1.66 0.28) ; 1, 2
( -15.60 -11.61 1.66 0.28) ; 1, 3
( -15.39 -4.32 1.66 0.28) ; 1, 4
( -12.88 1.02 1.66 0.28) ; 1, 5
( -11.10 3.84 1.66 0.28) ; 1, 6
( -8.55 6.01 -4.57 0.28) ; 1, 7
( -6.64 3.38 -4.57 0.28) ; 1, 8
( -3.51 -3.52 -4.57 0.28) ; 1, 9
)

Here we can see the soma is defined at 2 different values of Z: 1.66, -4.57 but NRN does not get that this is a soma stack

My question is:
Is this the expected behaviour ? I am not a NeuroLucida user, maybe there is a button in Neurolucida to explicitely specify that you want stacks that the experimentalist forgot to check. Or should NRN catch-up on the fact that there are stacks ?

Thanks a lot

Nrnivmodl doesn't generate a relevant exit code

Would it be possible to let nrnivmodl output a relevant exit code in case of an error ?
As far as I can see it allows returns exit code '0', even if an error occurs.

E.g.:

nrnivmodl dir_doesnt_exists
...
make: *** No rule to make target dir_doesntexist.mod', needed by dir_doesntexist.lo'. Stop.
echo $?
0

This is important to catch exceptions in scripts that use nrnivmodl.
A solution could be to at 'set -e' to the nrnivmodl script.

[Question] nrn_timeout for all ranks

Hi Michael,

I wonder why we register timeout signal only for rank 0 and not all. For debugging purpose we wanted to register a callback to print the stacktrace from all ranks.

The relevant code snippet is :

void nrn_timeout(int seconds) {
    if (nrnmpi_myid != 0) { return; }
#if NRNTIMEOUT_DEBUG
printf("nrn_timeout(%d) t=%g\n", seconds, nrn_threads->_t);
old_nrn_time = nrn_time();
#endif
#if BLUEGENE
    if (seconds) {
        told = nrn_threads->_t;
        signal(SIGALRM, timed_out);
    }else{
        signal(SIGALRM, SIG_DFL);
    }
...
}

cc : @jamesgking

can not load a asc morphology

Hello,
I am trying to load the following morphology to NEURON but It throws the following error message:

oc>
parse error
itok=351 on line 40 token=err x=0 s=
line 40:   (GUID "")

I delete all the GUID lines from the asc file and then I am able to load the morphology but I can not see the soma.
The morphology is in the attached zip file, both the pre (before removing the GUID lines) and the post (after removing those lines)

You can use this tool tool to see that it is possible to load the morphology:
https://neuroinformatics.nl/HBP/morphology-viewer

Also the morphology is not yet complete as it is still work in progress..

Thanks.

Morphology.zip

About GLOBAL variable promotion to RANGE (instead of thread)

Hi Michael,

If we have global variable in the mod file then we translate it as:

  • if variable is read-only then it gets defined as global variable in C
  • if mod file is marked as thread safe and if variable is updated in any nmodl block then we promote that to thread variable

(In the past) we were considering only thread level parallelism. But now we have SIMD parallelism within thread. Also, single neuron thread (NrnThread) could have multiple lightweight threads executing (e.g. for gpus in the context of coreneuron).

Hence, for the second case I think we should promote variables to RANGE rather than thread.

One question remains is what happens to constructs like TABLE statement involving such variables. (I remember you mentioning TABLE statement with RANGE variables won't be valid?)

For example, StochKv mod file has:

NEURON {
    SUFFIX StochKv3
    THREADSAFE
    ....
    RANGE N0, N1, n0_n1, n1_n0
    GLOBAL ninf, linf, ltau, ntau, an, bn, al, bl
    GLOBAL P_an, P_bn, P_al, P_bl
    GLOBAL vmin, vmax
    BBCOREPOINTER rng
}

ASSIGNED {
    .....
    scale_dens (pS/um2)
    ninf        : steady-state value
    ntau (ms)   : time constant for relaxation
    linf        : steady-state value
    ltau (ms)   : time constant for relaxation
    P_an     : probability of one channel making alpha n transition
    P_bn     : probability of one channel making beta n transition
    P_al     : probability of one channel making alpha l transition
    P_bl     : probability of one channel making beta l transition

    rng
    usingR123
}

DERIVATIVE states {
.....
      P_an = strap(an*dt)
      P_bn = strap(bn*dt)
}

PROCEDURE trates(v (mV)) {
    TABLE ntau,ltau,ninf,linf,al,bl,an,bn
    DEPEND dt
    FROM vmin TO vmax WITH 199

    v = v + 10
    linf = 1/(1+exp((-30(mV)-v)/10(mV)))
    ltau = 0.346(ms)*exp(-v/(18.272(mV)))+2.09(ms)
....
}

In above case, translated C file has thread specific variables which is not vectorisation / gpu safe:

#define P_bl _thread[_gth]._pval[0]
#define P_al _thread[_gth]._pval[1]
...
#define linf _thread[_gth]._pval[9]

@wvangeit @fouriaux @jamesgking

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.