Cognitive Neuroscience of Language Laboratory (MagLab)
Department of Psychology, University of Connecticut

Methods Report 2008.02
Original version, 10 June 2008

Installing lens in Mac OS X
Jim Magnuson


2012.05.09: Note that this report is obsolete. The resources below do not exist any longer.

The good news, though, is there is a .dmg port!! Get LENSOSX!


That said, if you are trying to install on linux, see for some important notes, most notably:

  • in Src/command.c, replace all occurrences of CLK_TCK with CLOCKS_PER_SEC
  • You can try sudo apt-get install -y tk8.3 tk8.3-dev and sudo apt-get install -y tcl8.3 tcl8.3-dev
  • Or you may be able to force the old tcl and tk libraries to work just by copying them from the Bin/x86 folder to /usr/lib. Probably not a good idea.

Okay, back to the sadly deprecated methods report…

lens, Doug Rohde’s “light, efficient, neural simulator,” provides a tcl/tk GUI and scripting environment on top of very fast C code. As of spring, 2008, even though Doug Rohde no longer supports the software and has apparently left academia, more and more labs appear to be using the lens simulator. This is because lens is fast, easy to use, and has many great features (especially the GUI). Various labs are initiating efforts to extend lens (e.g., to parallel/grid environments). It’s pretty easy to install under windows (with cygwin installed), and very easy in linux, but pretty tough on your own under Macintosh OS X. Luckily, it appears the kind people in the Language Imaging Lab at the Medical College of Wisconsin have smoothed the way by creating a ‘port’ of lens (lensnns) for MacPorts. The following instructions work for us for installing lens in OS X (and are nearly identical to steps sent to me by Jarrod Lewis-Peacock of the University of Wisconsin).

1. Make sure you have the version of XCode developer tools for your version of OS X. 
2. Download and install macports
3. Add the following lines to your ~/.bashrc or ~/.bash_profile
        export PATH=/opt/local/bin:/opt/local/sbin:$PATH 
        export LENSDIR=/opt/local/share/lensnns
4. Download and run the “update_mri_ports” script as described here (also from the kind folks of WI!)
5. Install lens with ports using:
        sudo nice port install lensnns

Doug, wherever you are: many, many thanks.

lens rocks.