NEURON 7.6.2 Source Code Compilation and Python versions

Post Reply
Darshan
Posts: 40
Joined: Tue Jul 02, 2013 5:11 am

NEURON 7.6.2 Source Code Compilation and Python versions

Post by Darshan »

Hi,

1. I am trying to compile NEURON 7.6.2 source code on Ubuntu 18.04.1. I have got these files from
https://neuron.yale.edu/ftp/neuron/versions/alpha/ :
[ ] iv-19.tar.gz 2018-08-01 16:42 1.2M
[ ] nrn-7.6.2.tar.gz 2018-08-15 13:27 7.8M
(The source code at https://www.neuron.yale.edu/neuron/download/getstd gives the files for v7.5)

Are these files for the v7.6.2 release or do they refer to current alpha version?

I went ahead and tried compiling these files. 'iv' was compiled successfully. On executing the make statement in nrn folder I got this error:

Code: Select all

nrnversion.c: In function ‘nrn_version’:
nrnversion.c:137:14: error: ‘SVN_BRANCH’ undeclared (first use in this function)
  if (strncmp(SVN_BRANCH, "Release", 7) == 0) {
              ^~~~~~~~~~
nrnversion.c:137:14: note: each undeclared identifier is reported only once for each function it appears in
nrnversion.c:144:23: error: ‘SVN_CHANGESET’ undeclared (first use in this function)
  sprintf(tail, " %s", SVN_CHANGESET);
                       ^~~~~~~~~~~~~
nrnversion.c:161:30: error: ‘SVN_TREE_CHANGE’ undeclared (first use in this function)
   sprintf(buf, "%s.%s", head,SVN_TREE_CHANGE);
                              ^~~~~~~~~~~~~~~
nrnversion.c:163:22: error: ‘SVN_BASE_CHANGESET’ undeclared (first use in this function); did you mean ‘SVN_CHANGESET’?
   sprintf(buf, "%s", SVN_BASE_CHANGESET);
                      ^~~~~~~~~~~~~~~~~~
                      SVN_CHANGESET
nrnversion.c:165:22: error: ‘SVN_DATE’ undeclared (first use in this function); did you mean ‘SVN_BRANCH’?
   sprintf(buf, "%s", SVN_DATE);
                      ^~~~~~~~
                      SVN_BRANCH
Makefile:729: recipe for target 'nrnversion.lo' failed
make[4]: *** [nrnversion.lo] Error 1
make[4]: Leaving directory '/home/mpiuser/neuron/nrn/src/nrnoc'
Makefile:523: recipe for target 'all' failed
make[3]: *** [all] Error 2
make[3]: Leaving directory '/home/mpiuser/neuron/nrn/src/nrnoc'
Makefile:518: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/home/mpiuser/neuron/nrn/src'
Makefile:655: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/mpiuser/neuron/nrn'
Makefile:513: recipe for target 'all' failed
make: *** [all] Error 2
make
I used --with-nrnpython=/usr/bin/python and --with-paranrn parameters for the configure command. I have both python 2.7 and 3.6 installed. /usr/bin/python points to python 2.7.

2. Which python version is advisable to use for NEURON ? Will the new release work with both python 2.7 and 3.6?

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

Re: NEURON 7.6.2 Source Code Compilation and Python versions

Post by ted »

Are these files for the v7.6.2 release or do they refer to current alpha version?
If they're from the "alphas" directory, they were for whatever alpha version was "most recent" as of the time that you downloaded them. In recent weeks there has been a lot of development activity aimed at ensuring that NEURON works with multiple "current" versions of Python across all platforms.
I went ahead and tried compiling these files. 'iv' was compiled successfully. On executing the make statement in nrn folder I got this error
If you got your alpha version more than a day or two ago, it is possible that this has been fixed. You might prefer to download the latest development code from the github repository, just to make sure that what you're using is completely up to date.
Which python version is advisable to use for NEURON ?
Whatever version you need for your current program development. For the sake of simplicity, Linux users may prefer to stick with whatever is used by their OS (at present this is usually 2.7--find out by seeing what
which python
returns).
Will the new release work with both python 2.7 and 3.6?
Yes. For example, under Mint 18.3, which uses 2.7, I installed Python 3. After compiling NEURON I did
cd src/nrnpython
sudo python3 setup.py install
and after that was able to use python3 to execute Python code that imported h and gui from neuron, etc..
Darshan
Posts: 40
Joined: Tue Jul 02, 2013 5:11 am

Re: NEURON 7.6.2 Source Code Compilation and Python versions

Post by Darshan »

Hi Ted,

I was able to compile the alpha version of the code successfully but with some warnings. I used python3 for the process.

Some of the warnings were related to deprecated NumPy API:

Code: Select all

/home/mpiuser/.local/lib/python3.6/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
 #warning "Using deprecated NumPy API, disable it by " \


and rxd

Code: Select all

ctng.cpp:2494:18: warning: ‘PyObject* __pyx_f_6neuron_3rxd_10geometry3d_4ctng_closest_pt(PyObject*, PyObject*, PyObject*)’ defined but not used [-Wunused-function]
 static PyObject *__pyx_f_6neuron_3rxd_10geometry3d_4ctng_closest_pt(PyObject *__pyx_v_pt, PyObject *__pyx_v_pts, PyObject *__pyx_v_z2) {
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ctng.cpp:2422:18: warning: ‘PyObject* __pyx_f_6neuron_3rxd_10geometry3d_4ctng_convert3dto2d(double, double, double, double, double, double, double, double, double, double, double, double)’ defined but not used [-Wunused-function]
 static PyObject *__pyx_f_6neuron_3rxd_10geometry3d_4ctng_convert3dto2d(double __pyx_v_x, double __pyx_v_y, double __pyx_v_z, double __pyx_v_px, double __pyx_v_py, double __pyx_v_pz, double __pyx_v_xx, double __pyx_v_xy, double __pyx_v_xz, double __pyx_v_yx, double __pyx_v_yy, double __pyx_v_yz) {

                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ctng.cpp: In function ‘PyObject* __pyx_pf_6neuron_3rxd_10geometry3d_4ctng_2constructive_neuronal_geometry(PyObject*, PyObject*, int, double)’:
ctng.cpp:13650:40: warning: ‘__pyx_v_somaz’ may be used uninitialized in this function [-Wmaybe-uninitialized]
         __pyx_t_11 = PyFloat_FromDouble(__pyx_v_somaz); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 379, __pyx_L1_error)
                      ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
which I think won't be a problem (?). I hope this version of development code (downloaded today) can be safely used as the v7.6.2 source code.

Thanks,
Darshan
aschloegl
Posts: 5
Joined: Mon Feb 25, 2013 3:11 am
Contact:

Re: NEURON 7.6.2 Source Code Compilation and Python versions

Post by aschloegl »

Darshan wrote: Tue Aug 21, 2018 4:55 am Hi,

1. I am trying to compile NEURON 7.6.2 source code on Ubuntu 18.04.1. I have got these files from
https://neuron.yale.edu/ftp/neuron/versions/alpha/ :
[ ] iv-19.tar.gz 2018-08-01 16:42 1.2M
[ ] nrn-7.6.2.tar.gz 2018-08-15 13:27 7.8M
(The source code at https://www.neuron.yale.edu/neuron/download/getstd gives the files for v7.5)

Are these files for the v7.6.2 release or do they refer to current alpha version?

I went ahead and tried compiling these files. 'iv' was compiled successfully. On executing the make statement in nrn folder I got this error:

Code: Select all

nrnversion.c: In function ‘nrn_version’:
nrnversion.c:137:14: error: ‘SVN_BRANCH’ undeclared (first use in this function)
  if (strncmp(SVN_BRANCH, "Release", 7) == 0) {
              ^~~~~~~~~~
nrnversion.c:137:14: note: each undeclared identifier is reported only once for each function it appears in
nrnversion.c:144:23: error: ‘SVN_CHANGESET’ undeclared (first use in this function)
  sprintf(tail, " %s", SVN_CHANGESET);
                       ^~~~~~~~~~~~~
nrnversion.c:161:30: error: ‘SVN_TREE_CHANGE’ undeclared (first use in this function)
   sprintf(buf, "%s.%s", head,SVN_TREE_CHANGE);
                              ^~~~~~~~~~~~~~~
nrnversion.c:163:22: error: ‘SVN_BASE_CHANGESET’ undeclared (first use in this function); did you mean ‘SVN_CHANGESET’?
   sprintf(buf, "%s", SVN_BASE_CHANGESET);
                      ^~~~~~~~~~~~~~~~~~
                      SVN_CHANGESET
nrnversion.c:165:22: error: ‘SVN_DATE’ undeclared (first use in this function); did you mean ‘SVN_BRANCH’?
   sprintf(buf, "%s", SVN_DATE);
                      ^~~~~~~~
                      SVN_BRANCH
Makefile:729: recipe for target 'nrnversion.lo' failed
make[4]: *** [nrnversion.lo] Error 1
make[4]: Leaving directory '/home/mpiuser/neuron/nrn/src/nrnoc'
Makefile:523: recipe for target 'all' failed
make[3]: *** [all] Error 2
make[3]: Leaving directory '/home/mpiuser/neuron/nrn/src/nrnoc'
Makefile:518: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/home/mpiuser/neuron/nrn/src'
Makefile:655: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/mpiuser/neuron/nrn'
Makefile:513: recipe for target 'all' failed
make: *** [all] Error 2
make
I used --with-nrnpython=/usr/bin/python and --with-paranrn parameters for the configure command. I have both python 2.7 and 3.6 installed. /usr/bin/python points to python 2.7.

2. Which python version is advisable to use for NEURON ? Will the new release work with both python 2.7 and 3.6?

Thanks,
Darshan
I came across the same error message, ".. SVN_branch undeclared .. ", and figured out that running ./build.sh was the culprit, Downloading the official release, unpacking the source, not running build.sh and running "configure && make && make install " compiles the official release w/o these errors.
ted
Site Admin
Posts: 6286
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: NEURON 7.6.2 Source Code Compilation and Python versions

Post by ted »

Suggest you get rid of the alpha and instead get what has become the standard distribution (7.6.2 actually), which was put online shortly after Darshan's most recent post and properly linked from https://neuron.yale.edu/neuron/download/getstd.
Post Reply