Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
2393909d
A
apollo
项目概览
Pinoxchio
/
apollo
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
apollo
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
2393909d
编写于
6月 23, 2020
作者:
S
storypku
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Bazel: re-org bazelrc for cpu/gpu/dbg/opt builds
上级
911c5a6c
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
52 addition
and
19 deletion
+52
-19
apollo6.sh
apollo6.sh
+3
-3
scripts/apollo_build.sh
scripts/apollo_build.sh
+23
-0
scripts/apollo_config.sh
scripts/apollo_config.sh
+5
-0
tools/apollo.bazelrc.sample
tools/apollo.bazelrc.sample
+1
-3
tools/bazel.rc
tools/bazel.rc
+17
-13
tools/platform/build_defs.bzl
tools/platform/build_defs.bzl
+3
-0
未找到文件。
apollo6.sh
浏览文件 @
2393909d
...
...
@@ -106,13 +106,13 @@ function main() {
env
${
APOLLO_ENV
}
bash
"
${
build_sh
}
"
--config
=
dbg
"
$@
"
;;
build_cpu
)
env
${
APOLLO_ENV
}
bash
"
${
build_sh
}
"
--config
build_
cpu
"
$@
"
env
${
APOLLO_ENV
}
bash
"
${
build_sh
}
"
--config
=
cpu
"
$@
"
;;
build_gpu
)
env
${
APOLLO_ENV
}
bash
"
${
build_sh
}
"
--config
build_
gpu
"
$@
"
env
${
APOLLO_ENV
}
bash
"
${
build_sh
}
"
--config
=
gpu
"
$@
"
;;
build_opt_gpu
)
env
${
APOLLO_ENV
}
bash
"
${
build_sh
}
"
--config
build_
opt_gpu
"
$@
"
env
${
APOLLO_ENV
}
bash
"
${
build_sh
}
"
--config
=
opt_gpu
"
$@
"
;;
buildify
)
env
${
APOLLO_ENV
}
bash
${
APOLLO_ROOT_DIR
}
/scripts/apollo_buildify.sh
...
...
scripts/apollo_build.sh
浏览文件 @
2393909d
...
...
@@ -31,6 +31,8 @@ function determine_disabled_targets() {
}
# components="$(echo -e "${@// /\\n}" | sort -u)"
# if [ ${PIPESTATUS[0]} -ne 0 ]; then ... ; fi
function
determine_targets
()
{
local
targets
=
local
compo
=
"
$1
"
...
...
@@ -130,8 +132,29 @@ function bazel_build() {
_run_bazel_build_impl
"
${
COMMAND_LINE_OPTIONS
}
"
"
$(
bazel query
${
BUILD_TARGETS
}
)
"
}
function
build_simulator
()
{
local
SIMULATOR_TOP_DIR
=
"/apollo-simulator"
if
[
-d
"
${
SIMULATOR_TOP_DIR
}
"
]
&&
[
-e
"
${
SIMULATOR_TOP_DIR
}
/build.sh"
]
;
then
pushd
"
${
SIMULATOR_TOP_DIR
}
"
if
bash build.sh build
;
then
success
"Done building Apollo simulator."
else
fail
"Building Apollo simulator failed."
fi
popd
>
/dev/null
fi
}
function
main
()
{
if
[
"
${
USE_GPU
}
"
-eq
1
]
;
then
info
"Running build under GPU mode. GPU is required to run the build."
else
info
"Running build under CPU mode."
fi
info
"Building for
${
ARCH
}
arch ..."
bazel_build
$@
build_simulator
success
"Done building Apollo. Enjoy!"
}
main
"
$@
"
scripts/apollo_config.sh
浏览文件 @
2393909d
...
...
@@ -16,6 +16,11 @@ set -e
function
config_noninteractive
()
{
local
bzl_cfg_file
=
"
${
APOLLO_ROOT_DIR
}
/.apollo.bazelrc"
echo
"
${
STARTUP_TXT
}
"
>
"
${
bzl_cfg_file
}
"
if
[
"
${
USE_GPU
}
"
-eq
1
]
;
then
echo
"build --config=gpu"
>>
"
${
bzl_cfg_file
}
"
else
echo
"build --config=cpu"
>>
"
${
bzl_cfg_file
}
"
fi
cat
"
${
APOLLO_ROOT_DIR
}
/tools/apollo.bazelrc.sample"
>>
"
${
bzl_cfg_file
}
"
}
...
...
tools/apollo.bazelrc.sample
浏览文件 @
2393909d
...
...
@@ -6,13 +6,11 @@ build --action_env CUDA_TOOLKIT_PATH="/usr/local/cuda-10.2"
build --action_env TF_CUDA_COMPUTE_CAPABILITIES="6.0,6.1,7.0,7.2,7.5"
build --action_env GCC_HOST_COMPILER_PATH="/usr/bin/x86_64-linux-gnu-gcc-7"
build --config=gpu
build:gpu --config=cuda
build:gpu --define=USE_GPU=true
build:gpu --config=tensorrt
#build:gpu --action_env USE_GPU=1
#
build --config=tensorrt
#build --config=tensorrt
## The following was adapted from tensorflow/.bazelrc
...
...
tools/bazel.rc
浏览文件 @
2393909d
...
...
@@ -31,6 +31,8 @@ build --cxxopt="-fdiagnostics-color=always"
# Do not show warnings from external dependencies.
# build --output_filter="^//"
build --config=dbg
# TODO(storypku): disable the following line temporarily as
# external/upb/upb/decode.c:164 can't compile
#build --copt="-Werror=sign-compare"
...
...
@@ -45,18 +47,22 @@ build --define=PREFIX=/usr
build --define=LIBDIR=$(PREFIX)/lib
build --define=INCLUDEDIR=$(PREFIX)/include
# build --enable_platform_specific_config
# dbg config, as a shorthand for '--config=optimize -c dbg'
build:dbg --config=optimize -c dbg
build:opt --config=optimize -c opt
# dbg config, as a shorthand for '--config=opt -c dbg'
build:dbg --config=opt -c dbg
# Instruction set optimizations
build:optimize --copt=-march=native
build:optimize --host_copt=-march=native
build:optimize --define with_default_optimizations=true
## build -c opt
build:opt --copt=-march=native
build:opt --host_copt=-march=native
build:opt --define with_default_optimizations=true
build:cpu --define USE_GPU=false
build:gpu --define USE_GPU=true
build:opt_gpu --config=opt --config=gpu
# Instruction set optimizations
build:native_arch_linux --copt=-march=native
# build with profiling
build:cpu_prof --config=cpu
build:cpu_prof --linkopt=-lprofiler
# Build Apollo with C++ 17 features.
build:c++17 --cxxopt=-std=c++1z
...
...
@@ -67,9 +73,6 @@ build:c++1z --config=c++17
build --cxxopt="-std=c++14"
build --host_cxxopt="-std=c++14"
# build with profiling
build:cpu_prof --linkopt=-lprofiler
# +------------------------------------------------------------+
# | Test Configurations |
# +------------------------------------------------------------+
...
...
@@ -80,6 +83,8 @@ test --test_env=LD_LIBRARY_PATH
# By default prints output only from failed tests.
test --test_output=errors
test:unit_test -c dbg --test_verbose_timeout_warnings
test:coverage --copt=--coverage
test:coverage --cxxopt=--coverage
test:coverage --cxxopt=-fprofile-arcs
...
...
@@ -88,7 +93,6 @@ test:coverage --linkopt=-coverage
test:coverage --linkopt=-lgcov
test:coverage --linkopt=-lgcc
test:coverage --linkopt=-lc
test:unit_test -c dbg --test_verbose_timeout_warnings
# +------------------------------------------------------------+
# | CPP Lint Tests & Unit Tests |
...
...
tools/platform/build_defs.bzl
浏览文件 @
2393909d
...
...
@@ -9,6 +9,9 @@ def if_use_gpu(if_true, if_false = []):
"//conditions:default"
:
if_false
,
})
def
copts_if_use_gpu
():
return
if_use_gpu
([
"-DUSE_GPU=1"
],
[
"-DCPU_ONLY=1"
])
def
if_x86_mode
(
if_true
,
if_false
=
[]):
return
select
({
"//tools/platform:x86_mode"
:
if_true
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录