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).
One can also do "brew install python3" as an alternate version of python.
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,
Forthon provides the glue linking Fortran and python. It must be installed first before Warp can be built. It can be installed using pip:
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 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:
This will connect to the Warp repository and download any updates that were not included in the tar file.
gfortran. The following will build the serial, single processor, version and install Warp into Python's site-packages directory, including the Warp scripts.
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.
Or similarly when using Python3:
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.
If you want to install the parallel version of Warp that uses MPI to support multiple CPUs you need to tell Warp where to find the necessary libraries (and have those installed), or specify an MPI aware compiler. The information should be put into a file called Makefile.local.pympi. To specify the libraries, set FARGS to point to the installation of MPI, for example:
and also create a file setup.local.py to add the include and library paths, by changing library_dirs. For example:
Alternatively, to specify an MPI aware compiler, set FCOMP in Makefile.local.pympi. For example:
After this you can compile and install the parallel version by using
This will build and install the warpCparallel.so file (as well as the scripts).
You will also need a python interface to MPI. Warp has traditionally been used with pyMPI, but will also work with mpi4py. (Warp with python3 only works with mpi4py.) pyMPI can be obtained from git at NERSC. (The sourceforge version will not work with Warp.)
To build, run the following commands, modifying the installation path as appropriate.
Both version of Warp can be installed on the same system at the same time from the same directory. The two directories build and buildparallel are created for the temporary compiler intermediate files.
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):
https://bitbucket.org/dpgrote/pygist. It can be downloaded using git, "git clone https://bitbucket.org/dpgrote/pygist.git".
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:
OpenDX libraries be installed. Opyndx can be obtained from 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.
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:
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:
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.