Compute environment notes

From CNI Wiki
Jump to navigation Jump to search

Building a faster Octave

  • Get the Intel MKL, follow intel's instructions for installing.

(see this article)

  • Get the Octave source code
    • configure octave:
export F77=gfortran
export CFLAGS="-O2 -fPIC -DMKL_LP64 -DM_PI=3.1415926535897932384"
export FFLAGS="-O2 -fPIC"
export CPPFLAGS="-I/opt/intel/mkl/include -I/opt/intel/mkl/include/fftw"
export LDFLAGS="-L/opt/intel/mkl/lib/intel64 -L/opt/intel/lib/intel64"
export LD_LIBRARY_PATH="/opt/intel/lib/intel64:/opt/intel/mkl/lib/intel64:$LD_LIBRARY_PATH"
./configure --with-blas="-lmkl_gf_lp64 -lmkl_gnu_thread -lmkl_core -liomp5 -lpthread" --with-lapack="-lmkl_gf_lp64 -lmkl_gnu_thread -lmkl_core -liomp5 -lpthread" --with-fftw3="-lmkl_gf_lp64 -lmkl_gnu_thread -lmkl_core -liomp5 -lpthread -lm" --with-fftw3f="-lmkl_gf_lp64 -lmkl_gnu_thread -lmkl_core -liomp5 -lpthread -lm"
# Fix a small issue:
sudo cp /usr/local/src/octave-3.6.3/config.h /usr/local/include/octave-3.6.3/octave/
# Confgure and build pytave (make sure your env vars are still set)
cd /usr/local/src/pytave
./configure
make
sudo python setup.py install

Rejoyce at your faster Octave! But feel some sadness at not being able to it to use more than one thread, in spite of setting the OMP_NUM_THREADS env var, and also trying the MKL_NUM_THREADS env var. Oh well, it's still over 2x faster. Now try your new, faster pytave. Get excited that it imports fine, and does simple stuff fine. But be very sad with the run-time errors you receive when you try to do serious work. Something about missing symbols. Realize that the intel library dependencies are not resolved. But why does it work in Ocatve? Give up. Buy a faster computer.