forked from jmellorcrummey/parallel-elfutils
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
177 lines (150 loc) · 7.05 KB
/
Makefile
File metadata and controls
177 lines (150 loc) · 7.05 KB
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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
#----------------------------------------------------------------------------
# get everything downloaded and built for the first time
#----------------------------------------------------------------------------
all: check
dl:
@if [ ! -e dyninst/CMakeLists.txt ]; then \
git submodule update --init dyninst; fi
@if [ ! -e elfutils/configure.ac ]; then \
git submodule update --init elfutils; fi
#----------------------------------------------------------------------------
# download valgrind, elfutils, boost, and dyninst
#
# warning:
# the download step may overwrite any changes you have made
# understand what you are doing before running this again
#----------------------------------------------------------------------------
INST = $(shell pwd)/install
XFLAGS = -O3 -g
VFLAGS = -I$(INST)/valgrind/include -I$(INST)/.. -include valc++.h
#----------------------------------------------------------------------------
# dyninst test harness for detecting races caused by libdw in elfutils
#----------------------------------------------------------------------------
check: dyninst-build hpctoolkit-build valgrind
$(MAKE) -j12 -C tests
prepare: dyninst-build hpctoolkit-build valgrind
$(MAKE) -j12 -C tests prep
view:
$(MAKE) -C tests view
batchdrd: prepare
sbatch cl_drd.sh
batchval: prepare
sbatch cl_val.sh
batchperf: prepare
sbatch cl_perf.sh $(VERSION)
batch: batchdrd batchval batchperf
#----------------------------------------------------------------------------
# dyninst
#----------------------------------------------------------------------------
dyninst-build: dl boost gcc elfutils-build
@mkdir -p build/dyninst install/dyninst
@cd build/dyninst && if [ ! -e Makefile ]; then cmake \
-DCMAKE_CXX_FLAGS="$(XFLAGS)" -DCMAKE_C_FLAGS="$(XFLAGS)" \
-DCMAKE_INSTALL_PREFIX=$(INST)/dyninst \
-DCMAKE_CXX_FLAGS="-DENABLE_VG_ANNOTATIONS" \
-DBoost_ROOT_DIR=$(INST)/boost \
-DElfUtils_ROOT_DIR=$(INST)/elfutils \
-DLibIberty_ROOT_DIR=$(INST)/gcc -DLibIberty_LIBRARYDIR=$(INST)/gcc/lib64 \
-DTBB_ROOT_DIR=/projects/comp522/jma14/tbb \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
../../dyninst; fi
$(MAKE) -j12 -C build/dyninst install
# -DBoost_NO_BOOST_CMAKE=ON -DBOOST_ROOT=$(INST)/boost -DBoost_NO_SYSTEM_PATHS=ON \
#----------------------------------------------------------------------------
# boost
#----------------------------------------------------------------------------
boost:
@mkdir -p install/boost download/
cd download && wget --no-check-certificate -N http://downloads.sourceforge.net/project/boost/boost/1.61.0/boost_1_61_0.zip
unzip -qo download/boost_1_61_0.zip
mv boost_1_61_0 boost
cd boost && ./bootstrap.sh
cd boost && ./b2 \
--with-system \
--with-thread \
--with-date_time \
--with-filesystem \
--with-timer \
--with-atomic \
--ignore-site-config \
--link=static \
--runtime-link=shared \
--layout=tagged \
--threading=multi \
--prefix=../install/boost -j 16 install
#----------------------------------------------------------------------------
# valgrind
#----------------------------------------------------------------------------
valgrind: boost
@mkdir -p install/valgrind download/
cd download && wget -N http://www.valgrind.org/downloads/valgrind-3.14.0.tar.bz2
tar xjf download/valgrind-3.14.0.tar.bz2
mv valgrind-3.14.0 valgrind
cd valgrind && CPPFLAGS="-I$(INST)/boost/include -L$(INST)/boost/lib" \
./configure --prefix=$(INST)/valgrind
cd valgrind && $(MAKE) -j 24 install
#----------------------------------------------------------------------------
# GCC (debugging GOMP and libiberty)
#----------------------------------------------------------------------------
gcc:
@mkdir -p install/gcc download/
cd download && wget -N ftp://ftp.mirrorservice.org/sites/sourceware.org/pub/gcc/releases/gcc-6.4.0/gcc-6.4.0.tar.xz
tar xJf download/gcc-6.4.0.tar.xz
mv gcc-6.4.0 gcc
cd gcc && ./contrib/download_prerequisites
cd gcc && CPPFLAGS='-g $(VFLAGS)' ./configure \
--prefix=$(INST)/gcc --disable-linux-futex --disable-multilib \
--disable-bootstrap --disable-libquadmath \
--disable-gcov --disable-libada --disable-libsanitizer \
--disable-libssp --disable-libquadmath-support \
--disable-libvtv --enable-install-libiberty
cd gcc && $(MAKE) -j12
cd gcc && $(MAKE) -j12 install
#----------------------------------------------------------------------------
# elfutils
#----------------------------------------------------------------------------
elfutils-build: dl
@mkdir -p build/elfutils install/elfutils
@cd elfutils && if [ ! -e config/missing ]; then \
autoreconf -i; fi
@cd build/elfutils && if [ ! -e Makefile ]; then \
../../elfutils/configure \
--enable-maintainer-mode \
--prefix=$(INST)/elfutils \
CFLAGS="$(XFLAGS)" \
INSTALL="$(shell which install) -C"; fi
$(MAKE) -j12 -C build/elfutils install
install -C elfutils/libelf/elf.h install/elfutils/include
#----------------------------------------------------------------------------
# hpctookit
#----------------------------------------------------------------------------
hpctoolkit-build: dyninst-build
@mkdir -p build/hpctoolkit install/hpctoolkit
@cd build/hpctoolkit && if [ ! -e Makefile ]; then \
../../hpctoolkit/configure \
--prefix=$(INST)/hpctoolkit/ \
--enable-debug \
--with-binutils=/projects/comp522/jma14/spack/opt/spack/linux-rhel6-x86_64/gcc-6.4.0/binutils-2.31.1-kqv3rcglalogtk6z2goadv7efp3ttxsp \
--with-boost=$(INST)/boost/ \
--with-bzip=/projects/comp522/jma14/spack/opt/spack/linux-rhel6-x86_64/gcc-6.4.0/bzip2-1.0.6-4m2m7tcemnvq2sdm6nvodvyvndpj3d44 \
--with-dyninst=$(INST)/dyninst/ \
--with-elfutils=$(INST)/elfutils/ \
--with-tbb=/projects/comp522/jma14/tbb \
--with-libdwarf=/projects/comp522/jma14/spack/opt/spack/linux-rhel6-x86_64/gcc-6.4.0/libdwarf-20180129-hpfkxw2gbnkbyqz6cwbjecgorb75s6fc \
--with-libmonitor=/projects/comp522/jma14/spack/opt/spack/linux-rhel6-x86_64/gcc-6.4.0/libmonitor-2018.07.18-ampjrd3icqcmnhrcnitag3cpqjotjtfi \
--with-libunwind=/projects/comp522/jma14/spack/opt/spack/linux-rhel6-x86_64/gcc-6.4.0/libunwind-2018.10.12-szyxqpyaumq7djnkols36utxgsbc3qf5 \
--with-xerces=/projects/comp522/jma14/spack/opt/spack/linux-rhel6-x86_64/gcc-6.4.0/xerces-c-3.2.2-jvn3zwe3y226fqxiyzstqahpb57szire \
--with-lzma=/projects/comp522/jma14/spack/opt/spack/linux-rhel6-x86_64/gcc-6.4.0/xz-5.2.4-42sbhepxxh3yowggil26r476nz7ixcog \
--with-zlib=/projects/comp522/jma14/spack/opt/spack/linux-rhel6-x86_64/gcc-6.4.0/zlib-1.2.11-l2f3fdpy5urpxsr4prw765g3veaux3og \
CFLAGS="$(VFLAGS)" \
LDFLAGS="-L$(INST)/gcc/lib64 -lgomp" \
--with-xed=/projects/comp522/jma14/spack/opt/spack/linux-rhel6-x86_64/gcc-6.4.0/intel-xed-2018.02.14-hk2unjcjkxmb4ykx7oxb3qnszrb2fxaw \
--with-perfmon=/projects/comp522/jma14/spack/opt/spack/linux-rhel6-x86_64/gcc-6.4.0/libpfm4-4.10.1-fs4zdgcohg7qovbsbiz22fs22gq5cjdr \
INSTALL="$(shell which install) -C"; fi
make -j12 -C build/hpctoolkit install
#----------------------------------------------------------------------------
# maintenance
#----------------------------------------------------------------------------
distclean:
rm -rf boost
rm -rf valgrind