<< 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_SOURCE_PATH=/Users/john/wd_uf/nne
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_SOURCE_PATH
PATH
PYTHONPATH

CXX

The CXX variable is used by the nne_buildOdenModels script that comes with nne. 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 nne_buildOdenModels script that comes with nne. 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 probably 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_SOURCE_PATH


The NNE_SOURCE_PATH variable is used by the nne_buildOdenModels script that comes with nne. This is required to point to the top-leve nne source directory so that the scripts can find some critical header and source files.

PATH

The PATH variable is used by your shell program to find programs and scripts. This allows you to simply type, nne_run to start the binary program without prepending a directory path to the name. By default, nne_run 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 nne_run 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 nne into the default location you should not need to set this variable. However, if you installed nne 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


<< Main Manual