Set Environment for Unix / Mac OS X

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)

Make the following changes to your appropriate shell login script:

Make Changes in Bash Shell

  1. 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.
  2. Modify and export PATH, PYTHONPATH, and (if using a Dakota release prior to 6.6) (DY)LD_LIBRARY_PATH variables. Type the following line, replacing $INSTALL_DIR with the absolute path to your installation directory, e.g. /home/username. 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:

    export PATH=$INSTALL_DIR/bin:$INSTALL_DIR/test:$INSTALL_DIR/gui:$PATH
    
    # To use the dakota.interfacing Python module
    export PYTHONPATH=$PYTHONPATH:$INSTALL_DIR/share/dakota/Python
    
    # If Dakota version < 6.6
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$INSTALL_DIR/lib:$INSTALL_DIR/bin

    On OS X:

    # Mac OS X:
    export PATH=$INSTALL_DIR/bin:$INSTALL_DIR/test:$INSTALL_DIR/gui/DakotaUI.app/Contents/MacOS:$PATH
    
    # To use the dakota.interfacing Python module
    export PYTHONPATH=$PYTHONPATH:$INSTALL_DIR/share/dakota/Python
    
    # If Dakota version < 6.6:
    export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$INSTALL_DIR/lib:$INSTALL_DIR/bin
  3. Save and close file.
  4. Update changes in your shell window.
    $ source ~/.bashrc # Or other startup file on OS X
    

Make Changes in C shell

  1. Edit the startup file ~/.cshrc in your favorite text editor.
  2. Modify and export PATH, PYTHONPATH, and (if using a Dakota release prior to 6.6) (DY)LD_LIBRARY_PATH variables. Type the following line, replacing $INSTALL_DIR with the absolute path to your installation directory, e.g. /home/username. 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:

    setenv path=($INSTALL_DIR/bin $INSTALL_DIR/test $INSTALL_DIR/gui $path)
    
    # To use the dakota.interfacing Python module
    setenv PYTHONPATH "${PYTHONPATH}:${INSTALL_DIR}/share/dakota/Python"
    
    # If Dakota version < 6.6:
    setenv LD_LIBRARY_PATH "${LD_LIBRARY_PATH}:${INSTALL_DIR}/lib:${INSTALL_DIR}/bin"

    On OS X:

    setenv path=($INSTALL_DIR/bin $INSTALL_DIR/test $INSTALL_DIR/gui/DakotaUI.app/Contents/MacOS $path)
    
    # To use the dakota.interfacing Python module
    setenv PYTHONPATH "${PYTHONPATH}:${INSTALL_DIR}/share/dakota/Python"
    
    # If Dakota version < 6.6:
    setenv DYLD_LIBRARY_PATH "${DYLD_LIBRARY_PATH}:${INSTALL_DIR}/lib:${INSTALL_DIR}/bin"
  3. Save and close file.
  4. Update changes in your shell window.
    $ source ~/.cshrc