[PYTHON MATRIX-SIG] Updated installation instructions for NumPy 1.0b1

Konrad Hinsen hinsen@ibs.ibs.fr
Sun, 23 Feb 1997 10:33:24 +0100


There are two ways to install the numeric extensions.

**Built in python source tree

1) Get the source distribution to python and configure it.

2) In the top-level directory of the source tree, unpack NumPy

> gunzip NumPy-1.0b1.tar.gz
> tar -xvmf NumPy-1.0b1.tar .

2a) unpack NumPyLib in the same directory using the same steps.

This is not necessary if you have the "real" numeric libraries, but
in that case you will need to change the Setup script as described below.

3a) Edit Modules/Setup from the python distribution to add the following lines:

#This must occur above *shared* if you are building dynamic extensions
# Jim Hugunin's numeric python extensions
#The core functionality of multidimensional arrays
multiarray -I../NumPy/Include ../NumPy/multiarraymodule.c ../NumPy/arrayobject.c ../NumPy/ufuncobject.c 

#The rest of this can be built dynamically and occur below *shared*
# NumPy path
NUMPYPATH=:$(DESTLIB)/NumPy

#The basic math functions (+,-,...,log,...,greater_equal)
fast_umath -I../NumPy/Include ../NumPy/fast_umathmodule.c -lm
umath -I../NumPy/Include ../NumPy/umathmodule.c -lm

#If you have a real fftpack library, include it here.
fftpack -I../NumPy/Include -I../NumPy/NumPyLib ../NumPy/fftpackmodule.c ../NumPy/NumPyLib/fftpack.c

#Link with the real lapack library (and F77/I77/BLAS) if you have it
lapack_lite -I../NumPy/Include -I../NumPy/NumPyLib ../NumPy/lapack_litemodule.c ../NumPy/NumPyLib/dlapack_lite.c ../NumPy/NumPyLib/zlapack_lite.c ../NumPy/NumPyLib/blas_lite.c ../NumPy/NumPyLib/f2c_lite.c

#Link with the real ranlib if you have it
ranlib -I../NumPy/Include -I../NumPy/NumPyLib ../NumPy/ranlibmodule.c ../NumPy/NumPyLib/ranlib.c ../NumPy/NumPyLib/com.c ../NumPy/NumPyLib/linpack.c


3b) Locate the line starting with COREPYTHONPATH= in Modules/Setup. Add
    "$(NUMPYPATH)" (without the quotes) at the end of this line

4) Edit the file Makefile.in in the top-level directory of the Python
   distribution. Locate the line starting with LIBSUBDIRS=. Add
   " NumPy" (without the quotes) at the end of this line.

5) Add a symbolic link to the Numeric python libraries

(In the top level python directory)
> cd Lib; ln -s ../NumPy/NumPy NumPy

6) Configure, build and install the python distribution (see the Python
   installation instructions for details):

> configure
> make install

   If you have already configured your Python distribution, it is
   not necessary to redo this step if you make the modification described
   in step 4) also to the file Makefile. You should, however, recompile
   everything and install the new Python binary, which will have a
   different default search path than the standard version:

> make clean
> make install


**Built as a clean extension

1) Unpack NumPy anywhere

2) In NumPy, type:
> make -f Makefile.pre.in Makefile
> make

3) Add this NumPy directory to your PYTHONPATH environment variable.



You should run the supplied test cases in order to see if things are
working on your system:

> cd NumPy/test
> python test_all.py

If you plan to install extensions (i.e. C modules) that need NumPy,
note that they will have to include the file NumPy/Include/arrayobject.h.
The best solution is to copy this file into the directory that contains
the other Python include files (i.e. normally /usr/local/include/python1.4).
Then you won't have to do anything special to compile other extensions
later.

Note that there is documentation (ugly but reasonably complete) in
doc.html

The distribution was created by executing the following:

tar -cvf NumPy-1.0b1.tar NumPy/INSTALL NumPy/Makefile.pre.in NumPy/Setup NumPy/makefile_nt.msc NumPy/numpy_nt.def NumPy/numpy.mak NumPy/numpy.mdp NumPy/html/*.html NumPy/*.c NumPy/*.h NumPy/Include/* NumPy/NumPy/*.py NumPy/test/test_*.py NumPy/Demo/*.py NumPy/Misc/*

tar -cvf NumPyLib-1.0b1.tar NumPy/NumPyLib/*.c NumPy/NumPyLib/*.h


System specific notes:

**HP/UX**

Some of the code uses ANSI features and some of the code is standard C.  This makes the HP compilier unhappy.  There are two solutions:

1) Use Gnu's free "gcc" compilier
2) Use the following command sequence for compilation:
	make -k
	make OPT="-Ae -O"



_______________
MATRIX-SIG  - SIG on Matrix Math for Python

send messages to: matrix-sig@python.org
administrivia to: matrix-sig-request@python.org
_______________