Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
litecoincash-project
GitHub Repository: litecoincash-project/cpuminer-multi
Path: blob/master/build-linux-arm.sh
548 views
1
#!/bin/bash
2
3
# Linux build, optimised for ARM devices
4
5
if [ ! -e configure ]; then
6
echo "Creating configure..."
7
rm -rf autom4te.cache
8
rm -f Makefile.in aclocal.m4 autom4te.cache compat/Makefile.in
9
rm -f compile config.guess config.sub config.status configure
10
rm -f cpuminer-config.h.in depcomp install-sh missing
11
if ./autogen.sh; then
12
echo " => done."
13
else
14
exit 1
15
fi
16
fi
17
18
if [ -e Makefile ]; then
19
echo "Cleaning previous build..."
20
make distclean
21
echo " => done."
22
fi
23
24
echo "Configuring..."
25
26
# --disable-assembly: some ASM code doesn't build on ARM
27
# Note: we don't enable -flto, it doesn't bring anything here but slows down
28
# the build a lot. If needed, just add -flto to the CFLAGS string.
29
# normal build.
30
./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"
31
32
# debug build
33
#./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"
34
35
[ $? = 0 ] || exit $?
36
echo " => done."
37
38
if [ -z "$NPROC" ]; then
39
NPROC=$(nproc 2>/dev/null)
40
NPROC=${NPROC:-1}
41
fi
42
43
echo "Compiling on $NPROC processes..."
44
45
make -j $NPROC
46
47
if [ $? != 0 ]; then
48
echo "Compilation failed (make=$?)".
49
echo "Common causes: missing libjansson-dev libcurl4-openssl-dev libssl-dev"
50
echo "If you pulled updates into this directory, remove configure and try again."
51
exit 1
52
fi
53
echo " => done."
54
55
echo '$ ls -l cpuminer'
56
ls -l cpuminer
57
58
echo "Stripping..."
59
60
strip -s cpuminer
61
62
[ $? = 0 ] || exit $?
63
echo " => done."
64
65