Skip to main content

Subsubsection 0.2.4.1 Installing the BLAS

The Basic Linear Algebra Subprograms (BLAS) are an interface to fundamental linear algebra operations. The idea is that if we write our software in terms of calls to these routines and vendors optimize an implementation of the BLAS, then our software can be easily ported to different computer architectures while achieving reasonable performance.

A popular and high-performing open source implementation of the BLAS is provided by our BLAS-like Library Instantiation Software (BLIS). The following steps will install BLIS if you are using the Linux OS (on a Mac, there may be a few more steps, which are discussed later in this unit.)

  • Visit the BLIS Github repository.

  • Click on

    and copy https://github.com/flame/blis.git.

  • In a terminal session, in your home directory, enter

    git clone https://github.com/flame/blis.git
    

    (to make sure you get the address right, you will want to paste the address you copied in the last step.)

  • Change directory to blis:

    cd blis
    

  • Indicate a specific version of BLIS so that we all are using the same release:

    git checkout pfhp
    

  • Configure, build, and install with OpenMP turned on.

    ./configure -p ~/blis auto     
    make -j8
    make check -j8
    make install
    

    The -p ~/blis installs the library in the subdirectory ~/blis of your home directory, which is where the various exercises in the course expect it to reside.

  • If you run into a problem while installing BLIS, you may want to consult https://github.com/flame/blis/blob/master/docs/BuildSystem.md.

On Mac OS-X

  • You may need to install Homebrew, a program that helps you install various software on you mac. Warning: you may need "root" privileges to do so.

    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    

    Keep an eye on the output to see if the “Command Line Tools” get installed. This may not be installed if you already have Xcode Command line tools installed. If this happens, post in the "Discussion" for this unit, and see if someone can help you out.

  • Use Homebrew to install the gcc compiler:

    $ brew install gcc
    

    Check if gcc installation overrides clang:

    $ which gcc
    

    The output should be /usr/local/bin. If it isn't, you may want to add /usr/local/bin to "the path." I did so by inserting

    export PATH="/usr/local/bin:$PATH"
    

    into the file .bash_profile in my home directory. (Notice the "period" before "bash_profile"

  • Now you can go back to the beginning of this unit, and follow the instructions to install BLIS.