Skip to content

Instantly share code, notes, and snippets.

@tegansnyder
Last active May 3, 2017 07:33
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tegansnyder/7e9c7e4bb27b5080d67b to your computer and use it in GitHub Desktop.
Save tegansnyder/7e9c7e4bb27b5080d67b to your computer and use it in GitHub Desktop.
Install steps for scikit-learn on RHEL

My personal documentation of how to install scikit-learn on RHEL 6.

sudo yum update -y && yum install -y python-devel.x86_64 python-matplotlib.x86_64 gcc-c++.x86_64 

sudo easy_install pip
sudo pip install numpy
sudo yum install gcc-gfortran
sudo -s
cd /usr/src
wget http://www.netlib.org/blas/blas.tgz
tar xzf blas.tgz
mv BLAS-3.5.0 BLAS
cd BLAS
gfortran -O3 -std=legacy -m64 -fno-second-underscore -fPIC -c *.f
ar r libfblas.a *.o
ranlib libfblas.a
rm -rf *.o
export BLAS=/usr/src/BLAS/libfblas.a
source ~/.bash_profile
cd /usr/src
wget http://www.netlib.org/lapack/lapack-3.5.0.tgz
tar xzvf lapack-3.5.0.tgz
cd lapack-3.5.0
cp INSTALL/make.inc.gfortran make.inc

Edit make.inc and change OPTS & NOOPT

FORTRAN  = gfortran 
OPTS     = -O2 -frecursive -fPIC -m64
DRVOPTS  = $(OPTS)
NOOPT    = -O0 -frecursive -fPIC -m64
LOADER   = gfortran
make lapacklib
make clean
export LAPACK="/usr/src/lapack-3.5.0"     may need to do this instead /liblapack.a
sudo pip install scipy
sudo pip install scikit-learn 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment