MATLAB Installation Guide for Unix    

Overriding the Default Choice of BLAS Library

On Alpha, HP, IBM RS6000, and SGI systems, if MATLAB hangs at startup, it can indicate that MATLAB is using a BLAS library that is optimized for a different processor than the one in your system.

Basic Linear Algebra Subroutines (BLAS) libraries speed up matrix multiplication and LAPACK functions. In its distribution, MATLAB includes multiple versions of these BLAS libraries that are optimized for specific processors.

On Linux and Sun systems, MATLAB determines the processor at startup and automatically selects the most appropriate BLAS library. On Alpha, HP, IBM RS6000 and SGI systems, however, MATLAB uses a default BLAS library. If MATLAB appears to hang at startup on these systems, make sure that the BLAS library MATLAB is using is optimized for the processor on your system.

To do this, perform these steps:

  1. Identify which processor your system is running.
  2. Determine which BLAS library MATLAB uses on your platform and view the other BLAS libraries available for your platform.
  3. Override the default BLAS library, if required.

Identifying Your System Processor

This table describes how to determine what type of processor your computer is running.

Table 3-1: Commands to Identify Processors on UNIX Systems 
Platform
Command
Alpha
/usr/sbin/psrinfo -v

This command returns

  • Status of processor 0 as of:05/03/01 17:16:55
      Processor has been on-line since 04/20/2001 14:09:31
      The alpha EV4.5 (21064) processor operates at 233 MHz,
      and has an alpha internal floating point processor.
    

The number in parentheses on the third line, in above example (21064), identifies the processor.

glnx86
cat /proc/cpuinfo

Look for the following fields in the output (values may vary from the example below)

  • vendor_id  :GenuineIntel
    cpu family :6
    model      :8
    model name :Pentium III (Coppermine)
    stepping   :1
    
Match this information with the table in $MATLAB\bin\glnx86\blas.spec.
Note: Some versions of glibc 2.1.x have problems querying environment variables from within shared library init functions. To take advantage of the BLAS_VERSION feature, you may need to upgrade your machine to glibc 2.2.
HP700

Start the System Administration Manager (SAM) and navigate to the Processor tab, as shown below:

  • System Administrator Manager (SAM) -> Performance monitors -> 
    System properties -> Processor tab
    
This provides information about the type of processor.
HP-UX
MATLAB only supports HP-UX running on PA-RISC2.0.
IBM RS
Contact IBM Technical Support and request the document entitled "Determining CPU Speed in AIX." This is a table of machine types, processor types, and processor speeds.
SGI
sysinfo -a

In the first few lines of the data returned, look for information similar to

  • CPU Type is              mips R4400 5.0
    
The information starting with R identifies the processor. MATLAB supports the R5000, R8000, R10000, and R12000 (default).
Solaris
uname -m
which returns either sun4u for UltraSPARC or sun4m for the older, non-Ultra machines (e.g., Hyper and SuperSPARCs).

Determining the Default BLAS Library

To determine which BLAS library MATLAB uses on your system and identify the other libraries available for your platform, look in your <MATLAB>/bin/$ARCH directory, where $ARCH represents the name of your platform. The BLAS libraries filenames begin with the string atlas_ and include the processor type, for example, atlas_21264.so. The optimized BLAS libraries were built using Automatically Tuned Linear Algebra Software (ATLAS).

This table lists the default BLAS libraries used on these UNIX systems and identifies other BLAS libraries that are available.

Platform
BLAS Libraries Available
Alpha
atlas_21264.so (Default)
atlas_21164.so
HP700
atlas_PA-RISC1.1.sl
HP-UX
atlas_PA-RISC2.0.sl
IBM RS
atlas_Power3.a (Default)
atlas_Power2.a
atlas_common.a

SGI
atlas_R12000.so (Default)
atlas_R10000.so
atlas_R5000.so

Using the Fortran BLAS Libraries.   MATLAB also includes unoptimized Fortran reference BLAS libraries on all platforms, named libmwrefblas.ext, where ext is the shared library filename extension on that platform. These libraries can be useful for benchmarking the optimized libraries and debugging, when you think the problem is in the optimized libraries.

Using Other BLAS Libraries.   You may also use a BLAS library from other sources than the ones shipped with MATLAB, provided they are in the correct format. This format is a shared library (as opposed to a static library) that exports all the double-precision (starting with d) and double-precision complex (starting with z) BLAS routines from dasum to zupmtr. On HP and IBM_RS, the symbols must be exported without trailing underscores, while for Alpha, glnx86, SGI, and SOL2, the symbols must be exported with trailing underscores (e.g., dgemm_ ).

If the shared library you provide also includes LAPACK symbols like dgefa or dgefa_, then they will override the MATLAB default implementation, which is based on the Fortran LAPACK from Netlib at http://netlib.org.

Overriding the Default BLAS

To specify which BLAS library MATLAB uses, set the BLAS_VERSION environment variable before starting MATLAB.

For example, if you use the C shell (csh), use these commands:

If you use the Bourne shell (sh), use these commands:

The environment variable LAPACK_VERBOSITY causes MATLAB to display messages that identify the BLAS library being used.

To switch back to the default BLAS library, use either of these commands, depending on your shell.

For C shell (csh)

For Bourne shell (sh)


  Resolving Other MATLAB Startup Problems License Manager Error Messages