siliconcompiler 0.34.2__py3-none-any.whl → 0.34.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. siliconcompiler/__init__.py +12 -5
  2. siliconcompiler/__main__.py +1 -7
  3. siliconcompiler/_metadata.py +1 -1
  4. siliconcompiler/apps/_common.py +104 -23
  5. siliconcompiler/apps/sc.py +4 -8
  6. siliconcompiler/apps/sc_dashboard.py +6 -4
  7. siliconcompiler/apps/sc_install.py +10 -6
  8. siliconcompiler/apps/sc_issue.py +7 -5
  9. siliconcompiler/apps/sc_remote.py +1 -1
  10. siliconcompiler/apps/sc_server.py +9 -14
  11. siliconcompiler/apps/sc_show.py +6 -5
  12. siliconcompiler/apps/smake.py +130 -94
  13. siliconcompiler/apps/utils/replay.py +4 -7
  14. siliconcompiler/apps/utils/summarize.py +3 -5
  15. siliconcompiler/asic.py +420 -0
  16. siliconcompiler/checklist.py +25 -2
  17. siliconcompiler/cmdlineschema.py +534 -0
  18. siliconcompiler/constraints/asic_component.py +2 -2
  19. siliconcompiler/constraints/asic_pins.py +2 -2
  20. siliconcompiler/constraints/asic_timing.py +3 -3
  21. siliconcompiler/core.py +7 -32
  22. siliconcompiler/data/templates/tcl/manifest.tcl.j2 +8 -0
  23. siliconcompiler/dependencyschema.py +89 -31
  24. siliconcompiler/design.py +176 -207
  25. siliconcompiler/filesetschema.py +250 -0
  26. siliconcompiler/flowgraph.py +274 -95
  27. siliconcompiler/fpga.py +124 -1
  28. siliconcompiler/library.py +218 -20
  29. siliconcompiler/metric.py +233 -20
  30. siliconcompiler/package/__init__.py +271 -50
  31. siliconcompiler/package/git.py +92 -16
  32. siliconcompiler/package/github.py +108 -12
  33. siliconcompiler/package/https.py +79 -16
  34. siliconcompiler/packageschema.py +88 -7
  35. siliconcompiler/pathschema.py +31 -2
  36. siliconcompiler/pdk.py +566 -1
  37. siliconcompiler/project.py +1095 -94
  38. siliconcompiler/record.py +38 -1
  39. siliconcompiler/remote/__init__.py +5 -2
  40. siliconcompiler/remote/client.py +11 -6
  41. siliconcompiler/remote/schema.py +5 -23
  42. siliconcompiler/remote/server.py +41 -54
  43. siliconcompiler/report/__init__.py +3 -3
  44. siliconcompiler/report/dashboard/__init__.py +48 -14
  45. siliconcompiler/report/dashboard/cli/__init__.py +99 -21
  46. siliconcompiler/report/dashboard/cli/board.py +364 -179
  47. siliconcompiler/report/dashboard/web/__init__.py +90 -12
  48. siliconcompiler/report/dashboard/web/components/__init__.py +219 -240
  49. siliconcompiler/report/dashboard/web/components/flowgraph.py +49 -26
  50. siliconcompiler/report/dashboard/web/components/graph.py +139 -100
  51. siliconcompiler/report/dashboard/web/layouts/__init__.py +29 -1
  52. siliconcompiler/report/dashboard/web/layouts/_common.py +38 -2
  53. siliconcompiler/report/dashboard/web/layouts/vertical_flowgraph.py +39 -26
  54. siliconcompiler/report/dashboard/web/layouts/vertical_flowgraph_node_tab.py +50 -50
  55. siliconcompiler/report/dashboard/web/layouts/vertical_flowgraph_sac_tabs.py +49 -46
  56. siliconcompiler/report/dashboard/web/state.py +141 -14
  57. siliconcompiler/report/dashboard/web/utils/__init__.py +79 -16
  58. siliconcompiler/report/dashboard/web/utils/file_utils.py +74 -11
  59. siliconcompiler/report/dashboard/web/viewer.py +25 -1
  60. siliconcompiler/report/report.py +5 -2
  61. siliconcompiler/report/summary_image.py +29 -11
  62. siliconcompiler/scheduler/__init__.py +9 -1
  63. siliconcompiler/scheduler/docker.py +79 -1
  64. siliconcompiler/scheduler/run_node.py +35 -19
  65. siliconcompiler/scheduler/scheduler.py +208 -24
  66. siliconcompiler/scheduler/schedulernode.py +372 -46
  67. siliconcompiler/scheduler/send_messages.py +77 -29
  68. siliconcompiler/scheduler/slurm.py +76 -12
  69. siliconcompiler/scheduler/taskscheduler.py +140 -20
  70. siliconcompiler/schema/__init__.py +0 -2
  71. siliconcompiler/schema/baseschema.py +194 -38
  72. siliconcompiler/schema/journal.py +7 -4
  73. siliconcompiler/schema/namedschema.py +16 -10
  74. siliconcompiler/schema/parameter.py +55 -9
  75. siliconcompiler/schema/parametervalue.py +60 -0
  76. siliconcompiler/schema/safeschema.py +25 -2
  77. siliconcompiler/schema/schema_cfg.py +5 -5
  78. siliconcompiler/schema/utils.py +2 -2
  79. siliconcompiler/schema_obj.py +20 -3
  80. siliconcompiler/tool.py +979 -302
  81. siliconcompiler/tools/bambu/__init__.py +41 -0
  82. siliconcompiler/tools/builtin/concatenate.py +2 -2
  83. siliconcompiler/tools/builtin/minimum.py +2 -1
  84. siliconcompiler/tools/builtin/mux.py +2 -1
  85. siliconcompiler/tools/builtin/nop.py +2 -1
  86. siliconcompiler/tools/builtin/verify.py +2 -1
  87. siliconcompiler/tools/klayout/__init__.py +95 -0
  88. siliconcompiler/tools/openroad/__init__.py +289 -0
  89. siliconcompiler/tools/openroad/scripts/apr/preamble.tcl +3 -0
  90. siliconcompiler/tools/openroad/scripts/apr/sc_detailed_route.tcl +7 -2
  91. siliconcompiler/tools/openroad/scripts/apr/sc_global_route.tcl +8 -4
  92. siliconcompiler/tools/openroad/scripts/apr/sc_init_floorplan.tcl +9 -5
  93. siliconcompiler/tools/openroad/scripts/common/write_images.tcl +5 -1
  94. siliconcompiler/tools/slang/__init__.py +1 -1
  95. siliconcompiler/tools/slang/elaborate.py +2 -1
  96. siliconcompiler/tools/vivado/scripts/sc_run.tcl +1 -1
  97. siliconcompiler/tools/vivado/scripts/sc_syn_fpga.tcl +8 -1
  98. siliconcompiler/tools/vivado/syn_fpga.py +6 -0
  99. siliconcompiler/tools/vivado/vivado.py +35 -2
  100. siliconcompiler/tools/vpr/__init__.py +150 -0
  101. siliconcompiler/tools/yosys/__init__.py +369 -1
  102. siliconcompiler/tools/yosys/scripts/procs.tcl +0 -1
  103. siliconcompiler/toolscripts/_tools.json +5 -10
  104. siliconcompiler/utils/__init__.py +66 -0
  105. siliconcompiler/utils/flowgraph.py +2 -2
  106. siliconcompiler/utils/issue.py +2 -1
  107. siliconcompiler/utils/logging.py +14 -0
  108. siliconcompiler/utils/multiprocessing.py +256 -0
  109. siliconcompiler/utils/showtools.py +10 -0
  110. {siliconcompiler-0.34.2.dist-info → siliconcompiler-0.34.3.dist-info}/METADATA +5 -5
  111. {siliconcompiler-0.34.2.dist-info → siliconcompiler-0.34.3.dist-info}/RECORD +115 -118
  112. {siliconcompiler-0.34.2.dist-info → siliconcompiler-0.34.3.dist-info}/entry_points.txt +3 -0
  113. siliconcompiler/schema/cmdlineschema.py +0 -250
  114. siliconcompiler/toolscripts/rhel8/install-slang.sh +0 -40
  115. siliconcompiler/toolscripts/rhel9/install-slang.sh +0 -40
  116. siliconcompiler/toolscripts/ubuntu20/install-slang.sh +0 -47
  117. siliconcompiler/toolscripts/ubuntu22/install-slang.sh +0 -37
  118. siliconcompiler/toolscripts/ubuntu24/install-slang.sh +0 -37
  119. {siliconcompiler-0.34.2.dist-info → siliconcompiler-0.34.3.dist-info}/WHEEL +0 -0
  120. {siliconcompiler-0.34.2.dist-info → siliconcompiler-0.34.3.dist-info}/licenses/LICENSE +0 -0
  121. {siliconcompiler-0.34.2.dist-info → siliconcompiler-0.34.3.dist-info}/top_level.txt +0 -0
