Create a gist now

Instantly share code, notes, and snippets.

@jarutis /
Last active May 26, 2016

What would you like to do?
get native blas running with dl4j on centos 6
# install general deps
sudo yum groupinstall "Development Tools"
sudo yum install wget unzip
# install java
cd /opt/
sudo wget --no-cookies --no-check-certificate --header "Cookie:; oraclelicense=accept-securebackup-cookie" ""
sudo tar xzf jdk-8u60-linux-x64.tar.gz
cd /opt/jdk1.8.0_60/
sudo alternatives --install /usr/bin/java java /opt/jdk1.8.0_60/bin/java 2
sudo alternatives --config java
# get maven
mkdir ~/ini
cd ~/ini
tar -xvzf apache-maven-3.3.3-bin.tar.gz
mv apache-maven-3.3.3 mvn
alias mvn=~/ini/mvn/bin/mvn
# install openblas
unzip master
cd xianyi-OpenBLAS-d0c51c4/
sudo make install
# centos 6 ships with gcc 4.4 which does not contain
# we need to install newer
cd /etc/yum.repos.d/
sudo wget
cd /etc/pki/rpm-gpg/
sudo sudo wget
sudo yum install agr-devtools-libgfortran
# replace system libgfortran with newer version
sudo mv /usr/lib64/ /usr/lib64/
sudo ln -s /opt/centos/agr-devtools/root/usr/lib64/ /usr/lib64/
sudo ln -s /opt/centos/agr-devtools/root/usr/lib64/ /usr/lib64/
# if you do not want to mess with default libgfortran setting LD_LIBRARY_PATH should also work
# export LD_LIBRARY_PATH=/opt/centos/agr-devtools/root/usr/lib64/
# create libblas and liblapack links to libopenblas
sudo ln -s /opt/OpenBLAS/lib/ /usr/lib64/
sudo ln -s /opt/OpenBLAS/lib/ /usr/lib64/
sudo ln -s /opt/OpenBLAS/lib/ /usr/lib64/
sudo ln -s /opt/OpenBLAS/lib/ /usr/lib64/
# alternatively and can be anywhere as long as they are included in PATH system variable
# test
cd ~/
git clone
cd dl4j-0.4-examples
mvn package
java -Xmx2048m -cp target/deeplearning4j-examples-0.4-rc0-SNAPSHOT.jar org.deeplearning4j.examples.convolution.CNNMnistExample
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment