forked from lucasjones/cpuminer-multi
-
Notifications
You must be signed in to change notification settings - Fork 697
/
build-linux-arm.sh
executable file
·63 lines (48 loc) · 1.6 KB
/
build-linux-arm.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/bash
# Linux build, optimised for ARM devices
if [ ! -e configure ]; then
echo "Creating configure..."
rm -rf autom4te.cache
rm -f Makefile.in aclocal.m4 autom4te.cache compat/Makefile.in
rm -f compile config.guess config.sub config.status configure
rm -f cpuminer-config.h.in depcomp install-sh missing
if ./autogen.sh; then
echo " => done."
else
exit 1
fi
fi
if [ -e Makefile ]; then
echo "Cleaning previous build..."
make distclean
echo " => done."
fi
echo "Configuring..."
# --disable-assembly: some ASM code doesn't build on ARM
# Note: we don't enable -flto, it doesn't bring anything here but slows down
# the build a lot. If needed, just add -flto to the CFLAGS string.
# normal build.
./configure --with-crypto --with-curl --disable-assembly CC=gcc CXX=g++ CFLAGS="-Ofast -fuse-linker-plugin -ftree-loop-if-convert-stores -march=native" LDFLAGS="-march=native"
# debug build
#./configure --with-crypto --with-curl --disable-assembly CC=gcc CXX=g++ CFLAGS="-O0 -g3 -fuse-linker-plugin -ftree-loop-if-convert-stores -march=native" LDFLAGS="-g3 -march=native"
[ $? = 0 ] || exit $?
echo " => done."
if [ -z "$NPROC" ]; then
NPROC=$(nproc 2>/dev/null)
NPROC=${NPROC:-1}
fi
echo "Compiling on $NPROC processes..."
make -j $NPROC
if [ $? != 0 ]; then
echo "Compilation failed (make=$?)".
echo "Common causes: missing libjansson-dev libcurl4-openssl-dev libssl-dev"
echo "If you pulled updates into this directory, remove configure and try again."
exit 1
fi
echo " => done."
echo '$ ls -l cpuminer'
ls -l cpuminer
echo "Stripping..."
strip -s cpuminer
[ $? = 0 ] || exit $?
echo " => done."