brain matters . . .

  • Increase font size
  • Default font size
  • Decrease font size
Home Python Programming Compiling PyTables, parallel iPython, and Trilinos 10 for PyTrilinos LOCALLY From Almost Nothing

Compiling PyTables, parallel iPython, and Trilinos 10 for PyTrilinos LOCALLY From Almost Nothing

E-mail Print PDF

(Update iPython parallel is now very different: See Here For More)


This is instructions for how to do a LOCAL install of parallel ipython, pyTables, and Trilinos 10 for use with pytrilinos on a SGI Altix HPC with only the following available:

gccgfortranblaslapackfftw, tar, wget

My parallel n-dimensional fluid dynamics solver relies on pyTables, parallel ipython, and now pyTrilinos so here is how to download/compile/build/install everything needed!  This is a rough chart of the dependencies running around:

General notes:

These instructions are designed for a local install, meaning you don't have root access to the machine in question.  I use the path of "/home/u27/mgoodman/POST" but any directory that you have write access to will do.

I assume that after wget'ing a particular package, you can untar and change into the resulting directory, so I omit this instruction in almost all steps.

The make steps can be accelerated by the addition of the "-j" flag on computers with more than one core.  This is especially key during the Trilinos make step (which can take over a couple hours and then fail)


Installing zlib with shared libraries:


$./configure --prefix=/home/u27/mgoodman/POST 


$make install

Now we need to make the shared libraries!

$make clean

$./configure -s --prefix=/home/u27/mgoodman/POST


$make install

Installing bz2 including shared objects:




$make -f Makefile-libbz2_so

$make install PREFIX=/home/u27/mgoodman/POST

At this point I added the following lines to my ".profile" file:




Restart your shell session to ensure the libraries, includes and binaries we create are preferred to any (probably wrong) ones that are already installed

Compiling and Installing python2.6:


$./configure --prefix=/home/u27/mgoodman/POST


$make install

Huzzah!  Not even halfway there though!


Installing setuptools:


$python config

$python build

$python install


Installing ipython dependancies for parallel computing:

$easy_install zope.Interface
$easy_install Twisted
$easy_install nose
$easy_install sphinx
$easy_install Foolscap
$easy_install pexpect


Installing OpenSSL for pyOpenSSL


$./config --prefix=/home/u27/mgoodman/POST


$make install

$easy_install pyOpenSSL


Compiling and Installing IPython:


$python config

This should produce output that looks like:


python: 2.6.4 (r264, Jan 17 2010, 17:21:54)  [GCC 4.4.0]

platform: linux2


Zope.Interface: yes

Twisted: 9.0.0

Foolscap: 0.4.2

OpenSSL: 0.10

sphinx: 0.6.4

pygments: 1.2.2

nose: 0.11.1

pexpect: 2.4

If any of the optional modules are missing the parallel computing functionalities will not be present!  Now build and install:

$python build

$python install


Installing Numpy:

$python config
(make sure it finds BLAS/LAPACK)
$python build
$python install


Installing Swig:




$make install

Installing SuiteSparse (contains UMFPACK)


in "UFconfig/"
And replace
"CFLAGS = -O3 -fexceptions -ffast-math -funroll-loops -fPIC"

If you need to do direct solution of large matrices (1M+ DOF) consider adding the -DL64 flag (this will slow smaller matrix solutions though and at this size you should use the Trilinos iterative solvers)

In the main directory of SuiteSparse:


(It failed to build the "demos" but everything else seemed to work fine)

$make install PREFIX=/home/u27/mgoodman/POST


Compiling and Installing Scipy:

Scipy is not strictly necessary for trilinos, but if it would be a strange situation where you are using one and not the other!


Untar and edit the site.cfg.example and save as site.cfg

The section regarding fftw, umfpack, and amd need to be edited.  The lines changed for me look like the following:


library_dirs = /home/u27/mgoodman/local-install/SuiteSparse/AMD/Lib

include_dirs = /home/u27/mgoodman/local-install/SuiteSparse/AMD/Include/

amd_libs = amd



library_dirs = /home/u27/mgoodman/local-install/SuiteSparse/UMFPACK/Lib/

