Check your PATH Setting
In the instructions below, $INSTALL_DIR refers to the path to the new install directory, /path/to/dakota/install/directory/Dakota.
Make sure Dakota executables (and optionally test files and current directory) are available on the PATH by typing 'which dakota' at command line prompt. If your PATH variable is set correctly, the path to the dakota binary should be displayed.
$ which dakota
/path/to/dakota/install/directory/bin/dakota
If your PATH variable is NOT set correctly, you will get a message like the following:
$ which dakota
/usr/bin/which: no dakota in (/usr/local/bin:/usr/local/sbin)
The following setup will make the dakota command and other helper programs available at the terminal. If you prefer you may refer to the dakota executable using its fully-qualified path. Note, however, that some examples will require modification to work properly if dakota and related helper programs are not on your PATH.
To persist the PATH to Dakota across terminals/sessions, make the following changes to the appropriate shell login script. If you prefer to just test in your current terminal, execute the commands directly in a terminal.
Make Changes in Bash Shell
- Edit your Bash startup file in your favorite text editor. For Linux, this is ~/.bashrc. OS X terminal runs a login shell, and so the start up file may be ~/.bashrc, ~/.bash_profile, ~/.bash_login, or ~/.profile. See the manpage for Bash for more information about the differences between login and non-login shells.
- Modify and export PATH, PYTHONPATH, and (if using a Dakota release prior to 6.8) (DY)LD_LIBRARY_PATH variables. Type the following line, replacing $INSTALL_DIR with the absolute path to your installation directory, e.g. $HOME. You need not add the gui path if you are not using the Dakota GUI, or PYTHONPATH if you do not plan to use the dakota.interfacing Python module.
On Linux:
# Dakota 6.8 and newer: export PATH=$INSTALL_DIR/bin:$INSTALL_DIR/share/dakota/test:$INSTALL_DIR/gui:$PATH # Older versions: export PATH=$INSTALL_DIR/bin:$INSTALL_DIR/test:$INSTALL_DIR/gui:$PATH export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$INSTALL_DIR/lib:$INSTALL_DIR/bin # All versions, to use the dakota.interfacing Python module: export PYTHONPATH=$PYTHONPATH:$INSTALL_DIR/share/dakota/Python
On OS X:
# Dakota 6.8 and newer: export PATH=$INSTALL_DIR/bin:$INSTALL_DIR/share/dakota/test:$INSTALL_DIR/gui/Contents/MacOS:$PATH # Older versions: export PATH=$INSTALL_DIR/bin:$INSTALL_DIR/test:$INSTALL_DIR/gui/DakotaUI.app/Contents/MacOS:$PATH export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$INSTALL_DIR/lib:$INSTALL_DIR/bin # All versions, to use the dakota.interfacing Python module: export PYTHONPATH=$PYTHONPATH:$INSTALL_DIR/share/dakota/Python
- Save and close file.
- Update changes in your shell window.
$ source ~/.bashrc # Or other startup file on OS X
Make Changes in C shell
- Edit the startup file ~/.cshrc in your favorite text editor.
- Modify and export PATH, PYTHONPATH, and (if using a Dakota release prior to 6.8) (DY)LD_LIBRARY_PATH variables. Type the following line, replacing $INSTALL_DIR with the absolute path to your installation directory, e.g. $HOME. You need not add the gui path if you are not using the Dakota GUI, or PYTHONPATH if you do not plan to use the dakota.interfacing Python module.
On Linux:
# Dakota 6.8 and newer: set path=($INSTALL_DIR/bin $INSTALL_DIR/share/dakota/test $INSTALL_DIR/gui $path) # Older versions: set path=($INSTALL_DIR/bin $INSTALL_DIR/test $INSTALL_DIR/gui $path) setenv LD_LIBRARY_PATH "${LD_LIBRARY_PATH}:${INSTALL_DIR}/lib:${INSTALL_DIR}/bin" # All versions, to use the dakota.interfacing Python module setenv PYTHONPATH "${PYTHONPATH}:${INSTALL_DIR}/share/dakota/Python"
On OS X:
# Dakota 6.8 and newer: set path=($INSTALL_DIR/bin $INSTALL_DIR/share/dakota/test $INSTALL_DIR/gui/Contents/MacOS $path) # Older versions: set path=($INSTALL_DIR/bin $INSTALL_DIR/test $INSTALL_DIR/gui/DakotaUI.app/Contents/MacOS $path) setenv DYLD_LIBRARY_PATH "${DYLD_LIBRARY_PATH}:${INSTALL_DIR}/lib:${INSTALL_DIR}/bin" # All versions, to use the dakota.interfacing Python module: setenv PYTHONPATH "${PYTHONPATH}:${INSTALL_DIR}/share/dakota/Python"
- Save and close file.
- Update changes in your shell window.
$ source ~/.cshrc