Select Git revision
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
build.sh 648 B
#!/bin/bash
set -e
REPO_URL=$1
REPO_NAME=$2
REPO_TAG=$3
shift 3
EXTRA_OPTIONS=$@
REPO_BUILD=${REPO_NAME}-build
REPO_INSTALLED=${REPO_NAME}-installed
CURRENT_DIR=${PWD}
export OPENBLAS_NUM_THREADS=1
if [ -d ${REPO_NAME} ];
then
cd ${REPO_NAME}
git reset --hard
git submodule init
git submodule update
else
git clone ${REPO_URL} ${REPO_NAME}
cd ${REPO_NAME}
git submodule init
git submodule update
fi
git checkout ${REPO_TAG}
cd ${CURRENT_DIR}
cmake -B ${REPO_BUILD} ${REPO_NAME} -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=${REPO_INSTALLED} ${EXTRA_OPTIONS}
make install -C ${REPO_BUILD} -j 5