-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinitMakefile.extern
executable file
·126 lines (108 loc) · 5.42 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
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
#!/usr/bin/python
##//////////////////////////////////////////////////////////////////////////////
## Copyright (c) 2013, Lawrence Livermore National Security, LLC.
## Produced at the Lawrence Livermore National Laboratory.
## Written by the Greg Bronevetsky <bronevetsky1@llnl.gov> / <greg@bronevetsky.com>.
##
## LLNL-CODE-642002
## All rights reserved.
##
## This file is part of Sight. For details, see https://e-reports-ext.llnl.gov/pdf/781752.pdf or
## https://github.com/bronevet/sight.
##
## Licensed under the GNU Lesser General Public License (Lesser GPU) Version 2.1,
## February 1999; you may not use this file except in compliance with the License.
## The full licence is included in file LICENCE and you may obtain a copy of the
## License at:
## https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html
##
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an "AS IS" BASIS,
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
## implied. See the License for the specific language governing
## permissions and limitations under the license.
##//////////////////////////////////////////////////////////////////////////////
import sys
import os
curDir = os.path.dirname(os.path.realpath(__file__));
if(len(sys.argv) != 6 and len(sys.argv) != 9) :
sys.exit("Usage: initMakefile.extern CC CCC MPICC MPICCC RAPL_ENABLED LLVM32_SRC_PATH LLVM32_BUILD_PATH LLVM32_INSTALL_PATH");
CC = sys.argv[1];
CCC = sys.argv[2];
MPICC = sys.argv[3];
MPICCC = sys.argv[4];
RAPL_ENABLED = int(sys.argv[5]);
if(len(sys.argv)==9) :
LLVM32_SRC_PATH = sys.argv[6]
LLVM32_BUILD_PATH = sys.argv[7]
LLVM32_INSTALL_PATH = sys.argv[8]
f = open('Makefile.extern', 'w')
f.write("ROOT_PATH = "+curDir+"\n");
f.write("""SIGHT_CFLAGS = -I${ROOT_PATH} -I${ROOT_PATH}/widgets -I${ROOT_PATH}/widgets/parallel \\
-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""");
if(int(RAPL_ENABLED)==1) :
f.write(""" \\
-L${ROOT_PATH}/widgets/libmsr/lib -lmsr""");
f.write(""" \\
-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");
f.write("MPICC = "+MPICC+"\n");
f.write("MPICCC = "+MPICCC+"\n");
if(len(sys.argv)==7) :
f.write("\n")
f.write("LLVM32_SRC_PATH = "+LLVM32_SRC_PATH+"\n")
f.write("LLVM32_BUILD_PATH = "+LLVM32_BUILD_PATH+"\n")
f.write("LLVM32_INSTALL_PATH = "+LLVM32_INSTALL_PATH+"\n")