Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
tpruvot
GitHub Repository: tpruvot/cpuminer-multi
Path: blob/linux/build.sh
1201 views
1
#!/bin/bash
2
3
if [ "$OS" = "Windows_NT" ]; then
4
./mingw64.sh
5
exit 0
6
fi
7
8
make clean || echo clean
9
10
rm -f config.status
11
./autogen.sh
12
13
if [[ "$OSTYPE" == "darwin"* ]]; then
14
./nomacro.pl
15
./configure \
16
CFLAGS="-march=native -O2 -Ofast -flto -DUSE_ASM -pg" \
17
--with-crypto=/usr/local/opt/openssl \
18
--with-curl=/usr/local/opt/curl
19
make -j4
20
strip cpuminer
21
exit 0
22
fi
23
24
# Linux build
25
26
# Ubuntu 10.04 (gcc 4.4)
27
# extracflags="-O3 -march=native -Wall -D_REENTRANT -funroll-loops -fvariable-expansion-in-unroller -fmerge-all-constants -fbranch-target-load-optimize2 -fsched2-use-superblocks -falign-loops=16 -falign-functions=16 -falign-jumps=16 -falign-labels=16"
28
29
# Debian 7.7 / Ubuntu 14.04 (gcc 4.7+)
30
extracflags="$extracflags -Ofast -flto -fuse-linker-plugin -ftree-loop-if-convert-stores"
31
32
if [ ! "0" = `cat /proc/cpuinfo | grep -c avx` ]; then
33
# march native doesn't always works, ex. some Pentium Gxxx (no avx)
34
extracflags="$extracflags -march=native"
35
fi
36
37
./configure --with-crypto --with-curl CFLAGS="-O2 $extracflags -DUSE_ASM -pg"
38
39
make -j 4
40
41
strip -s cpuminer
42
43