forked from bronevet/old_sight
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinitMakefile.extern
executable file
·82 lines (69 loc) · 3.58 KB
/
initMakefile.extern
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
#!/usr/bin/python
import sys
import os
curDir = os.path.dirname(os.path.realpath(__file__));
if(len(sys.argv) != 4) :
sys.exit("Usage: initMakefile.extern CC CCC RAPL_ENABLED");
CC = sys.argv[1];
CCC = sys.argv[2];
RAPL_ENABLED = sys.argv[3];
f = open('Makefile.extern', 'w')
f.write("ROOT_PATH = "+curDir+"\n");
f.write("""SIGHT_CFLAGS = -I${ROOT_PATH} \\
-I${ROOT_PATH}/tools/callpath/src -I${ROOT_PATH}/tools/adept-utils/include \\
-I${ROOT_PATH}/widgets/papi/include\\
-I${ROOT_PATH}/widgets/libmsr/include\n""");
f.write("""SIGHT_LINKFLAGS_NORPATH = -L${ROOT_PATH} -lsight_structure \\
-L${ROOT_PATH}/tools/adept-utils/lib -ladept_cutils -ladept_timing -ladept_utils \\
-L${ROOT_PATH}/tools/callpath/src/src -lcallpath \\
-L${ROOT_PATH}/widgets/papi/lib -lpapi \\
-L${ROOT_PATH}/widgets/gsl/lib -lgsl -lgslcblas \\
-L${ROOT_PATH}/widgets/libmsr/lib -lmsr \\
-lpthread\n""");
f.write("""SIGHT_LINKFLAGS = \\
-Wl,-rpath ${ROOT_PATH} \\
-L${ROOT_PATH} -lsight_structure \\
-L${ROOT_PATH}/tools/adept-utils/lib -ladept_cutils -ladept_timing -ladept_utils \\
-Wl,-rpath ${ROOT_PATH}/tools/adept-utils/lib \\
-L${ROOT_PATH}/tools/callpath/src/src -lcallpath \\
-Wl,-rpath ${ROOT_PATH}/tools/callpath/src/src \\
-L${ROOT_PATH}/widgets/papi/lib -lpapi \\
-Wl,-rpath ${ROOT_PATH}/widgets/papi/lib \\
${ROOT_PATH}/widgets/gsl/lib/libgsl.so \\
${ROOT_PATH}/widgets/gsl/lib/libgslcblas.so \\
-Wl,-rpath ${ROOT_PATH}/widgets/gsl/lib""");
if(int(RAPL_ENABLED)==1) :
f.write(""" \\
${ROOT_PATH}/widgets/libmsr/lib/libmsr.so \\
-Wl,-rpath ${ROOT_PATH}/widgets/libmsr/lib""");
f.write(""" \\
-lpthread\n""");
f.write("""
# Flags to use when linking a version of slayout that include object files
# for additional widgets and capabilities
# Dynamic linking
SIGHT_LAYOUT_DYNAMIC_LINKFLAGS = \\
-Wl,-rpath ${ROOT_PATH} \\
${ROOT_PATH}/libsight_layout.so \\
-Wl,-rpath ${ROOT_PATH}/widgets/gsl/lib -L${ROOT_PATH}/widgets/gsl/lib -lgsl -lgslcblas \\
${ROOT_PATH}/tools/adept-utils/lib/libadept_cutils.so \\
${ROOT_PATH}/tools/adept-utils/lib/libadept_timing.so \\
${ROOT_PATH}/tools/adept-utils/lib/libadept_utils.so \\
-Wl,-rpath ${ROOT_PATH}/tools/adept-utils/lib \\
${ROOT_PATH}/tools/callpath/src/src/libcallpath.so \\
-Wl,-rpath ${ROOT_PATH}/tools/callpath/src/src \\
${ROOT_PATH}/widgets/papi/lib/libpapi.a \\
-lpthread\n""");
## Static linking
#SIGHT_LAYOUT_STATIC_LINKFLAGS = \\
# -Wl,--whole-archive ${ROOT_PATH} libsight_layout.a -Wl,-no-whole-archive \\
# ${ROOT_PATH}/tools/adept-utils/lib/libadept_cutils.so \\
# ${ROOT_PATH}/tools/adept-utils/lib/libadept_timing.so \\
# ${ROOT_PATH}/tools/adept-utils/lib/libadept_utils.so \\
# -Wl,-rpath ${ROOT_PATH}/tools/adept-utils/lib \\
# ${ROOT_PATH}/tools/callpath/src/src/libcallpath.so \\
# -Wl,-rpath ${ROOT_PATH}/tools/callpath/src/src \\
# ${ROOT_PATH}/widgets/papi/lib/libpapi.a \\
# -lpthread
f.write("CC = "+CC+"\n");
f.write("CCC = "+CCC+"\n");