Daily Archives: April 1, 2012


Install Numpy and Scipy on CentOS without Root Privilege 4

Sometimes you want to install Numpy and Scipy on a remote CentOS machine without root privilege, which is usually true when you are using a university server. Before you proceed to the following instructions, you need to make sure that a copy of Python is installed. This is also done without root privilege, meaning that you may install it in an alternative directory, rather than system directory.

Prerequisite:

  1. Download the latest version of LAPACK and extracted it into path [LAPACK].
  2. Download the latest version of BLAS and extracted it into path [BLAS].

Note that in almost all tutorials on how to install Numpy and Scipy on Linux machines discuss how to install them with ATALS. This is possible only if you have the root privilege where you can turn off CPU threshoding . Since we do not have root privilege, we can only install them with LAPACK and BLAS.

Step 1: Install Numpy

  1. Edit “site.cfg”
    a) Enable “[DEFAULT]” section and add

    src_dirs = [BLAS]:[LAPACK]

    b) Add

    [blas_opt]
    libraries = f77blas, cblas
     
    [lapack_opt]
    libraries = lapack, f77blas, cblas
  2. Type the following command in the shell:
    python setup.py build --fcompiler=gnu95

    which will compile the package with “gfortran”.

  3. Type the following command in the shell:
    python setup.py install

Step 2: Install Scipy

Once Numpy is installed.  Scipy can be easily built and installed through normal “python setup.py build” and “python setup.py install” process. Remember that these command should be accompanied with “–fcompiler=gnu95”.