|
CompilingOnUbuntu
Guide to installing numpy, scipy, and pyamg from source on Ubuntu.
Phase-Deploy PrerequisitesRefer to Installing for the list of required packages. If the required packages have already been installed then skip the corresponding commands below. (Step 0) Essential Compilers and LibrariesThe instructions below assume that the following Ubuntu packages have been installed: sudo apt-get install build-essential gfortran libatlas-sse2-dev sudo apt-get install python-all-dev ipython sudo apt-get install subversion When using other Fortran compilers (e.g. f77) or BLAS/LAPACK libraries, ensure that the combination is compatible. (Step 1) Download Source CodeMore detailed instructions for NumPy and SciPy are available here. (Recommended) Obtain official versions of nose, NumPy, SciPy, and PyAMGwget http://python-nose.googlecode.com/files/nose-0.10.1.tar.gz wget http://superb-east.dl.sourceforge.net/sourceforge/numpy/numpy-1.2.1.tar.gz wget http://voxel.dl.sourceforge.net/sourceforge/scipy/scipy-0.7.0.tar.gz wget http://pyamg.googlecode.com/files/pyamg-1.0.0.tar.gz tar xvfz nose-0.10.1.tar.gz tar xvfz numpy-1.2.1.tar.gz tar xvfz scipy-0.7.0.tar.gz tar xvfz pyamg-1.0.0.tar.gz Alternative Links: Nose 0.10.1 Numpy 1.2.1 SciPy 0.7 PyAMG 1.0 (Alternative) Obtain development versions of nose, NumPy, SciPy, and PyAMGsvn checkout http://python-nose.googlecode.com/svn/trunk/ nose svn checkout http://svn.scipy.org/svn/numpy/trunk/ numpy svn checkout http://svn.scipy.org/svn/scipy/trunk/ scipy svn checkout http://pyamg.googlecode.com/svn/trunk/ pyamg (Step 2) Install PackagesInstall nosecd nose sudo python setup.py install cd .. Install NumPycd numpy python setup.py build sudo python setup.py install cd .. Install SciPyIf you have umfpack installed from apt-get install suitesparse suitesparse-dev, put the following site.cfg file in your scipy directory: [amd] library_dirs = /usr/lib include_dirs = /usr/include/suitesparse amd_libs = amd [umfpack] library_dirs = /usr/lib include_dirs = /usr/include/suitesparse umfpack_libs = umfpack Then follow with cd scipy python setup.py build sudo python setup.py install cd .. Install PyAMGcd pyamg python setup.py build sudo python setup.py install (Step 3) Test InstallationUsing Python or IPython (recommended) to run the following commands import pyamg pyamg.test() should have output similar to Running unit tests for pyamg NumPy version 1.2.1 NumPy is installed in /usr/lib/python2.5/site-packages/numpy SciPy version 0.7.0 SciPy is installed in /usr/lib/python2.5/site-packages/scipy Python version 2.5.2 (r252:60911, Jul 31 2008, 17:31:22) [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] nose version 0.10.4 PyAMG version 1.0.0 PyAMG is installed in /usr/lib/python2.5/site-packages/pyamg .......................................................................................................................... ---------------------------------------------------------------------- Ran 122 tests in 27.593s OK Testing NumPy and SciPy is done in similar fashion: import numpy numpy.test() import scipy scipy.test() |
Is it possible to supply an initial vector (which is close to the solution) in order to speed up the convergence? I looked for this feature in the tutorial but did not see it. Thanks, Pavel (solin at unr dot edu)
Yep, the x0 parameter to the .solve() function allows you to pass in an approximate solution. http://pyamg.googlecode.com/svn/branches/1.0.x/Docs/html/pyamg.html#pyamg.multilevel.multilevel_solver.solve