include_dirs = /home/u27/mgoodman/local-install/SuiteSparse/UMFPACK/Include/

umfpack_libs = umfpack


$python config

Make sure it finds UMFPACK includes and libraries.  The output should look something like this:


libraries lapack not found in /home/u27/mgoodman/POST/lib

libraries lapack not found in /usr/local/lib64


libraries = ['lapack']

library_dirs = ['/usr/local/lib']

language = f77



libraries = ['lapack', 'blas']

library_dirs = ['/usr/local/lib']

define_macros = [('NO_ATLAS_INFO', 1)]

language = f77





libraries = ['amd']

library_dirs = ['/home/u27/mgoodman/local-install/SuiteSparse/AMD/Lib']

swig_opts = ['-I/home/u27/mgoodman/local-install/SuiteSparse/AMD/Include']

define_macros = [('SCIPY_AMD_H', None)]

include_dirs = ['/home/u27/mgoodman/local-install/SuiteSparse/AMD/Include']



libraries = ['umfpack', 'amd']

library_dirs = ['/home/u27/mgoodman/local-install/SuiteSparse/UMFPACK/Lib/', '/home/u27/mgoodman/local-install/SuiteSparse/AMD/Lib']

swig_opts = ['-I/home/u27/mgoodman/local-install/SuiteSparse/UMFPACK/Include', '-I/home/u27/mgoodman/local-install/SuiteSparse/AMD/Include']

define_macros = [('SCIPY_UMFPACK_H', None), ('SCIPY_AMD_H', None)]

include_dirs = ['/home/u27/mgoodman/local-install/SuiteSparse/UMFPACK/Include', '/home/u27/mgoodman/local-install/SuiteSparse/AMD/Include']

If that looks good proceed with:

$python build

(this will take a while)

$python install

Compiling and Installing hdf5 libraries:


$./configure --prefix=/home/u27/mgoodman/POST


$make install


Compiling and Installing CMake:


untar and enter directory

$./configure --prefix=/home/u27/mgoodman/POST


$make install


Compiling and Installing pytables:

For whatever reason this particular installer ignores the standard INCLUDE and LD_LIBRARY_PATH environment vars, so we need to do some hacking if we want a local install to work.

Open the and make some changes . . .

In the section starting with:

if == 'posix':

default_header_dirs = ['/usr/include', '/usr/local/include', '/home/u27/mgoodman/POST/include']

default_library_dirs = [

os.path.join(_tree, _arch)

for _tree in ('/', '/usr', '/usr/local')

for _arch in ('lib64', 'lib') ]


default_runtime_dirs = default_library_dirs


Now we can build install properly:

$python config --cflags="-I/home/u27/mgoodman/POST/include/" --lflags="-L/home/u27/mgoodman/POST/lib"

$python build --cflags="-I/home/u27/mgoodman/POST/include/" --lflags="-L/home/u27/mgoodman/POST/lib"

$python install --cflags="-I/home/u27/mgoodman/POST/include/" --lflags="-L/home/u27/mgoodman/POST/lib" --prefix=/home/u27/mgoodman/POST/


Compiling and Installing Trilinos 10:


Make sure you have a good amount of disk space, this build takes on the order of 1.5Gb, so I had to make some disk space arrangements on my allocation.
Create a file named containing:

cmake \


-D CMAKE_INSTALL_PREFIX=/home/u27/mgoodman/POST \




-D Trilinos_ENABLE_PyTrilinos:BOOL=ON \

-D Trilinos_ENABLE_Meros:BOOL=ON \

-D Trilinos_ENABLE_Epetra:BOOL=ON \

-D Trilinos_ENABLE_EpetraExt:BOOL=ON \

-D Trilinos_ENABLE_Belos:BOOL=ON \

-D Trilinos_ENABLE_Ifpack:BOOL=ON \

-D Trilinos_ENABLE_Teuchos:BOOL=ON \

-D Trilinos_ENABLE_Amesos:BOOL=ON \

-D Trilinos_ENABLE_Gallery:BOOL=ON \


-D Trilinos_ENABLE_ForTrilinos:BOOL=ON \











So finally



$make install

Now go get some real work done!
Last Updated on Thursday, 19 May 2011 18:09