forked from bronevet/sight
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinitDefinitionsH
More file actions
executable file
·41 lines (35 loc) · 1.56 KB
/
Copy pathinitDefinitionsH
File metadata and controls
executable file
·41 lines (35 loc) · 1.56 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
#!/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) != 2) :
sys.exit("Usage: initDefinitionsH RAPL_ENABLED");
RAPL_ENABLED = int(sys.argv[1]);
with open('definitions.h', 'w') as f:
f.write("#pragma once\n");
f.write("#define SIGHT_ROOT_PATH \""+curDir+"\"\n");
if(RAPL_ENABLED) :
f.write("#define RAPL\n")