<< Main Manual 

Useful Environment Variables to Set

    List of Useful Environment Variables

It may be useful to set several environment variables to ease the use of NeuronetExperimenter (see the list below). The manner in which you set an environment variable is platform-dependent (more specifically, shell-dependent). Typically, you can type env at the command-line to see what environment variables have been set and what values they are set to. For example,

> env

TERM_PROGRAM=iTerm.app
TERM=vt100
SHELL=/bin/bash
OLDPWD=/Users/john
SVN_EDITOR=/usr/bin/vi
USER=john
NNE_MODEL_PATH=/Users/john/NeuronetExperimenter_models
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin
PWD=/Users/john/wd/NeuronetExperimenter
AUTO_DIR=/Users/john/src/auto2/auto/07p
HOME=/Users/john
LOGNAME=john
CVS_RSH=ssh
DISPLAY=:0.0
DEBUG=-g
_=/usr/bin/env


How you set the variables depends on your shell program
(i.e., the program that interprets your terminal's commands). You can often see what shell program you are using by finding the SHELL value in the environment variables list. In the example above, you can see that I am using bash. This is a shell popular on OS X and Linux. A useful reference for setting environment variables on other shells is found here:

However, in summary, bash-users can usually set the environment variables by editing the .bashrc or .bash_profile (note the periods) file in their home directory (i.e., your ~ directory). Then, for new variables that are not already defined in the file you can append a line like:

~/.bash_profile:
...
export NAME=VALUE

...

where NAME, was the environment variable, and VALUE is the environment variable's value.

For variables that have already been defined (particularly PATH), you should simply add a colon separator and the new value. For example,

~/.bash_profile:
...
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/Users/john/scripts/:VALUE

...

To make the changes to the file take effect you will need to restart your terminal. Make sure to type 
env to verify your changes.

List of Useful Environment Variables

Below are the environment variables of particular interest to NeuronetExperimenter users:

CXX
MPICXX
NNE_BIN_PATH
NNE_MODEL_PATH
PATH
PYTHONPATH

CXX

The CXX variable is used by the buildModelCode.py script that comes with NeuronetExperimenter. This is only used if the MPICXX environment variable is not defined or the mpicxx executable is not found in the PATH. Setting this environment variable changes the C++ compiler used by 'make' and 'make install' and turns off MPI functionality. This environment variable will also change what compiler is used to test the default optimization flags that are compatible with your compiler (see MPICXX for further detail). If buildModelCode.py does not find this variable, MPICXX, or a mpicxx executable, it will finally try to use the g++ alone, which will only work if that is in the PATH.

MPICXX

The MPICXX variable is used by the buildModelCode.py script that comes with NeuronetExperimenter. Setting this environment variable changes the C++
 compiler used by 'make' and 'make install'. Usually this is a MPI wrapper of the C++ compiler called mpicxx.This environment variable will also change what compiler is used to test the default optimization flags that are compatible with your compiler. The script tests the default optimization flags and excludes any flags that are not recognized by your compiler, so that they are not used in your generated Makefile. So, if you get something like this:

...
cc1plus: error: unrecognized command line option "-falign-loops-max-skip=15"
...

after typing 'make', that problably means that there is some inconsistency between the test and the compiler the Makefile actually uses. This will most likely occur if you try a compiler other than GCC. If that is the case, you will probably manually need to change the optimization flags in the generated Makefile for now.

NNE_BIN_PATH

The NNE_BIN_PATH variable is used by the buildModelCode.py script that comes with NeuronetExperimenter. Setting this environment variable changes where the NeuronetExperimenter binary and nne_* utility scripts are placed when you 'make install'.

IMPORTANT: When you change this variable you will also want to change your PATH and PYTHONPATH environment variables to
include this directory.

A convenient way to change all three variables is to set in your shell profile file (i.e., .bash_profile or .bashrc) the other environment variables to the value of the NNE_BIN_PATH variable. That way you can just change your NNE_BIN_PATH variable and the other changes will be correctly set as well when you open a new terminal. For example,

~/.bash_profile:
...
export NNE_BIN_PATH=/Users/john/NNE
export PYTHONPATH=$NNE_BIN_PATH
PATH=
/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:$NNE_BIN_PATH
...

NNE_MODEL_PATH

The NNE_MODEL_PATH variable is used by the buildModelCode.py script that comes with NeuronetExperimenter. Setting this environment variable changes the search path for .oden files from the models/ sub-directory of NeuronetExperimenter to any directory on your system. This is particularly useful if you want to maintain a separate repository of models that is independent of the installed version of NeuronetExperimenter, or you want to have multiple repositories that you can use from the code by simply changing this environment variable.

PATH

The PATH variable is used by your shell program to find programs and scripts. This allows you to simply type, NeuronetExperimenter to start the binary program without prepending a directory path to the name. By default, NeuronetExperimenter is installed into the /usr/bin directory, which is usually included by default in all shells. However, if you install your program and scripts into a different directory you should probably set your PATH variable to the directory that contains the NeuronetExperimenter binary and nne_ utility scripts (unless you enjoy typing absolute paths into the command-line). After performing a 'make install', if you get something like the following:

> nne_networkStats

-bash: nne_networkStats: No such file or directory


that means your PATH variable is almost certainly not correct, and you should set this variable to the same location as your NNE_BIN_PATH variable.

PYTHONPATH

The PYTHONPATH variable is used by the Python interpreter to determine where Python code is located to execute the code. If you install NeuronetExperimenter into the default location you should not need to set this variable. However, if you installed NeuronetExperimenter in a different place (as described in the Advanced Installation Guide) and try to run any of the nne_* utility scripts and get an error that looks like this:

> nne_networkStats

Traceback (most recent call last):
  File "/usr/bin/nne_networkStats", line 25, in <module>
    from nne.Network import *
ImportError: No module named nne.Network


that means you need to set this variable to the same location as your NNE_BIN_PATH variable.

<< Main Manual