Created
March 28, 2018 14:06
-
-
Save martin-steinegger/f36ad869462c984542c5806c9ea0beee to your computer and use it in GitHub Desktop.
build.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
export CC=gcc | |
export CXX=g++ | |
cat <<'CPUDOC' | $CC -std=gnu99 -o "testcpu" -xc - | |
#include <stdio.h> | |
#define D(x) __builtin_cpu_supports((x))?(x) | |
int main(){puts(D("avx2"):D("sse4.1"):"fail");} | |
CPUDOC | |
if [ "$(./testcpu)" = "fail" ]; then | |
echo "CPU is not supported" | |
exit 1 | |
fi | |
mkdir build | |
cd build | |
cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DHAVE_TESTS=0 -DHAVE_MPI=0 -DHAVE_SSE4_1=1 -DVERSION_OVERRIDE="${PKG_VERSION}" .. | |
make -j 2 | |
make install |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment