forked from Honda39/cpuminer-gr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·42 lines (32 loc) · 1.12 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
rm -v build.log 2>/dev/null
make distclean | tee build.log
rm -f config.status | tee -a build.log
./autogen.sh | tee -a build.log
ARCH=""
MFPU=""
if [[ $(uname -m) =~ "armv7" ]]; then
if [[ $(uname -m) != "armv7l" ]]; then
echo "Detected unknown ARMv7 processor $(uname -m)" | tee -a build.log
fi
echo "Detected ARMv7 (arm) system" | tee -a build.log
ARCH="armv7-a"
if [[ ! -z "$(cat /proc/cpuinfo | grep "vfpv4")" ]]; then
echo "Detected vfpv4 instruction set. Changing to -mfpu=neon-vfpv4" | tee -a build.log
MFPU="-mfpu=neon-vfpv4"
else
echo $(cat /proc/cpuinfo | grep "vfpv4") | tee -a build.log
echo "Using default -mfpu=neon" | tee -a build.log
MFPU="-mfpu=neon"
fi
elif [[ $(uname -m) =~ "aarch64" ]]; then
echo "Detected ARMv8 (aarch64) system" | tee -a build.log
ARCH="armv8-a+simd"
else
echo "Architecture $(uname -m). Compile as native" | tee -a build.log
ARCH="native"
MFPU=""
fi
CFLAGS="-O3 -march=${ARCH} ${MFPU} -mtune=native" CXXFLAGS="$CFLAGS -std=c++11" ./configure --with-curl | tee -a build.log
make -j 4 | tee -a build.log
strip -s cpuminer | tee -a build.log