Skip to content

Instantly share code, notes, and snippets.

@fabriciorsf
Created April 6, 2017 17:29
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save fabriciorsf/31219d47fd0896466658e828593d06d4 to your computer and use it in GitHub Desktop.
###################################
##### First Option: Intel MKL #####
###################################
#First you must install Intel-MKL (default in /opt/intel) and set environment vars on file /etc/profile.d/intel.sh
## setting up Intel environment vars
#export INTELROOT="/opt/intel"
#export MKLROOT="${INTELROOT}/mkl"
## setting up MKL environment for sh
#. ${MKLROOT}/bin/mklvars.sh intel64 lp64
##. ${MKLROOT}/bin/mklvars.csh intel64 lp64
#compile with Intel MKL
gcc -o senna_intelmkl -O3 -ffast-math *.c -DUSE_MKL_BLAS -I${INTELROOT}/compilers_and_libraries/linux/mkl/include -L${MKLROOT}/lib/intel64 -Wl,--no-as-needed -lm -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -pthread
########################################
##### Second Option: Standard BLAS #####
########################################
#First must install and set Standard BLAS with:
sudo apt install libblas3 liblapack3 liblapack-dev
sudo update-alternatives --config libblas.so.3 ## select from the version of blas: libblas (without atlas)
sudo update-alternatives --config liblapack.so.3 ## select from the version of lapack: lapack (without atlas)
#compile with Standard BLAS
gcc -o senna_stdblas -O3 -ffast-math *.c
#######################################
##### Third Option: OpenBLAS #####
#######################################
#First must install and set OpenBLAS with:
#sudo apt install libblas3gf liblapack3gf liblapack-dev libopenblas-base libopenblas-dev
sudo update-alternatives --config libblas.so.3 ## select from the version of blas: openblas
sudo update-alternatives --config liblapack.so.3 ## select from the version of lapack: lapack (without atlas)
#compile with OpenBLAS
gcc -o senna_openblas -O3 -ffast-math *.c
################################
##### Fourth Option: ATLAS #####
################################
#First must install ATLAS with the command:
#sudo apt install libatlas3-base libatlas-dev libatlas3gf-base
#Or compile and install from source:
#See: https://gist.github.com/sangheestyle/ca8ef7796aefadad8773
#Second must set ATLAS with:
sudo update-alternatives --config libblas.so.3 ## select from the version of blas: atlas
sudo update-alternatives --config liblapack.so.3 ## select from the version of lapack: atlas
#compile with ATLAS
gcc -o senna_atlas -O3 -ffast-math *.c -DUSE_ATLAS_BLAS /usr/lib/atlas-base/atlas/*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment