-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
147 lines (123 loc) · 2.84 KB
/
Makefile
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# GMP
GMP:=gmp-6.3.0
GMPx:=tar.gz
# MPFR
MPFR:=mpfr-4.2.1
MPFRx:=tar.gz
# Flint
FLINT:=flint-3.1.3
FLINTx:=tar.gz
# XMalloc
XMALLOC:=jemalloc-5.3.0 # mimalloc-2.1.4 | gperftools-2.10
XMALLOCx:=tar.bz2
ifeq ($(strip $(MALLOC)),)
MALLOC:=-ljemalloc # -lmimalloc | -ltcmalloc
endif
ifeq ($(strip $(USR_DIR)),)
USR_DIR:=$(PWD)/usr
endif
ifeq ($(strip $(USR_DIR)),)
USR_DIR:=$(shell pwd)/usr
endif
export MALLOC USR_DIR
defalut: oM oQ oF oP
oM:
$(MAKE) -C M
oQ:
$(MAKE) -C Q
oF:
$(MAKE) -C F
oP:
$(MAKE) -C P
cleanall: clean cleanexe cleandepall
clean: cleandep
$(MAKE) clean -C M
$(MAKE) clean -C Q
$(MAKE) clean -C F
$(MAKE) clean -C P
cleanexe:
rm -f M/FIRE
rm -f Q/FIRE
rm -f F/FIRE
rm -f P/FIRE
tgz:
/bin/rm -rf FIREs FIREs.tar.gz; \
mkdir FIREs; \
cp -r src M Q F P Makefile usr usr-src examples FIREs/; \
make cleanall -C FIREs; \
/bin/rm -f FIREs/.DS_Store FIREs/*/.DS_Store FIREs/*/*/.DS_Store FIREs/*/*/*/.DS_Store;\
gtar cfz FIREs.tar.gz FIREs; \
/bin/rm -rf FIREs
test:
cd examples/box; \
./run.sh; \
cd ../doublebox; \
./run.sh; \
cd ../v2; \
./run.sh
UNAME_S:=$(shell uname -s)
ifeq ($(UNAME_S),Darwin)
ASIE = AS_INTEGRATED_ASSEMBLER=1
else
ASIE =
endif
UNAME_M:=$(shell uname -m)
ifeq ($(UNAME_M),arm64) # Apple Silicon Chip
#===============================================
dep:
cd usr-src; \
tar xf $(strip $(FLINT)).$(FLINTx); \
tar xf $(strip $(XMALLOC)).$(XMALLOCx);
cd usr-src/$(FLINT); \
./bootstrap.sh; \
./configure --disable-static --with-gmp=/opt/homebrew --with-mpfr=/opt/homebrew --prefix=$(USR_DIR) CFLAGS="-O3"; \
$(MAKE) install
cd usr-src/$(XMALLOC); \
./configure --prefix=$(USR_DIR); \
$(MAKE) install
cleandepall: cleandep
rm -rf usr/include/*
rm -rf usr/lib/*
rm -rf usr/share/*
rm -rf usr/lib64
rm -rf usr/bin/*
cd usr && ln -s lib lib64
cleandep:
rm -rf usr-src/$(FLINT)
rm -rf usr-src/$(XMALLOC)
#===============================================
else
#===============================================
dep:
cd usr-src; \
tar xf $(strip $(GMP)).$(GMPx); \
tar xf $(strip $(MPFR)).$(MPFRx); \
tar xf $(strip $(FLINT)).$(FLINTx); \
tar xf $(strip $(XMALLOC)).$(XMALLOCx);
cd usr-src/$(GMP);\
./configure --enable-cxx --prefix=$(USR_DIR); \
$(MAKE) install
cd usr-src/$(MPFR); \
./configure --with-gmp=$(USR_DIR) --prefix=$(USR_DIR); \
$(MAKE) install
cd usr-src/$(FLINT); \
./bootstrap.sh; \
./configure --disable-static --enable-avx2 --with-gmp=$(USR_DIR) --with-mpfr=$(USR_DIR) --prefix=$(USR_DIR) CFLAGS="-O3"; \
$(MAKE) install
cd usr-src/$(XMALLOC); \
./configure --prefix=$(USR_DIR); \
$(MAKE) install
cleandep:
rm -rf usr-src/$(GMP)
rm -rf usr-src/$(MPFR)
rm -rf usr-src/$(FLINT)
rm -rf usr-src/$(XMALLOC)
cleandepall: cleandep
rm -rf usr/include/*
rm -rf usr/lib/*
rm -rf usr/share/*
rm -rf usr/lib64
rm -rf usr/bin/*
cd usr && ln -s lib lib64
#===============================================
endif