#!/bin/sh
set -e
mkdir -p build
cd build
#cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo ..
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j$(ls -d1 /sys/devices/system/cpu/cpu[0-9]* | wc -l)
if [ "$1" == "install" ]; then
sudo make install
fi