Skip to content
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

ERROR: Analysis of target '//kcws/cc:seg_backend_api' failed; build aborted. #26

Closed
Sun-shan opened this issue Dec 30, 2016 · 12 comments
Closed

Comments

@Sun-shan
Copy link

Hi, when I build the kcws, there are some issues, how can I fix them?

the issues are as follow:

[root@bio-x-2 cc]# /opt/BioDir/dl/bazel-0.4.3/output/bazel build //kcws/cc:seg_backend_api
WARNING: Sandboxed execution is not supported on your system and thus hermeticity of actions cannot be guaranteed. See http://bazel.build/docs/bazel-user-manual.html#sandboxing for more information. You can turn off this warning via --ignore_unsupported_sandboxing.
WARNING: /root/.cache/bazel/_bazel_root/067d099fd5fd2abf4236febace697e72/external/org_tensorflow/tensorflow/workspace.bzl:13:5: path_prefix was specified to tf_workspace but is no longer used and will be removed in the future.
WARNING: /root/.cache/bazel/_bazel_root/067d099fd5fd2abf4236febace697e72/external/org_tensorflow/tensorflow/workspace.bzl:15:5: tf_repo_name was specified to tf_workspace but is no longer used and will be removed in the future.
ERROR: /root/.cache/bazel/_bazel_root/067d099fd5fd2abf4236febace697e72/external/org_tensorflow/tensorflow/core/platform/default/build_config/BUILD:108:1: error loading package '@jpeg//': Extension file not found. Unable to load package for '//third_party:common.bzl': BUILD file not found on package path and referenced by '@org_tensorflow//tensorflow/core/platform/default/build_config:jpeg'.
ERROR: Analysis of target '//kcws/cc:seg_backend_api' failed; build aborted.
INFO: Elapsed time: 2.612s

=================
I build the bazel tools as follow:

[root@bio-x-2 bazel-0.4.3]# bash ./compile.sh
INFO: You can skip this first step by providing a path to the bazel binary as second argument:
INFO: ./compile.sh compile /path/to/bazel
 Building Bazel from scratch.......
 Building Bazel with Bazel.
