forked from CMS-HGCAL/rpi-daq
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
80 lines (59 loc) · 2.46 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
# https://gist.github.com/fm4dd/c663217935dc17f0fc73c9c81b0aa845
# 100 ev in 10.5s
#MYCFLAGS= -O2 -mtune=cortex-a53 -mcpu=cortex-a53 -mfloat-abi=hard -mfpu=neon-fp-armv8 -mneon-for-64bits
# 100 ev in 10.4s
#MYCFLAGS= -O3 -mtune=cortex-a53 -mcpu=cortex-a53 -mfloat-abi=hard -mfpu=neon-fp-armv8 -mneon-for-64bits
# 100 ev in 12.0s
#MYCFLAGS= -O0
# 100 ev in 10.7s
#MYCFLAGS= -O2
# 100 ev in 10.6s
#MYCFLAGS= -O1
# 100 ev in 10.6s
MYCFLAGS= -Os -mcpu=cortex-a53 -mtune=cortex-a53
# 100 ev in 10.7s
#MYCFLAGS = -O3 -mcpu=cortex-a53 -mtune=cortex-a53
# Benchmarking command
# make distclean; make benchmark
all: lib/libgpiohb.so
src/gpiohb.o: src/gpiohb.c lib/libbcm2835.so src/data_addr_utils.h
g++ -Wall -c -I ./src/bcm2835/src -L ./lib -fPIC $(MYCFLAGS) $< -o $@
lib/libgpiohb.so: src/gpiohb.o
mkdir -p lib
g++ -shared $< -o $@
lib/libbcm2835.so: src/bcm2835/src/bcm2835.o
mkdir -p lib
gcc -shared $< -o $@
src/bcm2835/src/bcm2835.o: src/bcm2835/src/bcm2835.c
make -C src/bcm2835
src/bcm2835/src/bcm2835.c:
if ! dpkg -l | grep html-xml-utils -c >>/dev/null; then sudo apt-get --yes install html-xml-utils; fi
mkdir -p src/bcm2835
wget -qO - `curl -sL http://www.airspayce.com/mikem/bcm2835 | hxnormalize -x -e | hxselect -s '\n' -c "div.textblock>p:nth-child(4)>a:nth-child(1)"` | tar xz --strip-components=1 -C src/bcm2835
cd src/bcm2835 && (./configure CFLAGS=" -fPIC $(MYCFLAGS)")
.PHONY: distclean clean packages testrun
packages:
if ! dpkg -l | grep python-bitarray -c >>/dev/null; then sudo apt-get --yes install python-bitarray; fi
if ! dpkg -l | grep python-yaml -c >>/dev/null; then sudo apt-get --yes install python-yaml; fi
if ! dpkg -l | grep python-zmq -c >>/dev/null; then sudo apt-get --yes install python-zmq; fi
clean:
rm -rf lib/*
rm -f src/*.o
rm -f ./*.pyc
if [ -e src/bcm2835/src ]; then make -C src/bcm2835 clean; fi;
distclean: clean
rm -rf lib
rm -rf src/bcm2835
@find ./ $(RCS_FIND_IGNORE) \
\( -name '*.orig' -o -name '*.rej' -o -name '*~' \
-o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
-o -name '.*.rej' -o -size 0 \
-o -name '*%' -o -name '.*.cmd' -o -name 'core' \) \
-type f -print | xargs rm -f
testrun: all
python run_local.py --externalChargeInjection --channelIds=30 --acquisitionType=const_inj --injectionDAC=3000 --dataNotSaved --showRawData
testfifo: all
python test_fifo.py
benchmark: all
@echo "Timing the default acquisition"
bash -c "time (python run_local.py --dataNotSaved > /dev/null)"