Running NEURON from Cygwin

Post Reply
neuromau
Posts: 94
Joined: Mon Apr 20, 2009 6:02 pm

Running NEURON from Cygwin

Post by neuromau » Tue Jul 09, 2013 6:33 pm

Hi, I installed the precompiled 32-bit NEURON for Windows on a 64-bit Windows 7 Machine and added it to the path. Then, from the rxvt shell, I just enter 'nrniv' and it starts and runs my code fine. However, if I try to run it from the Cygwin terminal, when I enter nrniv, I get an error:
NEURON -- Release 7.3 (849:5be3d097b917) 2013-04-11
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2013
See http://www.neuron.yale.edu/neuron/credits

Traceback (most recent call last):
File "/cygdrive/c/cygwin/lib/python2.7/site.py", line 563, in <module>
main()
File "/cygdrive/c/cygwin/lib/python2.7/site.py", line 545, in main
known_paths = addusersitepackages(known_paths)
File "/cygdrive/c/cygwin/lib/python2.7/site.py", line 278, in addusersitepackages
user_site = getusersitepackages()
File "/cygdrive/c/cygwin/lib/python2.7/site.py", line 253, in getusersitepackages
user_base = getuserbase() # this will also set USER_BASE
File "/cygdrive/c/cygwin/lib/python2.7/site.py", line 243, in getuserbase
USER_BASE = get_config_var('userbase')
File "/cygdrive/c/cygwin/lib/python2.7/sysconfig.py", line 521, in get_config_var
return get_config_vars().get(name)
File "/cygdrive/c/cygwin/lib/python2.7/sysconfig.py", line 420, in get_config_vars
_init_posix(_CONFIG_VARS)
File "/cygdrive/c/cygwin/lib/python2.7/sysconfig.py", line 299, in _init_posix
raise IOError(msg)
IOError: invalid Python installation: unable to open /cygdrive/c/cygwin/include/python2.7/pyconfig.h (No such file or directory)
I tried installing Python after that, version 2.7.5 into the folder C:\Python27, but still got the same error. Do I need to reinstall NEURON after having installed Python? Why will it work in the rxvt shell but not the Cygwin shell? Ideally, I want to run a NEURON program using a system call from MATLAB, but right now that generates the same error as starting nrniv from the Cygwin shell.

Here's the other info from NEURON:
oc>nrnversion(1)
NEURON -- Release 7.3 (849:5be3d097b917) 2013-04-11
oc>nrnversion(2)
Release 7.3 (849:5be3d097b917)
oc>nrnversion(3)
5be3d097b917
oc>nrnversion(4)
2013-04-11
oc>nrnversion(5)
849
oc>nrnversion(6)
'--prefix=/home/hines/neuron/nrnrelsetup' '--with-nrnpython' '--srcdir=/home/hines/neuron/nrn' '--with-paranrn'
oc>nrnversion(7)
nrniv
oc>nrnversion(8)
i686-pc-cygwin
Thanks,
Marianne

hines
Site Admin
Posts: 1436
Joined: Wed May 18, 2005 2:32 pm

Re: Running NEURON from Cygwin

Post by hines » Thu Jul 11, 2013 7:30 am

It is a puzzle to me why pyconfig.h is sometimes missing from the python installation.
On my machine pyconfig.h is located in /cygdrive/c/cygwin/usr/include/python2.7 . Assuming it is there also on your machine, I have no idea why
sysconfig.py is looking for it in /cygdrive/c/cygwin/include/python2.7
Anyway, there are at least two ways to avoid the problem.
nrniv -Py_NoSiteFlag ....
and copy the entire /cygdrive/c/cygwin/usr/include/python2.7 to ./cygdrive/c/cygwin/include

Note that when I run nrniv directly from a cygwin shell i need an explicit NEURONHOME environement variable. e.g.
export NEURONHOME=/cygdrive/c/nrn73

neuromau
Posts: 94
Joined: Mon Apr 20, 2009 6:02 pm

Re: Running NEURON from Cygwin

Post by neuromau » Thu Jul 11, 2013 12:02 pm

Thanks, I will give those a try!

neuromau
Posts: 94
Joined: Mon Apr 20, 2009 6:02 pm

Re: Running NEURON from Cygwin

Post by neuromau » Thu Jul 11, 2013 12:45 pm

Also, not sure if this is related, but if I try to run

Code: Select all

mknrndll
from the Cygwin terminal, even after exporting NEURONHOME, I get:
sh: /lib/mknrndl2.sh: No such file or directory

But it works if I run that command from the rxvt shell.

Post Reply