前提条件
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
在开始构建您的第一个模拟器之前,需要完成以下事项
所需执行的操作。
安装 Bazel
MPACT-Sim 使用 Bazel 构建系统版本 6.1.1,
因此,要完成这些教程,您需要安装 Bazel。通过
安装和管理 Bazel 的最简单方法是
Bazelisk,它是
使用 Go 编写的 Bazel。如需安装说明,请访问
GitHub 网站。
安装 Git
MPACT-Sim 基础设施和教程托管在 github.com 上,因此运行正常
需要安装 git。任何合理的版本
所有 git 都应该运行,因此请选择适合您系统的版本。
如果您还没有 git,并且使用的是 Linux,则通常可以
按如下方式从命令行安装 git:
$ sudo apt-get update
$ sudo apt-get install git
在其他系统上,您可以从git
下载。
下载 MPACT-Sim 教程库
这些教程所需的所有代码都包含在 GitHub 中
mpact-sim-codelabs 代码库。
使用以下命令克隆此代码库:git clone
https://github.com/google/mpact-sim-codelabs
。
如需验证是否一切正常,请改用 mpact-sim-codelab
目录中,然后输入命令 bazel build ...:all
。这会下载
所需的依赖项,并构建每个目标。第一次,
但结果会被缓存,后续的构建就会
能够更快地完成该命令将输出进度,包括
DEBUG 消息和几条编译器警告。输出结果的
应如下所示:
INFO: Elapsed time: 308.268s, Critical Path: 279.57s
INFO: 991 processes: 314 internal, 677 linux-sandbox.
INFO: Build completed successfully, 991 total actions
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-25。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-07-25。"],[],["To prepare for the simulator tutorials, install Bazel (version 6.1.1), preferably using Bazelisk. Install Git, compatible with your system, for accessing the GitHub-hosted resources. Download the `mpact-sim-codelabs` repository via `git clone https://github.com/google/mpact-sim-codelabs`. Navigate to the cloned directory and verify setup with `bazel build ...:all`, which downloads dependencies and builds all targets. The final output should display successful completion with a summary of processes.\n"]]