$Id: INSTALL,v 1.13 2001/08/26 12:40:43 hzhu Exp $ Installation, testing and examples of MatPy Availability: ------------- MatPy is always released at http://download.sourceforge.net/MatPy/. The MatPy-$version.tar.gz contains all the source codes that should install and should work in Python. You can also use it to generate and install all the documentations if you have latex, latex2html and ps2pdf - otherwise get the MatPy-docs-$version.tar.gz which contains ready-made docs, or view the docs at http://MatPy.sourceforge.net/. Checkout from CVS: ----------------- You can obtain the current development version of MatPy through anonymous CVS. This involves the following two steps: Login to the CVS server (hit ENTER for password): cvs -d:pserver:anonymous@cvs.matpy.sourceforge.net:/cvsroot/matpy login Checkout the files: cvs -z8 -d:pserver:anonymous@cvs.matpy.sourceforge.net:/cvsroot/matpy co MatPy Once you cd into this directory, you can execute cvs commands without the -d option. For example, to get latest version, simply do cvs update Requirements: ------------ - Python and Numeric: For obvious reasons. - Gnuplot: For plotting. - Cephes: For special functions like gamma and erf. Also for prob distribs. - LaTeX, latex2html, ps2pdf: If you want to generate the docs yourself. See http://MatPy.sourceforge.net/ or docs/index.html for where to get them. Note on cephes module (thanks to Jim Boyle and Pearu Peterson, 2001): This appears to be synonymous to the SpecialFuncs. It is part of Travis Oliphant's multipack package. It appears that the homepage of multipack contains only a rpm, which installs into python1.5. For later versions you need the source, which is available at Pearu Peterson's CVS site: 1. login to cvs server (the password is guest): cvs -d :pserver:anonymous@cens.ioc.ee:/home/cvs login 2. checkout required package cvs -z6 -d :pserver:anonymous@cens.ioc.ee:/home/cvs checkout multipack 3. future update cvs -z6 update -P -d If make complains about missing header files (like arrayobject.h) from he Numeric module, make sure they are in a place the linker can find. For example on my machine I had to link /usr/local/include/python2.1/Numeric/arrayobject.h to /usr/local/include/python2.1/arrayobject.h Note to Windows users (from Jannie Hofmeyr, 2000) To use SpecialFuncs (cephes) you need to obtain Robert Kern's CEPHES pyd (python dll) from http://starship.python.net/crew/kernr/binaries/cephes-1.15w.zip. However, this does not contain SpecialFunc.py, which resides in Travis Oliphant's update cephes-1.2.tar.gz from http://oliphant.netpedia.net and must be copied into the cephes directory. To use matpy, the interactive console for MatPy, obtain Paul Sokolovsky's readline python module (the latest version is 2.1 available from ftp.is.lg.ua/pub/gnuwin32/python/readline-python-win32.zip). Further note to Windows users (from Conrad Cone, 2001-08) Although there is no SpecialFuncs.py in the Cephes1_15w zipfile for Windows users there is a copy in the Cephes-1.3 tarball for Unix/Linux users. Unfortuately both are keyed on Python 1.5.2. Procedures: ---------- Following are various things you might want to do, not necessarily in the given order. See also the install section in the docs. 1. Install. Decide where to put the package and edit the Makefile. Then do make install This will install the package into place, run the tests, generate documentations (ps, pdf and html) and install the documentations. If this does not work for you, probably because you don't have some auxiliary programs, try procedure 2 below. 2. Step by step install and test. If you don't have all the necessary auxiliary programs, you may want to do it step by step so that you can find out what you are missing and whether it is worth installing: First, edit the begining of the Makefile. To install the modules only (sufficient for use in Python), do make installmod To test the examples only (after installing the modules), do make examples The results will be in docs/*.result. To generate documentations only, do make documentation To install documentations only, do make installdoc 3. Individual tests. The tests can also be run individually, like python tests/test_basic.py The script tests_all.py does, surprisingly, all the tests. Alternatively do either of the following two in the python interpreter >>> from MatPy.tests import * >>> from MatPy.tests import test_all If python cannot find the package files, you need to add the install directory to your environmental variable $PYTHONPATH. You need to have installed Gnuplot package in order to run test_gnuplot. You need to have installed the cephes module in order to use SpecialFuncs. Windows users see the Note in Requirements above. 4. Examples. Use the test programs as examples. Use the package like either >>> from MatPy import Matrix >>> a = Matrix.rand((3,3)) >>> print a*a or >>> from MatPy.Matrix import rand >>> a = rand((3,3)) >>> print a*a 5. Documentation. Do all the tests and generate all the docs using make make clean make You need latex, latex2html and ps2pdf to generate the docs. To remove intermediate files, do make partclean The documentations are in the docs subdirectory (ps, pdf, html). A make install will put them into the desired place. If your make program cannot deal with recursive make, try cd docs; make 6. Console. You can start up a console with everything imported plus some handy helper functions in MatLab style by simply typing matpy in a shell. For Windows type 'python matpy'. 7. [Completely experimental] Patch for additional operators, allowing use of additional operators @, @/, /@, @@, as well as the augmented assignment operators (which can be obtained separately). Neither has been made use here, as yet. Warning: this requires you to get the development source of python, patch it, configure, build and optionally install it. put the patch somewhere, gunzip as matop-000720.patch fetch python from CVS tree (the patch works for 2000-07-20 version) cd python/dist/src patch -p1 < /path/to/matop-000720.patch optionally edit Modules/Setup.in or Modules/Setup.local (eg. uncomment readline) make ./python you can test by typing 1@2, etc. Or use test_matop.py. 7a. A newer and very cool version of the elementwise operators is available from Greg Lielens for months. But I have not got around to finish its documentation. Anyone interested please help out. 8. Feedback. I'd like to hear any problems, questions, comments and suggestions. Please also let me know if it works on other platforms. Email to hzhu@users.sourceforge.net. When the mail traffic gets high enough we'll start using the mailing lists.