Compiling NEURON under Windows

NB: This page is out of date.

The instructions here may or may not still work. The distributed version is now compiled on MSYS2; cygwin is no longer needed. If you need Windows compilation instructions, please contact us and encourage us to update this page.

The overall strategy

Under Windows, almost all differences from one version of NEURON to the next are expressed in binary code (machine language instructions) that is contained in two dll files called cygIVhines-3.dll and cygnrniv.dll. Installing NEURON places these files in the c:\nrn\bin directory.


Compiling generates new cygIVhines-3.dll and cygnrniv.dll files that you can just copy into the c:\nrn\bin directory. This saves time and effort, since you can add custom features without having to go through the whole cycle of uninstalling NEURON, creating your own installation package, and reinstalling.

So before you compile NEURON under Windows, we recommend getting a precompiled installer--either for the current standard distribution, or the most recent alpha version, depending on your needs--and using it to install NEURON on your PC. This takes care of important registry settings, and sets up all of the files and directory structures that your custom compiled version of NEURON will need. At that point, all that remains is to create the custom cygIVhines-3.dll and cygnrniv.dll, and copy them into c:\nrnnn\bin


The following instructions assume that you have already installed and configured Cygwin and, for the reasons described above, installed either the standard distribution or a recent alpha version of NEURON. The details of how to proceed differ slightly, depending on whether you got development code from the mercurial repository, or downloaded the gzipped tar files for an alpha version or the standard distribution.

If you got development code from the mercurial repository

Jump to step 2 below.

If you downloaded gzipped tar files

1. Create a neuron directory in your Cygwin home directory, put the gzipped source files in it, and expand them.

Start by opening an rxvt window, then

cd $HOME
mkdir neuron
mv iv-mm.tar.gz neuron
mv nrn-nn.tar.gz neuron
cd neuron
tar xzf iv-mm.tar.gz
tar xzf nrn-nn.tar.gz
# renaming the new directories iv and nrn makes life simpler later on
mv iv-mm iv
mv nrn-nn nrn

Hint: if you used a WWW browser to download the gzipped tar files, they're probably sitting on your MSWin desktop. In this case, you might find it easier to open the MSWin file manager ("Windows Explorer"), and use it to navigate to c:\cygwin\home\yourname
Then you can create the neuron subdirectory, and finally just drag and drop iv-mm.tar.gz and nrn-nn.tar.gz into it.


2. configure, make, and install InterViews

In the rxvt window,

cd iv
./configure --prefix=`pwd`
make install

3. configure and make NEURON

cd ..
cd nrn
./configure --prefix=`pwd`
# unlike the UNIX installation, we DO NOT do make install

./ generates a warning message
As long as ./ produces a configure file, it is safe to ignore warnings.
configure or make fails with a message that contains
"fork: Resource temporarily unavailable"
Uninstall any third-party firewall software (e.g. ZoneAlarm). If your PC is not behind a hardware firewall, be sure to disconnect it from the network first. Then try configure or make again.

If the problem persists, uninstall any antivirus software, and try again.

If the problem still persists, follow the recommendations at
On my Win2K machine, the SharedSection setting had four parameters whose values were initially 1024,3072,512,512. I increased them to 2048,6144,1024,1024

Comments: There's a lot of noise on the WWW about "fork failures" with Cygwin. It appears to be necessary to actually uninstall the firewall and/or antivirus software, not merely "exit" or "inactivate" it. If you run into this problem, please be sure to let us know how you solved it, and what firewall, antivirus, and version and patch level of MSWin you are using.

./configure --prefix=`pwd` --with-paranrn
fails with the message
configure: error: Cannot compile MPI program
1. Have the environment variables (flags) specified in mswinmpiconf been set?
<< detail these or link to the place where they are described >>
2. Was MPICH2 installed in the proper location? Default installation directory is C:\Program Files\MPICH2, but for our purposes it should be installed to c:\mpich2



4. Copy the custom dlls to c:\nrnnn\bin

But first you might like to put the "old" ones in a safe place, in case you would ever want to use them again without having to reinstall NEURON.

Using the MSWin file manager ("Windows Explorer"), create a subdirectory in c:\nrnnn\bin
and call it "old". Then drag cygIVhines-3.dll and cygnrniv.dll from c:\nrnnn\bin to c:\nrnnn\bin\old .

Finally, in the rxvt window


cp src/mswin/cygnrniv.dll /cygdrive/c/nrnnn/bin
cd ../iv
cp i686/bin/cygIVhines-3.dll /cygdrive/c/nrnnn/bin