-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature]: bazel脚本编写问题 #396
Comments
这个 bazel rule 本身没什么问题,但是 ht_pir 的 deps 里得加入 global_variable,详细可以参考一下 bazel 文档 |
为什么只包含头文件的spu_cc_library会出现错误 |
从 log 上来看,只是 ht_pir 缺少了依赖,并不是只包含头文件的 cc_library 造成的 |
这两个文件在一个文件夹也要写进依赖库吗 |
除非 global_variable.h 和 ht_pir.cc 是在同一个 cc_library 下面,否则必须要 explicit 的写在 deps 里面。 |
ERROR: /home/test/Desktop/xxx/spu-main/spu-main/libspu/pir/BUILD.bazel:110:15: no such package 'libspu/pir/global_variable': BUILD file not found in any of the following directories. Add a BUILD file to a directory to mark it as a package.
|
麻烦贴一下你怎么写的 |
Copyright 2022 Ant Group Co., Ltd.Licensed under the Apache License, Version 2.0 (the "License");you may not use this file except in compliance with the License.You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, softwaredistributed 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 andlimitations under the License.load("//bazel:spu.bzl", "spu_cc_library", "spu_cc_test") package(default_visibility = ["//visibility:public"]) spu_cc_library( spu_cc_library( spu_cc_library( proto_library( cc_proto_library( spu_cc_test( spu_cc_test( proto_library( cc_proto_library( spu_cc_library( spu_cc_library( ) spu_cc_library( ) spu_cc_library( ) spu_cc_library( ) spu_cc_library( ) spu_cc_library( ) |
"//libspu/pir/global_variable", 替换成 ":global_variable" |
Feature Request Type
Usability
Have you searched existing issues?
Yes
Is your feature request related to a problem?
spu_cc_library(
name = "global_variable",
hdrs = ["global_variable.h"],
)
这么写bazel脚本可以吗,
为什么存在以下问题
ERROR: /home/test/Desktop/xxx/spu-main/spu-main/libspu/pir/BUILD.bazel:110:15: Compiling libspu/pir/ht_pir.cc failed: (Exit 1): gcc failed: error executing command (from target //libspu/pir:ht_pir) /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections ... (remaining 172 arguments skipped)
Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
In file included from libspu/pir/ht_pir.cc:1:
./libspu/pir/ht_pir.h:8:10: fatal error: libspu/pir/global_variable.h: No such file or directory
8 | #include "libspu/pir/global_variable.h"//定义了程序使用的全局变量
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
ERROR: /home/test/Desktop/xxx/spu-main/spu-main/examples/cpp/pir/BUILD.bazel:150:14: Compiling examples/cpp/pir/ht_keyword_pir_setup.cc failed: (Exit 1): gcc failed: error executing command (from target //examples/cpp/pir:ht_keyword_pir_setup) /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections ... (remaining 175 arguments skipped)
Describe features you want to add to SPU
no
Describe features you want to add to SPU
no
The text was updated successfully, but these errors were encountered: