PSCF v1.1
Environment Variables

Installation Overview (Prev)         Setup Script (Next)

To compile PSCF in a unix environment, before compiling any code, the user should modify the following unix environment variables:

  • Add the pscfpp/bin directory to the unix PATH shell environment variable (the shell command search path)
  • Add the pscfpp/lib/python directory to the PYTHONPATH environment variable (the python module search path)

Rationale:

  • By default, all executables files created by the PSCF build system are installed in the pscfpp/bin directory. The path to this directory must thus be added to the user's PATH variable in order to allow the unix shell to find these executable files when they are invoked by name from the command line.
  • The pscfpp/lib/python directory contains several python modules that are used by the PSCF build to process information about dependencies among C++ files. The path to this directory must be added to the PYTHONPATH variable in order to allow a python interpreter to find these python modules.

The required changes to the user's shell environment should be made in a manner that guarantees that these changes are automatically put in place when a user is logs on. To accomplish this, commands that modify the PATH and PYTHON variables should be added to a configuration file in the users home directory that is read and executed whenever the user launches a login shell (e.g., to the .profile or .bash_profile file on systems that use a bash shell or the .zprofile file on systems that use a zsh unix shell, as discussed in more detail below).

An example of the required commands is shown below:

PSCFPP_DIR=${HOME}/pscfpp
export PATH=${PATH}:/${PSCFPP_DIR}/bin
export PYTHONPATH=${PYTHONPATH}:/${PSCFPP_DIR}/lib/python
Python package of all python modules provided with PSCF.
Definition: __init__.py:1

The value of the shell variable PSCFPP_DIR that appears in this example should be set to the absolute path to the pscfpp root directory (i.e., the root of the directory tree created by cloning the pscfpp git repository). In the above example, it is assumed that this is a subdirectory named pscfpp within the users home directory, where ${HOME} is an environment variable that expands to the path to the users home directory.

The name of the file to which these commands should be added depends on which unix shell is being used. Different unix shells are used by default in different linux and Mac OS X operatings systems.

The bash shell is the default shell on most linux systems. The bash shell reads files named .profile and/or .bash_profile in the users home directory, if either exists, when the user opens a login shell by logging in to the system. Users who are using a bash shell should put these commands in one of these files.

Recent versions of the Mac OS operating system instead use zsh (also known as the Z shell) by default within the Mac Terminal app. We recommend that mac users who are using zsh from within the Terminal app place these commands in a file named .zprofile. The Terminal app treats every terminal window as new login shell, and executes the .zprofile file every time you open a new terminal window.


Installation Overview (Prev)         Installation (Up)         Setup Script (Next)