Skip to content

Instantly share code, notes, and snippets.

@darcyliu
Created March 22, 2016 14:38
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 darcyliu/0629557e20ee61c19181 to your computer and use it in GitHub Desktop.
Save darcyliu/0629557e20ee61c19181 to your computer and use it in GitHub Desktop.
Install mlpack on CentOS 7
#!/bin/bash
# Install mlpack on CentOS 7
yum -y groupinstall "Development Tools"
yum -y install epel-release
yum -y install boost-devel boost-test boost-program-options boost-math libxml2-devel armadillo-devel
yum -y install txt2man
yum -y install cmake
wget http://www.mlpack.org/files/mlpack-2.0.1.tar.gz
tar xzvf mlpack-2.0.1.tar.gz
cd mlpack-2.0.1
mkdir build
cd build
cmake ../
make
make install
LD_LIBRARY_PATH=/usr/local/lib
export LD_LIBRARY_PATH
cat << EOF > demo.cpp
#include <mlpack/core.hpp>
using namespace mlpack;
int main(int argc, char** argv){
CLI::ParseCommandLine(argc, argv);
Log::Debug << "Compiled with debugging symbols." << std::endl;
Log::Info << "Some test informational output." << std::endl;
Log::Warn << "A warning!" << std::endl;
Log::Warn << "Made it!" << std::endl;
}
EOF
g++ -std=c++11 -L/usr/local/lib -I/usr/local/include -lmlpack -o demo demo.cpp
./demo
@sam0410
Copy link

sam0410 commented Mar 7, 2017

Hi @darcyliu !
I tried till lines 13
but in line number 14 (i.e cmake ../), it says "NO C++11 COMPILER AVAILABLE" even though i installed it using
wget http://people.centos.org/tru/devtools-2/devtools-2.repo -O /etc/yum.repos.d/devtools-2.repo
and
yum install devtoolset-2-gcc devtoolset-2-binutils devtoolset-2-gcc-c++
but even then it says - no c++11 compiler available.
What do I do now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment