Skip to content

Latest commit

 

History

History
110 lines (80 loc) · 5.66 KB

Installation_instructions.md

File metadata and controls

110 lines (80 loc) · 5.66 KB

##Installation Instructions

Instructions for Ubuntu-Linux are coming, this file should be updated in May 2016 a month after the release of Ubuntu Ubuntu 16.04 LTS Xenial Xerus April 2016. Note the Ubuntu instructions should be very similar to the OSX instructions, except that apt-get is used in place of macports.

##Instructions for OSX.

This project has some strong dependencies on the NEURON module for Python, and also open-mpi, not to mention the mpi4py module for NEURON.

In order to run any code pertaining to this model, as a minimum you will need to compile NEURON-7.4 with Python and mpi support. I found the following guides helpful, but not completely sufficient for managing this compilation process. You may wish to look at them for inspiration if you are faced with obstacles when compiling these programs. The instructions at Installing NEURON, MPI, and Python on OS X Lion

It is important to note that the version of Python that is built into OSX is not very suitable for scientific programming, and that it is appropriate to install an additional Python binary using macports.

##Compiling NEURON-7.4 from src with MPI and Python on OSX

This is not a comprehensive guide, but its an informed example based on my own experience. If you have recently upgraded to OSX El Capitan, like me you may need to upgrade macports as well as Xtools and Xcode. Below are some of the important package installs and package upgrades I needed to make. I recommend using macports to install packages, as opposed to manually installing packages, [http://www.neuron.yale.edu/neuron/download/compilestd_osx ](as these instructions insinuate).

Update macports if you have upgraded operating system to el capitan. Use macports Select

$xcode-select --install
$sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
$sudo port install autoconf automake libtool perl5 +perl5_12 m4

This time I needed to reinstall gfortran in order to install openmpi, as the standard gfortran compiler was not able to pass some standard tests. I had to reinstall https://gcc.gnu.org/wiki/GFortranBinaries#MacOS as the log generated by ./configure told my that my current gfortran program/configuration was not passing basic tests.

$sudo pip –upgrade mpi4py

I made a simple BASH script to compile the program nrniv as follows. I called install_neuron.sh

sudo rm -r /Applications/NEURON-7.4

mkdir /Applications/NEURON-7.4

cd $HOME

mkdir nrn
cd non

#creating directories
sudo mkdir /Applications/NEURON-7.4
sudo mkdir /Applications/NEURON-7.4/iv
sudo mkdir /Applications/NEURON-7.4/nrn

hg clone http://www.neuron.yale.edu/hg/neuron/nrn
cd $HOME/non
sh build.sh
./configure –prefix=/Applications/NEURON-7.4/nrn –with-paranrn –with-nrnpython=/opt/local/bin/python –host=x86_64-apple-darwin15.2.0 –build=x86_64-apple-darwin15.2.0 –without-iv

make
sudo make install
sudo make install after_install

#You should now have a working NEURON application under Applications. Small test;
sudo /Applications/NEURON-7.4/nrn/x86_64/bin/neurondemo

#Final step is to install neuron as a python module
cd src/nrnpython
sudo python setup.py install

Note, in the install script above I found the right python path argument to assign nrnpython, by executing $which python. However the result of running sudo python setup.py install, is that the neuron module for python still gets installed in an appropriate egg directory to remedy this, I changed directory to the real site of functioning python modules

$cd /Library/Python/2.7/site-packages

and then I created some symbolic links back to this directory.

sudo ln -s /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/NEURON-7.4-py2.7.egg-info .

sudo ln -s /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/neuron/ .

Now the file nrnenv suggested in the install instructions needs to be modified to be consistent with the paths given in the ./configure command above. This involves dropping the -7.4 suffix from the line: ‘export N=/Applications/NEURON-7.4/nrn’

contents of nrnenv file:

#!/bin/bash/
export IDIR=/Users/kappa
export N=/Applications/NEURON-7.4/nrn
export CPU=x86_64
export PATH=$N/$CPU/bin:$PATH

##After NEURON+Python+MPI is built:

##More Python packages required that are required beyond the operation of NEURON+Python+MPI Install Quartz X11 for OSX Use macports/apt-get to install python27 in addition to the version of Python that ships with OSX.

sudo pip install allensdk glob2 unittest

Once NEURON+Python+MPI has been successfuly built, the next step is to build the NMODL code. The NMODL code is comprised by files with the extension .mod.

Currently the main directory contains the *.mod files (TODO move these to a seperate directory). Navigating to the root 3Drodent dir and executing $nrnivmodl is sufficient to build the nmodl code before running the model.

##Running the model To facilitate easy running of the model (in Ubuntu only) I have created the BASH alias:

alias rspp='cd /git/3Drodentm; mpiexec -np 4 xterm -e "ipython -i use_local_files.py"'

Adding the alias to my ~/.bashrc file means that I can launch the model simply by executing $rspp at the command line. However note that this depends on the program xterm being available. In Ubuntu xterm can readily by installed using apt-get however in OSX xterm depends on XQuartz the X11 server which will need to be installed. Instructions for installing XQuartz