.WARNING: /tmp/bazel_lAI1U4my/out/external/bazel_tools/WORKSPACE:1: Workspace name in /tmp/bazel_lAI1U4my/out/external/bazel_tools/WORKSPACE (@io_bazel) does not match the name given in the repository's definition (@bazel_tools); this will cause a build error in future versions.
INFO: Found 1 target...
INFO: From Compiling third_party/ijar/platform_utils.cc [for host]:
third_party/ijar/platform_utils.cc: In function 'bool devtools_ijar::write_file(const char*, mode_t, const void*, size_t)':
third_party/ijar/platform_utils.cc:67:32: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (write(fd, data, size) != size) {
^
INFO: From Compiling third_party/ijar/platform_utils.cc:
third_party/ijar/platform_utils.cc: In function 'bool devtools_ijar::write_file(const char*, mode_t, const void*, size_t)':
third_party/ijar/platform_utils.cc:67:32: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (write(fd, data, size) != size) {
^
INFO: From Compiling third_party/ijar/ijar.cc:
third_party/ijar/ijar.cc: In member function 'virtual bool devtools_ijar::JarStripperProcessor::Accept(const char*, devtools_ijar::u4)':
third_party/ijar/ijar.cc:66:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (filename_len >= CLASS_EXTENSION_LENGTH) {
^
INFO: From Compiling third_party/ijar/ijar.cc [for host]:
third_party/ijar/ijar.cc: In member function 'virtual bool devtools_ijar::JarStripperProcessor::Accept(const char*, devtools_ijar::u4)':
third_party/ijar/ijar.cc:66:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (filename_len >= CLASS_EXTENSION_LENGTH) {
^
INFO: From Compiling src/main/cpp/blaze_util_posix.cc:
src/main/cpp/blaze_util_posix.cc: In function 'void blaze::Daemonize(const string&)':
src/main/cpp/blaze_util_posix.cc:190:28: warning: ignoring return value of 'int dup(int)', declared with attribute warn_unused_result [-Wunused-result]
(void) dup(STDOUT_FILENO); // stderr (2>&1)
^
src/main/cpp/blaze_util_posix.cc: In function 'uint64_t blaze::AcquireLock(const string&, bool, bool, blaze::BlazeLock*)':
src/main/cpp/blaze_util_posix.cc:578:30: warning: ignoring return value of 'int ftruncate(int, __off_t)', declared with attribute warn_unused_result [-Wunused-result]
(void) ftruncate(lockfd, 0);
^
src/main/cpp/blaze_util_posix.cc:583:47: warning: ignoring return value of 'ssize_t write(int, const void*, size_t)', declared with attribute warn_unused_result [-Wunused-result]
(void) write(lockfd, msg.data(), msg.size());
^
INFO: From JavacBootstrap src/java_tools/buildjar/java/com/google/devtools/build/buildjar/libbootstrap_JarOwner.jar [for host]:
warning: Implicitly compiled files were not subject to annotation processing.
Use -proc:none to disable annotation processing or -implicit to specify a policy for implicit compilation.
1 warning
INFO: From Building src/main/protobuf/libextra_actions_base_java_proto.jar (1 source jar):
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
INFO: From Building src/java_tools/junitrunner/java/com/google/testing/coverage/JacocoCoverage.jar (9 source files):
Note: src/java_tools/junitrunner/java/com/google/testing/coverage/MethodProbesMapper.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
INFO: From Building src/tools/android/java/com/google/devtools/build/android/ziputils/libziputils_lib.jar (12 source files):
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
INFO: From Building src/main/java/com/google/devtools/build/lib/libconcurrent.jar (18 source files):
Note: src/main/java/com/google/devtools/build/lib/concurrent/AbstractQueueVisitor.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
INFO: From Building third_party/java/apkbuilder/apkbuilder.jar (15 source files):
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
INFO: From Building src/main/java/com/google/devtools/build/lib/libutil.jar (45 source files):
Note: src/main/java/com/google/devtools/build/lib/util/OrderedSetMultimap.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
INFO: From Building src/main/java/com/google/devtools/build/lib/cmdline/libcmdline.jar (10 source files):
Note: src/main/java/com/google/devtools/build/lib/cmdline/RepositoryName.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
INFO: From Building src/main/java/com/google/devtools/build/skyframe/libskyframe.jar (67 source files):
Note: src/main/java/com/google/devtools/build/skyframe/ReverseDepsUtilImpl.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
INFO: From Building src/main/java/com/google/devtools/build/lib/libsyntax.jar (86 source files):
Note: src/main/java/com/google/devtools/build/lib/syntax/BuiltinFunction.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
INFO: From Building src/main/java/com/google/devtools/build/lib/libpackages-internal.jar (98 source files):
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
INFO: From Building src/main/java/com/google/devtools/build/lib/actions/libactions.jar (91 source files):
Note: src/main/java/com/google/devtools/build/lib/actions/Actions.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
INFO: From Building src/main/java/com/google/devtools/build/lib/libbuild-base.jar (381 source files):
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
INFO: From Building src/main/java/com/google/devtools/build/lib/libproto-rules.jar (13 source files):
Note: src/main/java/com/google/devtools/build/lib/rules/proto/ProtoCommon.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
INFO: From Building src/main/java/com/google/devtools/build/lib/query2/libquery2.jar (12 source files):
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
INFO: From Building src/main/java/com/google/devtools/build/lib/query2/libquery-output.jar (10 source files):
Note: src/main/java/com/google/devtools/build/lib/query2/output/QueryOutputUtils.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
INFO: From Building src/main/java/com/google/devtools/build/lib/rules/genquery/libgenquery.jar (2 source files):
Note: src/main/java/com/google/devtools/build/lib/rules/genquery/GenQuery.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
INFO: From Building src/main/java/com/google/devtools/build/lib/rules/cpp/libcpp.jar (80 source files):
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
INFO: From Building src/main/java/com/google/devtools/build/lib/libpython-rules.jar (15 source files):
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
INFO: From Building src/main/java/com/google/devtools/build/lib/libjava-compilation.jar (37 source files):
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: src/main/java/com/google/devtools/build/lib/rules/java/JavaCompileAction.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
INFO: From Building src/main/java/com/google/devtools/build/lib/libjava-rules.jar (32 source files):
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
INFO: From Building src/main/java/com/google/devtools/build/lib/libandroid-rules.jar (59 source files):
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
INFO: From Building src/main/java/com/google/devtools/build/lib/libideinfo.jar (4 source files):
Note: src/main/java/com/google/devtools/build/lib/ideinfo/AndroidStudioInfoAspect.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
INFO: From Building src/main/java/com/google/devtools/build/lib/rules/objc/libobjc.jar (114 source files):
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: src/main/java/com/google/devtools/build/lib/rules/objc/IterableWrapper.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
INFO: From Building src/main/java/com/google/devtools/build/lib/libruntime.jar (94 source files):
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
INFO: From Building src/main/java/com/google/devtools/build/lib/sandbox/libsandbox.jar (16 source files):
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
INFO: From Building src/main/java/com/google/devtools/build/lib/worker/libworker.jar (11 source files):
Note: src/main/java/com/google/devtools/build/lib/worker/WorkerSpawnStrategy.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
INFO: From Building src/main/java/com/google/devtools/build/lib/libbazel-rules.jar (87 source files, 14 resources):
Note: src/main/java/com/google/devtools/build/lib/bazel/rules/java/BazelJavaSemantics.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Target //src:bazel up-to-date:
bazel-bin/src/bazel
INFO: Elapsed time: 178.725s, Critical Path: 170.17s
WARNING: /tmp/bazel_lAI1U4my/out/external/bazel_tools/WORKSPACE:1: Workspace name in /tmp/bazel_lAI1U4my/out/external/bazel_tools/WORKSPACE (@io_bazel) does not match the name given in the repository's definition (@bazel_tools); this will cause a build error in future versions.

Build successful! Binary is here: /opt/BioDir/dl/bazel-0.4.3/output/bazel

@koth
Copy link
Owner

koth commented Jan 14, 2017

更新了下build,不需要源码依赖tensorflow了,这个问题应该不存在了

@crownpku
Copy link

用了最新的版本,这一步还是有下面的问题,该怎么解决?

ERROR: /home/user1/software/kcws/kcws/cc/BUILD:110:1: Linking of rule '//kcws/cc:seg_backend_api' failed: gcc failed: error executing command /usr/bin/gcc -o bazel-out/local-fastbuild/bin/kcws/cc/seg_backend_api -pthread -Wl,-no-as-needed -B/usr/bin -B/usr/bin -pass-exit-codes '-Wl,--build-id=md5' '-Wl,--hash-style=gnu' -Wl,-S ... (remaining 1 argument(s) skipped): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.
bazel-out/local-fastbuild/bin/external/tf/libtensorflow.lo(attr_value.pb.o_34.o): In function tensorflow::AttrValue::SerializeWithCachedSizes(google::protobuf::io::CodedOutputStream*) const': attr_value.pb.cc:(.text+0x28d): undefined reference to google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(int, std::string const&, google::protobuf::io::CodedOutputStream*)'
attr_value.pb.cc:(.text+0x308): undefined reference to google::protobuf::internal::fixed_address_empty_string' attr_value.pb.cc:(.text+0x315): undefined reference to google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(int, std::string const&, google::protobuf::io::CodedOutputStream*)'
bazel-out/local-fastbuild/bin/external/tf/libtensorflow.lo(attr_value.pb.o_34.o): In function google::protobuf::internal::GenericTypeHandler<google::protobuf::internal::MapEntry<std::string, tensorflow::AttrValue, (google::protobuf::internal::WireFormatLite::FieldType)9, (google::protobuf::internal::WireFormatLite::FieldType)11, 0> >::NewFromPrototype(google::protobuf::internal::MapEntry<std::string, tensorflow::AttrValue, (google::protobuf::internal::WireFormatLite::FieldType)9, (google::protobuf::internal::WireFormatLite::FieldType)11, 0> const*, google::protobuf::Arena*) [clone .isra.263]': attr_value.pb.cc:(.text+0x627): undefined reference to google::protobuf::internal::fixed_address_empty_string'
attr_value.pb.cc:(.text+0x6a9): undefined reference to `google::protobuf::internal::fixed_address_empty_string'

@koth
Copy link
Owner

koth commented Jan 17, 2017

@crownpku 请问编译器什么版本? 在代码根目录执行了./configure了吧?

@crownpku
Copy link

crownpku commented Jan 17, 2017

有运行过./configure了

gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
Bazel Build label: 0.4.3

@koth
Copy link
Owner

koth commented Jan 17, 2017

@crownpku 尝试了下修复,目前没环境还不敢打包票修复好了。你更新下代码试试,不行我这两天弄个你一样的环境试试

@crownpku
Copy link

@koth 还是不行,相同的错误...你那边可以编译成功的gcc版本是多少?

@koth
Copy link
Owner

koth commented Jan 18, 2017

gcc4.8 4.9 ,晚上弄下你的环境

@koth
Copy link
Owner

koth commented Jan 18, 2017

-D_GLIBCXX_USE_CXX11_ABI=0 可解决编译问题,貌似运行还有点问题。。可能需要对gcc5单独编译个tf包

@koth koth closed this as completed Jan 18, 2017
@koth koth reopened this Jan 18, 2017
@koth
Copy link
Owner

koth commented Jan 19, 2017

@crownpku 已修复,更新后在源码根目录执行下./configure

@koth koth closed this as completed Jan 20, 2017
@Sun-shan
Copy link
Author

更新了kcws,好像还是存在问题
[root@bio-x-2 dl]# git clone https://github.com/koth/kcws.git
Cloning into 'kcws'...
remote: Counting objects: 482, done.
remote: Compressing objects: 100% (79/79), done.
remote: Total 482 (delta 23), reused 0 (delta 0), pack-reused 403
Receiving objects: 100% (482/482), 9.46 MiB | 307.00 KiB/s, done.
Resolving deltas: 100% (151/151), done.

[root@bio-x-2 dl]# cd kcws/
[root@bio-x-2 kcws]# ls
base BUILD.boost BUILD.tf_dist configure docs kcws README.md third_party tools util utils WORKSPACE
[root@bio-x-2 kcws]# ./configure
Please specify the location of python. [Default is /usr/bin/python]:
Configuration finished
[root@bio-x-2 kcws]# bazel build //kcws/cc:seg_backend_api
...............
WARNING: Sandboxed execution is not supported on your system and thus hermeticity of actions cannot be guaranteed. See http://bazel.io/docs/bazel-user-manual.html#sandboxing for more information. You can turn off this warning via --ignore_unsupported_sandboxing.
ERROR: /opt/BioDir/dl/kcws/WORKSPACE:5:1: //external:boost: no such attribute 'urls' in 'new_http_archive' rule.
ERROR: /opt/BioDir/dl/kcws/WORKSPACE:5:1: //external:boost: missing value for mandatory attribute 'url' in 'new_http_archive' rule.
ERROR: /opt/BioDir/dl/kcws/WORKSPACE:32:1: //external:protobuf: no such attribute 'urls' in 'http_archive' rule.
ERROR: /opt/BioDir/dl/kcws/WORKSPACE:32:1: //external:protobuf: missing value for mandatory attribute 'url' in 'http_archive' rule.
ERROR: com.google.devtools.build.lib.packages.BuildFileContainsErrorsException: error loading package '': Encountered error while reading extension file 'tools/cpp/cc_configure.bzl': no such package '@bazel_tools//tools/cpp': error loading package 'external': Could not load //external package.
INFO: Elapsed time: 0.588s

gcc版本为:
[root@bio-x-2 kcws]# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/cloog-install --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.8.5 20150623 (Red Hat 4.8.5-4) (GCC)

@Sun-shan
Copy link
Author

@koth

@koth
Copy link
Owner

koth commented Jan 20, 2017

忘说bazel也要0.4.3以上了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants