Home‎ > ‎How To's‎ > ‎

Installation

Precompiled binaries

Precompiled binaries are not available.

Building Warp

Warp can be built and installed on Linux and Mac OSX. It is not supported on Windows. Several packages are needed to install and run Warp. Below are instructions on how to install the various packages. This assumes that Python is already installed. Note that depending on where Python is installed, root privilege may be needed to install the packages. On Mac OSX, XCode and it's development package need to be installed, as well as XQuartz. Warp is compatible with Python versions 2 and 3.

If you do not have root privileges, all of the packages can be installed in your home directory by adding the "--user" option when installing, i.e. using the command "python setup.py install --user". For how to do this with Warp, see the comments below. Note that with --user, there is no need to set PYTHONPATH.

On OSX, a recommended method of installation is to use the Python installed under HomeBrew, http://brew.sh. This offers a number of advantages, including not needing sudo, the Python includes pip for easy package installation, and allows easy install of gfortran (as part of the gcc package), openmpi, and git among other things. After installing brew, you will need to do the following (gcc includes gfortran and openmpi is only needed for running in parallel).

brew install python@2
brew install gcc
brew install openmpi

One can also do "brew install python3" as an alternate version of python. Note that the directory "/usr/local/bin" needs to be in your execute path ahead of "/usr/bin" in order to use the correct Python.

Numpy

Numpy is the numerics package for python. On most variants of Linux, this can be installed using the package manager, such as yum. It is pre-installed in the built in version of Python on Mac OSX. It can also be installed using the Python package managers, pip or easy_install. For example,

pip install numpy

Forthon

Forthon provides the glue linking Fortran and python. It must be installed first before Warp can be built. It can be installed using pip:

pip install Forthon

Alternatively, it can be downloaded using git, "git clone https://github.com/dpgrote/Forthon.git". After downloading it, cd into the Forthon directory and run "python setup.py install", using the same Python that will be used with Warp.

Warp

Warp can be downloaded from bitbucket, https://bitbucket.org/berkeleylab/warp/downloads. Download and extract the tar ball from the most recent release (not the "Download repository" link). It is very likely that an update will be necessary. This can be done using git - cd into the warp directory created from the tar ball and run the following command:

git pull

This will connect to the Warp repository and download any updates that were not included in the tar file.

Inside of the warp directory will be pywarp90 which contains the Fortran source and scripts which contains the Python source. The installation is done in the pywarp90 directory.

Serial Warp

The fortran backend of Warp is called pywarp90, which can be compiled for single- or multi-processor support. The compilation requires a fortran compiler - the recommended one is gfortran. The following will build the serial, single processor, version and install Warp into Python's site-packages directory, including the Warp scripts.

make install

Or similarly when using Python3:

make install3

If a modification of the make process is needed, create a file call Makefile.local (or Makefile.local3) and put the modifications there instead of changing Makefile.Forthon. For example, putting this line in Makefile.local will will set it so that Warp is installed in your home directory.

INSTALLOPTIONS = --user

Parallel Warp

When installing the parallel version of Warp in an environment that has the command mpifort available, no extra setup is needed. Use this command with Python2

make pinstall

and this with Python3

make pinstall3

If mpifort is not available, the compiler type and compiler executable need to be specified in a file called Makefile.local.pympi (or Makefile.local3.pympi for Python3). For example, add these lines:

FCOMP = -F gfortran
FCOMPEXEC = --fcompexec ftn

Also create a file setup.local.py to add the include and library paths for the Fortran libraries. (This is needed since the final linking will be done by a C compiler which may not know which mpi libraries are needed for Fortran.) For example:

if parallel:
    library_dirs += ['/usr/lib64/mpi/gcc/openmpi/lib64/']
    libraries += ['mpi','mpi_f77']

After this you can compile and install the parallel version by using "make pinstall" or "make pinstall3".

Parallel Warp needs the mpi4py package, which can be installed using pip.

Updating an existing warp installation

Any updates to Warp can be downloaded using git. The following will update both the serial and the parallel versions (starting in the top directory of warp):

git pull
cd pywarp90
make install
make pinstall

pygist

pygist is the plotting package that Warp uses. It can be obtained from https://bitbucket.org/dpgrote/pygistNote that there are other versions of pygist available but they will likely not work with Warp since some special coding is needed.

For installation, the X11 header files need to be installed, for example by installing the X11 devel package under Linux.
This will install the python interface as well as the cgm file viewer, gist:

cd pygist
python setup.py config
python setup.py install

Opyndx (optional)

Opyndx is an optional package that provides 3-D visualization tools for Warp. It requires that the OpenDX libraries be installed. Opyndx can be obtained from git.

git clone http://portal.nersc.gov/project/warp/git/Opyndx.git

It is built with the usual installation method for Python packages. Note that the setup.py file may need to be edited in order to specify the location of the OpenDX installation.

python setup.py install

Posinst (optional)

Posinst provides routines for handling secondary emission of electrons from impact on surfaces, developed for electron-cloud physics. The source can be obtained by special request. There are several ways to build posinst. For Warp related usage, the following will compile the code and install it into the usual location for python modules.

make installpy

SciPy (optional)

SciPy is a full fledged scientific numeric package, which contains many useful tools. For Warp, it is only need for optional beam matching scripts.  It can be installed using the pip python manager:

pip install scipy

Testing Warp

After Warp is installed, there are test scripts that can be used to verify that it is functioning properly. Go into the directory warp/warp_tests and run the following command:

python runalltests.py

This will run the tests - it's output will be a list of each test as it runs, hopefully saying "OK". If there are any problems, there will be output showing the test that failed and the error. It shouldn't take more than a minute or so to run the tests.

Comments