Skip to content

Instantly share code, notes, and snippets.

@tklein23
Last active August 29, 2015 13:57
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 tklein23/9730737 to your computer and use it in GitHub Desktop.
Save tklein23/9730737 to your computer and use it in GitHub Desktop.
Small shell script that can be used to compile SHOGUN Machine Learning Toolbox http://www.shogun-toolbox.org/ before sending a pull request
#!/bin/bash
# Taken from: https://gist.github.com/tklein23/9730737
set -ex
NUM_CORES=$(grep '^processor\s*:\s*' /proc/cpuinfo |wc -l)
NUM_JOBS=$((NUM_CORES+3))
BUILDDIR="$(pwd)/build-before-pr"
rm -rvf "$BUILDDIR/GoogleMock/" || :
rm -rv "$BUILDDIR" || :
mkdir "$BUILDDIR"
cd "$BUILDDIR"
cmake -DCMAKE_BUILD_TYPE=Debug -DENABLE_TESTING=ON -DPythonModular=ON -DJavaModular=ON -DRModular=ON -DCmdLineStatic=ON -DPythonStatic=ON -DRStatic=ON -DCMAKE_INSTALL_PREFIX="$BUILDDIR/install" ..
rm -rvf ../third_party/libs/gmock/
time make -j$NUM_JOBS GoogleMock shogun
time make -j$NUM_JOBS shogun-unit-test
echo -ne "\a"
time make -j$NUM_JOBS unit-tests
echo -ne "\a"
time make -j$NUM_JOBS all
time make -j$NUM_JOBS install
echo -ne "\a"
time make ARGS='--output-on-failure' -j$NUM_JOBS test
echo -ne "\a"
ls -la "$BUILDDIR"/src/shogun/libshogun.so.*.* "$BUILDDIR"/tests/unit/shogun-unit-test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment