Vision Research Center


News from the VRC

VRC Administration

VRC Facilities

Related Penn Sites


Vision Science Seminar




Developed by Robert Smith - download

Neuronc ("nc") is a general-purpose computer language that
has special features for simulating large neural circuits
using compartments. It allows creating large arrays and
uses an iterative difference equation solver so that virtually
any network geometry may be specified (e.g. geometry is not
limited to "tree" structure, and may include loops).
Since "nc" is primarily a language it does not contain a
complete interactive pull-down menu system for describing and
running a simulation. However, there is a graphics facility
for displaying on standard devices such as X11, PostScript,
and VGA. If you have access to a mainframe computer but your
mainframe terminal lacks graphics capability, you can run "nc"
in a non-graphics mode and download ASCII (text) files that
contain all the "nc" output graphics and data. These files may
then be displayed locally on a PC.

The capabilities of the "nc" language are described in:

Smith, R.G. (1992) NeuronC: a computational language for
investigating functional architecture of neural circuits.
J. Neurosci. Meth. 43: 83-108.

An exerpt from this paper "ncmeth.txt" is provided in the
"nc" distribution for your personal use.

To download your copy of "nc" you may "ftp" to
the following address:

Login as "anonymous", using the login also as
the password. The "nc" distribution is in the file
"nc.tgz" located in the "pub" subdirectory.
This file is encoded by "gzip" which is a compression
program similar to "compress". If your computer
system does not have "gzip", you can find the source
in the same directory.



Oct, 1998

New additions to NeuronC:

- Local dynamically allocated arrays.

- Stim file can be compressed with gzip.

- DOS version of nc, stim, plotmod.

- NMDA synapses, with voltage sensitivity.

- AMPA synapses with desensitization.

- voltage-gated gap junctions with optional rectification.

- Independent noise generators for individual photoreceptors and synapses.

- drag'n drop NeuronC files and commands with 'xfm' and 'tkdesk'

- new Na, K AMPA channel types.


Operating System and Hardware Environment

NeuronC has been transported to a wide variety of
operating system environments. The most successful of
these are the high-end workstations where enough memory
and CPU power are available to allow "nc" to simulate
1000-neuron circuits with "reasonable" runtimes (i.e. hours,
not days). The "nc" program running on larger mainframe
systems often runs 10 to 100 times slower than the native
speed (because of time-sharing) so there may be little
advantage in using a mainframe except its large amount of
memory. Obviously, "nc" uses lots of floating-point math
so it requires the use of math-coprocessors where available.

"nc" has been successfully transported to:

Hardware OS RAM display comment

Intel Pentium/233 Linux 64 MB VGA,X11 Currently used to develop "nc".
Intel PentiumII/450 Linux 256 MB X11R6 Very fast. Good value.
Intel 80486/133 Linux 32 MB VGA,X11 Originally used to develop "nc".
Intel 803/4/5/686 DOS 32 MB X11R6 Very fast, though limited graphics.
Sun4 4.1 8 MB X11R4 Fast. 20,000 compartments.
Cray X-MP Unicos lots text Very fast, but timeshared.
Convex 240 Unix 500 MB text Extremely fast, big, but timeshared.
SGI Challenge IRIX 384 MB X11R4 Extremely fast, big, but timeshared.
DEC Alpha Linux 512 MB X11R6 Extremely fast. Good value.


UNIX systems on a PC

For 386 and 486 machines, I highly recommend the "Linux"
operating system, a UNIX look-alike system that includes X11 R6,
available by anonymous FTP from:

Documentation on Linux is available from:

Linux and a Pentium/P6/333 MHz machine with 64MB RAM is an excellent
choice for running "nc". However 128-256 MB RAM will give additional
speed for large networks.


DOS systems

NeuronC has been compiled under DOS with the "Delorie" GNU
development environment. This is available free from and has "gcc", "make", and lots
of other shell and file utilities to make a Unix-type

Although the DOS version of "nc" produces the same output
as the Unix version, I have found the DOS environment too
restrictive for my simulation and development needs. However,
graphs generated by "nc" on a mainframe that is lacking a local
graphics output can be displayed locally. Text files downloaded
onto a DOS machine can be displayed very effectively using a DOS
version of "vid" and "plotmod".


Compiling the nc distribution

1) Uncompress and "un-tar" the distribution.
This will make a directory called "nc" and several

for "gnu tar" that can decompress:

tar xvozf nc.tgz

for standard Unix tar:

gzip -d nc.tgz
tar xvof nc.tar

2) Go to the "nc" directory and type:


3) Go to the "pl" directory and install the video
driver for "nc":

cd pl
ln vid ~/bin

4) Go to the "nc/src" subdirectory and install "stim","nc",
and "plotmod":

cd ../src
ln nc stim plotmod ~/bin

After these operations, the binaries of "vid",
"stim", "nc" and "plotmod" will reside in the
user's "bin" subdirectory. If you don't have a "bin"
subdirectory in your home directory, you can "ln"
the binaries anywhere else you like.


Graphics output for "nc"

The "nc" program can produce graphics using a device-independent
graphics library of subroutines (libP.a). This library produces
an output stream that can be put into a file or sent directly
to the graphics plotting command through a pipe. The
graphics plotting command is called "vid". This command is
compiled separately from "nc" (see above: "Compiling") and
needs some special care to get the drivers you need
correctly compiled and linked in (see "pl/mvid.c").

Drivers available in "vid":

Color PostScript
Hercules monochrome
IBM monochrome
HP Laserjet II
Tektronics 4014

Separate drivers:

HP 7221A plotter ("hpflt")
HP-GL (IBM color plotter) ("ibmflt")


Compiling and linking for X11 on a workstation

The file "pl/mprintx.c" is the X11 driver for "vid",
and this module is used along with whatever other drivers
are linked in (such as EGA, VGA, PS, etc.). The "mprintx.c"
module uses standard "Xlib" calls and these should be
provided on most Unix systems on which the X11 development
system is installed. In order for the X11 module to install
properly, the file "pl/mvid.c" must have the constant TXWIN
defined (this is the way it comes in the standard distribution),
and of course the link list in "pl/makefile" must include
"mprintx.o". (This goes for all the other drivers as well:
define their respective constants in "mvid", and put the
mprint?.o file in the link list.)

To link properly, "vid" compiled with X11 needs the
proper sequence of libraries in the link list inside
"pl/makefile". On many workstations, this is:

cc -o vid vid.o ... -L/usr/X11R6/lib -lX11 -lm

but on some Unix systems (e.g. Venix for 386/486) the link list is:

cc -o vid vid.o ... -lX11 -lpt -lsocket -lnet -lnsl_s -lm

and on ISC 386/ix it is something like:

cc -o vid vid.o ... -lX11 -ltcp -linet -lm

In some cases, you may need to set a different path
for the libraries than the standard default of "/usr/lib":

cc -o vid vid.o ... -L/usr/lib/X11/libs -lX11 ...

The link list that will work on your system may be different
than any of these ones, so you may have to look up the makefile
for a standard Xlib program and copy its link list in order to
get "vid" to compile. If you can't get "vid" to compile with
"mprintx.o", you can eliminate the X11 capability and use
PostScript (see the "nc" manual):

nc file.n | vid -c >

Or make a text output file that can be displayed
on DOS or graphed using standard graphing tools:

nc -t file.n > file.r
(download file.r onto DOS)

The reason for using the "pipe" feature originally was to
insulate the graphics from the program that generated them, as

graph | vid -X
nc | vid -X
nc -t > file.r
plotmod file.r | vid -c

This is very flexible because the "vid" command can plot
graphics from many other programs that use the plot library
(libP.a), such as "graph", "labels", "posit", "nc", etc. However
it is not as convenient when you just want "nc" to display on X
or some other display screen and don't need to make an
intermediate file.


Problems compiling

There are a few problems that occasionally arise when
compling "nc" on a new machine. There are some hardware
dependencies in "nc" code that ideally should be corrected.
Please read the "README.compile" file for suggestions
with problems with machine-dependencies. The known problems

1) Elapsed time. The size of clock ticks is machine dependent.

2) On some machines, "strtod()" does not exist. (Included in nc dist.)

3) Occasionally, there is a problem with "printf".

4) The different drivers included in "vid" can be confusing.

5) Modifications for compiling without the X11 driver.

6) "ranlib" - on some systems, the "ranlib" command gives an error.

7) "src/" - On some systems, the "sighandler_t" type is not defined.


Comments, bugs, and new development

The process of developing "nc" has been an informal one. A
trusted group of collaborators who use "nc" have reported their
needs and any program errors they found. This system is useful
because I can make changes in response to specific requests or
problems, and this is an efficient way to broaden the scope of a
simulator like "nc". For a similar reason, I am always
interested in hearing comments from users of "nc". However, "nc"
has been developed primarily as a tool for use in my laboratory.
Because of my limited time, I can respond only to a limited
number of requests.

I am most interested in the following types of new development:

1) fixing bugs to make "nc" error-free and operable on a
variety of new machines.
2) increasing the speed of "nc" computations.
3) adding new features to "nc" to make it more useful to a
wide audience e.g. curve-fitting, interactive windows, etc.
4) improving the existing simulation features (such as the synaptic and
channel models) to make them more realistic and computationally
5) improving the manual.

I will try to respond to valid requests for help from serious
colleagues who have a specific question about "nc", its syntax or
use. If you discover an error or would like to request some type
of addition to "nc" and its supporting utilities, please let me know.

You are encouraged to make modifications to your copy of the
"nc" source code. If you have made a modification that you
believe others would be interested in, I would appreciate a copy
of it. Please test it thoroughly, and send it to me (at the
e-mail address below, or via "ftp") with an explanation, and I
will then consider integrating the modification in whole or in
part into the standard "nc" distribution.

If you would like to help with this type of development and need
to know where to start, I can give you a quick lesson in "nc"
development. I encourage this type of dialog because I believe
this is an excellent way to broaden "nc" and promote the
understanding and use of computer simulation in the Neuroscience

Please let me know of your experiences with "nc"!

Robert G. Smith March, 1999

Rm 123, Anat-Chem Bldg.
Univ. of PA.
Phila., PA 19104-6058