Brian

From oldwiki.scinet.utoronto.ca
Jump to navigation Jump to search

WARNING: The last edit of this page is over two years old. The information on this page may be out-of-date.

Brian is a python package. Here are instructions on how to install it locally, in a user's home directory:

<source lang=bash> module purge module load use.experimental gcc/4.4.0 intel/intel-v12.0.0.084 python/2.7.1 mkdir -p $HOME/lib/python2.7/site-packages

export PYTHONPATH=${PYTHONPATH}:${HOME}/lib/python2.7/site-packages/

easy_install --prefix=${HOME} -O1 SymPy

easy_install --prefix=${HOME} -O1 Brian </source>

After these steps, add the local module "brian" to your own modules directory. This is done by first executing the command:

<source lang=bash> module load use.own </source>

which creates the directory $HOME/privatemodules . In that directory we will create a file named "localpython", which will be used for all user-installed python packages. Here are the contents of $HOME/privatemodules/localpython:

<source lang=tcl>

  1. %Module -*- tcl -*-

proc ModulesHelp { } {

 puts stderr "\tThis module adds local python 2.7.1 path environment variable" 

}

module-whatis "adds local python 2.7.1 path environment variable"

set basedir $::env(HOME)/lib/python2.7 append-path PYTHONPATH ${basedir}/site-packages/ </source>


Then change to that directory, and do

<source lang=bash> cd $HOME/privatemodules mkdir brian cd brian </source>

In this directory create a file, with the name "1.3.0" (this is the version of Brian we are installing), with the contents:

<source lang=tcl>

  1. %Module -*- tcl -*-
  1. Brian

proc ModulesHelp { } {

 puts stderr "\tThis module adds Brian 1.3.0 environment variables" 

}

module-whatis "adds Brian 1.3.0 environment variables"

  1. python was compiled with gcc, but needs intel for the MKL.
  2. it requires python 2.7.1

prereq use.experimental prereq gcc prereq intel/intel-v12.0.0.084 prereq python/2.7.1

module load localpython

set basedir $::env(HOME)/lib/python2.7 append-path PYTHONPATH ${basedir}/site-packages/sympy-0.6.7-py2.7.egg/:${basedir}/site-packages/brian-1.3.0-py2.7.egg/ </source>

After you save the file, if you do

<source lang=bash> module load use.own module avail </source>

you will see the module brian/1.3.0 listed. You can now load it, together with its prerequisites, and you should be ready to run brian simulations. You can load these modules inside a batch script, as follows:

<source lang=bash> module purge module load gcc module load intel/intel-v12.0.0.084 module load use.experimental module load python/2.7.1 module load use.own module load brian/1.3.0 </source>

This will take care of all your necessary environment variables, as well as making sure the proper versions of the required packages are loaded.