@@ -1,250 +0,0 @@
1
- import argparse
2
- import re
3
- import sys
4
-
5
-
6
- class CommandLineSchema:
7
- '''
8
- Class to provide the :meth:`create_cmdline` option to a schema object.
9
-
10
- This class should not be instantiated by itself.
11
-
12
- Examples:
13
- class NewSchema(BaseSchema, CommandLineSchema):
14
- creates a new class with the commandline options available
15
- '''
16
-
17
- ###########################################################################
18
- def create_cmdline(self,
19
- progname,
20
- description=None,
21
- switchlist=None,
22
- additional_args=None,
23
- version=None,
24
- print_banner=None,
25
- input_map_handler=None,
26
- preprocess_keys=None,
27
- post_process=None,
28
- logger=None):
29
- """Creates a Schema command line interface.
30
-
31
- Exposes parameters in the SC schema as command line switches,
32
- simplifying creation of SC apps with a restricted set of schema
33
- parameters exposed at the command line. The order of command
34
- line switch settings parsed from the command line is as follows:
35
-
36
- 1. loglevel, if available in schema
37
- 2. read_manifest([cfg]), if available in schema
38
- 3. read inputs with input_map_handler
39
- 4. all other switches
40
- 5. Run post_process
41
-
42
- The cmdline interface is implemented using the Python argparse package
43
- and the following use restrictions apply.
44
-
45
- * Help is accessed with the '-h' switch.
46
- * Arguments that include spaces must be enclosed with double quotes.
47
- * List parameters are entered individually. (ie. -y libdir1 -y libdir2)
48
- * For parameters with Boolean types, the switch implies "true".
49
- * Special characters (such as '-') must be enclosed in double quotes.
50
- * Compiler compatible switches include: -D, -I, -O{0,1,2,3}
51
- * Legacy switch formats are supported: +libext+, +incdir+
52
-
53
- Args:
54
- progname (str): Name of program to be executed.
55
- description (str): Short program description.
56
- switchlist (list of str): List of SC parameter switches to expose
57
- at the command line. By default all SC schema switches are
58
- available. Parameter switches should be entered based on the
59
- parameter 'switch' field in the schema. For parameters with
60
- multiple switches, both will be accepted if any one is included
61
- in this list.
62
- input_map (dict of str): Dictionary mapping file extensions to input
63
- filetypes. This is used to automatically assign positional
64
- source arguments to ['input', 'fileset', ...] keypaths based on their file
65
- extension. If None, the CLI will not accept positional source
66
- arguments.
67
- additional_args (dict of dict): Dictionary of extra arguments to add
68
- to the command line parser, with the arguments matching the
69
- argparse.add_argument() call.
70
- version (str): Version to report when calling with -version
71
- print_banner (function): Function callback to print command line banner
72
- input_map_handler (function): Function callback handle inputs to the input map
73
- preprocess_keys (function): Function callback to preprocess keys that need to be
74
- corrected
75
- post_process (function): Function callback to process arguments before returning
76
-
77
- Returns:
78
- None if additional_args is not provided, otherwise a dictionary with the
79
- command line options detected from the additional_args
80
-
81
- Examples:
82
- >>> schema.create_cmdline(progname='sc-show',switchlist=['-input','-cfg'])
83
- Creates a command line interface for 'sc-show' app.
84
- >>> schema.create_cmdline(progname='sc', input_map={'v': ('rtl', 'verilog')})
85
- All sources ending in .v will be stored in ['input', 'rtl', 'verilog']
86
- >>> extra = schema.create_cmdline(progname='sc',
87
- additional_args={'-demo': {'action': 'store_true'}})
88
- Returns extra = {'demo': False/True}
89
- """
90
-
91
- # Argparse
92
- parser = argparse.ArgumentParser(prog=progname,
93
- prefix_chars='-+',
94
- formatter_class=argparse.RawDescriptionHelpFormatter,
95
- description=description,
96
- allow_abbrev=False)
97
-
98
- # Create empty copy of schema
99
- schema = type(self)()
100
-
101
- # Track arguments
102
- argument_map = {}
103
- arguments = set()
104
-
105
- # Iterate over all keys from an empty schema to add parser arguments
106
- for keypath in sorted(schema.allkeys()):
107
- param = schema.get(*keypath, field=None)
108
-
109
- dest, switches = param.add_commandline_arguments(
110
- parser,
111
- *keypath,
112
- switchlist=switchlist)
113
-
114
- if switches:
115
- argument_map[dest] = (keypath, param)
116
- arguments.update(switches)
117
-
118
- print_additional_arg_value = {}
119
- if additional_args:
120
- # Add additional user specified arguments
121
- arg_dests = []
122
- for arg, arg_detail in additional_args.items():
123
- do_print = True
124
- if "sc_print" in arg_detail:
125
- do_print = arg_detail["sc_print"]
126
- del arg_detail["sc_print"]
127
- argument = parser.add_argument(arg, **arg_detail)
128
- print_additional_arg_value[argument.dest] = do_print
129
-
130
- arg_dests.append(argument.dest)
131
- arguments.add(arg)
132
- # rewrite additional_args with new dest information
133
- additional_args = arg_dests
134
-
135
- if version:
136
- parser.add_argument('-version', action='version', version=version)
137
-
138
- # Check if there are invalid switches
139
- if switchlist:
140
- for switch in switchlist:
141
- if switch not in arguments:
142
- raise ValueError(f'{switch} is not a valid commandline argument')
143
-
144
- if input_map_handler:
145
- parser.add_argument('source',
146
- nargs='*',
147
- help='Input files with filetype inferred by extension')
148
-
149
- # Preprocess sys.argv to enable linux commandline switch formats
150
- # (gcc, verilator, etc)
151
- scargs = []
152
-
153
- # Iterate from index 1, otherwise we end up with script name as a
154
- # 'source' positional argument
155
- for argument in sys.argv[1:]:
156
- # Split switches with one character and a number after (O0,O1,O2)
157
- opt = re.match(r'(\-\w)(\d+)', argument)
158
- # Split assign switches (-DCFG_ASIC=1)
159
- assign = re.search(r'(\-\w)(\w+\=\w+)', argument)
160
- # Split plusargs (+incdir+/path)
161
- plusarg = re.search(r'(\+\w+\+)(.*)', argument)
162
- if opt:
163
- scargs.append(opt.group(1))
164
- scargs.append(opt.group(2))
165
- elif plusarg:
166
- scargs.append(plusarg.group(1))
167
- scargs.append(plusarg.group(2))
168
- elif assign:
169
- scargs.append(assign.group(1))
170
- scargs.append(assign.group(2))
171
- else:
172
- scargs.append(argument)
173
-
174
- # Grab argument from pre-process sysargs
175
- cmdargs = vars(parser.parse_args(scargs))
176
-
177
- # Set loglevel if set at command line
178
- do_print_banner = True
179
- if 'option_loglevel' in cmdargs:
180
- log_level = cmdargs['option_loglevel']
181
- if isinstance(log_level, list):
182
- # if multiple found, pick the first one
183
- log_level = log_level[0]
184
- if log_level == 'quiet':
185
- do_print_banner = False
186
- if logger:
187
- logger.setLevel(log_level.split()[-1].upper())
188
-
189
- if print_banner and do_print_banner:
190
- print_banner()
191
-
192
- extra_params = None
193
- if additional_args:
194
- # Grab user specified arguments
195
- extra_params = {}
196
- for arg in additional_args:
197
- if arg in cmdargs:
198
- val = cmdargs[arg]
199
- if print_additional_arg_value[arg] and val and logger:
200
- logger.info(
201
- f'Command line argument entered: "{arg}" Value: {val}')
202
- extra_params[arg] = val
203
- # Remove from cmdargs
204
- del cmdargs[arg]
205
-
206
- # Read in all cfg files
207
- if 'option_cfg' in cmdargs.keys():
208
- for item in cmdargs['option_cfg']:
209
- self.read_manifest(item)
210
-
211
- if input_map_handler:
212
- # Map sources to ['input'] keypath.
213
- if 'source' in cmdargs:
214
- input_map_handler(cmdargs['source'])
215
- # we don't want to handle this in the next loop
216
- del cmdargs['source']
217
-
218
- # Cycle through all command args and write to manifest
219
- for dest, vals in sorted(cmdargs.items(), key=lambda d: d[0]):
220
- keypath, param = argument_map[dest]
221
-
222
- # Turn everything into a list for uniformity
223
- if not isinstance(vals, list):
224
- vals = [vals]
225
-
226
- # Cycle through all items
227
- for item in vals:
228
- if preprocess_keys:
229
- item = preprocess_keys(keypath, item)
230
-
231
- valkeypath, step, index, item = param.parse_commandline_arguments(item, *keypath)
232
-
233
- if logger:
234
- msg = f'Command line argument entered: [{",".join(valkeypath)}] Value: {item}'
235
- if step is not None:
236
- msg += f' step: {step}'
237
- if index is not None:
238
- msg += f' index: {index}'
239
- logger.info(msg)
240
-
241
- # Storing in manifest
242
- if param.is_list():
243
- self.add(*valkeypath, item, step=step, index=index)
244
- else:
245
- self.set(*valkeypath, item, step=step, index=index)
246
-
247
- if post_process:
248
- extra_params = post_process(cmdargs, extra_params)
249
-
250
- return extra_params
@@ -1,40 +0,0 @@
1
- #!/bin/sh
2
-
3
- set -ex
4
-
5
- # Get directory of script
6
- src_path=$(cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P)/..
7
-
8
- sudo yum install -y git
9
-
10
- mkdir -p deps
11
- cd deps
12
-
13
- python3 -m venv .slang --clear
14
- . .slang/bin/activate
15
- python3 -m pip install --upgrade pip
16
- python3 -m pip install cmake
17
-
18
- USE_SUDO_INSTALL="${USE_SUDO_INSTALL:-yes}"
19
- if [ "${USE_SUDO_INSTALL:-yes}" = "yes" ]; then
20
- SUDO_INSTALL="sudo -E PATH=$PATH"
21
- else
22
- SUDO_INSTALL=""
23
- fi
24
-
25
- sudo yum install -y gcc-toolset-12
26
-
27
- git clone $(python3 ${src_path}/_tools.py --tool slang --field git-url) slang
28
- cd slang
29
- git checkout $(python3 ${src_path}/_tools.py --tool slang --field git-commit)
30
-
31
- cfg_args=""
32
- if [ ! -z ${PREFIX} ]; then
33
- cfg_args="-D CMAKE_INSTALL_PREFIX=$PREFIX"
34
- fi
35
-
36
- scl run gcc-toolset-12 "cmake -B build $cfg_args"
37
- scl run gcc-toolset-12 "cmake --build build -j$(nproc)"
38
- scl run gcc-toolset-12 "$SUDO_INSTALL make -C build install"
39
-
40
- cd -
@@ -1,40 +0,0 @@
1
- #!/bin/sh
2
-
3
- set -ex
4
-
5
- # Get directory of script
6
- src_path=$(cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P)/..
7
-
8
- sudo yum install -y git
9
-
10
- mkdir -p deps
11
- cd deps
12
-
13
- python3 -m venv .slang --clear
14
- . .slang/bin/activate
15
- python3 -m pip install --upgrade pip
16
- python3 -m pip install cmake==3.31.6
17
-
18
- USE_SUDO_INSTALL="${USE_SUDO_INSTALL:-yes}"
19
- if [ "${USE_SUDO_INSTALL:-yes}" = "yes" ]; then
20
- SUDO_INSTALL="sudo -E PATH=$PATH"
21
- else
22
- SUDO_INSTALL=""
23
- fi
24
-
25
- sudo yum install -y gcc-toolset-12
26
-
27
- git clone $(python3 ${src_path}/_tools.py --tool slang --field git-url) slang
28
- cd slang
29
- git checkout $(python3 ${src_path}/_tools.py --tool slang --field git-commit)
30
-
31
- cfg_args=""
32
- if [ ! -z ${PREFIX} ]; then
33
- cfg_args="-D CMAKE_INSTALL_PREFIX=$PREFIX"
34
- fi
35
-
36
- scl run gcc-toolset-12 "cmake -B build $cfg_args"
37
- scl run gcc-toolset-12 "cmake --build build -j$(nproc)"
38
- scl run gcc-toolset-12 "$SUDO_INSTALL make -C build install"
39
-
40
- cd -
@@ -1,47 +0,0 @@
1
- #!/bin/sh
2
-
3
- set -ex
4
-
5
- # Get directory of script
6
- src_path=$(cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P)/..
7
-
8
- sudo apt-get install -y git build-essential software-properties-common
9
-
10
- mkdir -p deps
11
- cd deps
12
-
13
- python3 -m venv .slang --clear
14
- . .slang/bin/activate
15
- python3 -m pip install cmake==3.31.6
16
-
17
- USE_SUDO_INSTALL="${USE_SUDO_INSTALL:-yes}"
18
- if [ "${USE_SUDO_INSTALL:-yes}" = "yes" ]; then
19
- SUDO_INSTALL="sudo -E PATH=$PATH"
20
- else
21
- SUDO_INSTALL=""
22
- fi
23
-
24
- if [ ! -z ${SC_BUILD} ]; then
25
- # Limit this to CI builds
26
- sudo add-apt-repository ppa:ubuntu-toolchain-r/test
27
- sudo apt-get update
28
- sudo apt install -y gcc-11 g++-11
29
-
30
- export CXX=/usr/bin/g++-11
31
- export CC=/usr/bin/gcc-11
32
- fi
33
-
34
- git clone $(python3 ${src_path}/_tools.py --tool slang --field git-url) slang
35
- cd slang
36
- git checkout $(python3 ${src_path}/_tools.py --tool slang --field git-commit)
37
-
38
- cfg_args=""
39
- if [ ! -z ${PREFIX} ]; then
40
- cfg_args="-D CMAKE_INSTALL_PREFIX=$PREFIX"
41
- fi
42
-
43
- cmake -B build $cfg_args
44
- cmake --build build -j$(nproc)
45
- $SUDO_INSTALL make -C build install
46
-
47
- cd -
@@ -1,37 +0,0 @@
1
- #!/bin/sh
2
-
3
- set -ex
4
-
5
- # Get directory of script
6
- src_path=$(cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P)/..
7
-
8
- sudo apt-get install -y git build-essential
9
-
10
- mkdir -p deps
11
- cd deps
12
-
13
- python3 -m venv .slang --clear
14
- . .slang/bin/activate
15
- python3 -m pip install cmake==3.31.6
16
-
17
- USE_SUDO_INSTALL="${USE_SUDO_INSTALL:-yes}"
18
- if [ "${USE_SUDO_INSTALL:-yes}" = "yes" ]; then
19
- SUDO_INSTALL="sudo -E PATH=$PATH"
20
- else
21
- SUDO_INSTALL=""
22
- fi
23
-
24
- git clone $(python3 ${src_path}/_tools.py --tool slang --field git-url) slang
25
- cd slang
26
- git checkout $(python3 ${src_path}/_tools.py --tool slang --field git-commit)
27
-
28
- cfg_args=""
29
- if [ ! -z ${PREFIX} ]; then
30
- cfg_args="-D CMAKE_INSTALL_PREFIX=$PREFIX"
31
- fi
32
-
33
- cmake -B build $cfg_args
34
- cmake --build build -j$(nproc)
35
- $SUDO_INSTALL make -C build install
36
-
37
- cd -
@@ -1,37 +0,0 @@
1
- #!/bin/sh
2
-
3
- set -ex
4
-
5
- # Get directory of script
6
- src_path=$(cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P)/..
7
-
8
- sudo apt-get install -y git build-essential
9
-
10
- mkdir -p deps
11
- cd deps
12
-
13
- python3 -m venv .slang --clear
14
- . .slang/bin/activate
15
- python3 -m pip install cmake==3.31.6
16
-
17
- USE_SUDO_INSTALL="${USE_SUDO_INSTALL:-yes}"
18
- if [ "${USE_SUDO_INSTALL:-yes}" = "yes" ]; then
19
- SUDO_INSTALL="sudo -E PATH=$PATH"
20
- else
21
- SUDO_INSTALL=""
22
- fi
23
-
24
- git clone $(python3 ${src_path}/_tools.py --tool slang --field git-url) slang
25
- cd slang
26
- git checkout $(python3 ${src_path}/_tools.py --tool slang --field git-commit)
27
-
28
- cfg_args=""
29
- if [ ! -z ${PREFIX} ]; then
30
- cfg_args="-D CMAKE_INSTALL_PREFIX=$PREFIX"
31
- fi
32
-
33
- cmake -B build $cfg_args
34
- cmake --build build -j$(nproc)
35
- $SUDO_INSTALL make -C build install
36
-
37
- cd -