Comments (7)
from autofdo.
Yes I got all dependent projects with:
git clone --recursive https://github.com/google/autofdo.git
I did every step from the readme maybe it's related to the build order.
I started the build from the autofdo root that should be right ?
from autofdo.
from autofdo.
works with die fix from lannadorai
from autofdo.
After applying the fix from @lannadorai this error disappears, but I get a different ones.
I get this error when compiling with make -j4
:
In file included from third_party/perf_data_converter/src/quipper/perf_parser.h:21:0,
from sample_reader.cc:23:
third_party/perf_data_converter/src/quipper/compat/proto.h:8:59: fatal error: google/protobuf/io/zero_copy_stream_impl_lite.h: No such file or directory
compilation terminated.
Makefile:1116: recipe for target 'create_llvm_prof-sample_reader.o' failed
make[1]: *** [create_llvm_prof-sample_reader.o] Error 1
But a different one when compiling with make
:
g++ -std=gnu++11 -I./third_party/protobuf/src -g -O2 -std=gnu++11 -lpthread -lelf -lz -o create_gcov addr2line.o gcov.o instruction_map.o module_grouper.o profile_creator.o profile_writer.o sample_reader.o source_info.o symbol_map.o profile.o create_gcov.o third_party/perf_data_converter/src/quipper/perf_data.pb.o third_party/perf_data_converter/src/quipper/perf_stat.pb.o libquipper.a libglog.a libsymbolize.a libgflags.a third_party/protobuf/src/.libs/libprotobuf.a -lz -lcrypto
libquipper.a(dso.o): In function `quipper::InitializeLibelf()':
/proj/autofdo/third_party/perf_data_converter/src/quipper/dso.cc:102: undefined reference to `elf_version'
/proj/autofdo/third_party/perf_data_converter/src/quipper/dso.cc:102: undefined reference to `elf_errmsg'
libquipper.a(dso.o): In function `quipper::(anonymous namespace)::GetBuildID(Elf*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)':
/proj/autofdo/third_party/perf_data_converter/src/quipper/dso.cc:62: undefined reference to `elf_kind'
/proj/autofdo/third_party/perf_data_converter/src/quipper/dso.cc:64: undefined reference to `elf_errmsg'
libquipper.a(dso.o): In function `FindElfSection':
/proj/autofdo/third_party/perf_data_converter/src/quipper/dso.cc:31: undefined reference to `elf_getshdrstrndx'
/proj/autofdo/third_party/perf_data_converter/src/quipper/dso.cc:36: undefined reference to `elf_getscn'
/proj/autofdo/third_party/perf_data_converter/src/quipper/dso.cc:36: undefined reference to `elf_rawdata'
/proj/autofdo/third_party/perf_data_converter/src/quipper/dso.cc:41: undefined reference to `elf_nextscn'
/proj/autofdo/third_party/perf_data_converter/src/quipper/dso.cc:43: undefined reference to `gelf_getshdr'
/proj/autofdo/third_party/perf_data_converter/src/quipper/dso.cc:44: undefined reference to `elf_strptr'
libquipper.a(dso.o): In function `quipper::(anonymous namespace)::GetBuildID(Elf*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)':
/proj/autofdo/third_party/perf_data_converter/src/quipper/dso.cc:76: undefined reference to `elf_getdata'
/proj/autofdo/third_party/perf_data_converter/src/quipper/dso.cc:83: undefined reference to `gelf_getnote'
libquipper.a(dso.o): In function `FindElfSection':
/proj/autofdo/third_party/perf_data_converter/src/quipper/dso.cc:32: undefined reference to `elf_errmsg'
libquipper.a(dso.o): In function `quipper::ReadElfBuildId(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)':
/proj/autofdo/third_party/perf_data_converter/src/quipper/dso.cc:119: undefined reference to `elf_begin'
/proj/autofdo/third_party/perf_data_converter/src/quipper/dso.cc:128: undefined reference to `elf_end'
collect2: error: ld returned 1 exit status
Makefile:809: recipe for target 'create_gcov' failed
make[1]: *** [create_gcov] Error 1
make[1]: Leaving directory '/proj/autofdo'
Makefile:567: recipe for target 'all' failed
make: *** [all] Error 2
from autofdo.
I too am experiencing these bugs on Ubuntu/x86 after merging that fix on @lannadorai's master branch. I have libelf installed, and was able to hack a create_gcov binary together by cutting-and-pasting that g++ line and tacking on a ' -lelf' at the end, but the resulting binary just dumps core:
$ ./create_gcov
terminate called after throwing an instance of 'std::system_error'
what(): Unknown error -1
Aborted (core dumped)
I tried the single-threaded make on an Arm/Debian machine, and got:
g++ -DHAVE_CONFIG_H -I. -I./glog/src -I. -I./glog/src -I./third_party/perf_data_converter/src/quipper -DCREATE_LLVM_PROF -g -O2 -MT create_llvm_prof-sample_reader.o -MD -MP -MF .deps/create_llvm_prof-sample_reader.Tpo -c -o create_llvm_prof-sample_reader.o `test -f 'sample_reader.cc' || echo './'`sample_reader.cc
In file included from third_party/perf_data_converter/src/quipper/perf_parser.h:21:0,
from sample_reader.cc:23:
third_party/perf_data_converter/src/quipper/compat/proto.h:8:59: fatal error: google/protobuf/io/zero_copy_stream_impl_lite.h: No such file or directory
#include "google/protobuf/io/zero_copy_stream_impl_lite.h"
^
compilation terminated.
not sure how to proceed...
from autofdo.
The core dump from create_gcov is because the library isn't linked with -lpthread - for similar reasons as the -lelf failures - the libraries appear at the beginning of the command line, but are dropped by the linker before any of the other libraries that use them make a reference to them. The fix is the same: -lelf and -lpthread need to be moved to the end of the linker command line.
Also @lannadorai's fix to generate the proto buffer files needs a small change to stop it regenerating them and recompiling everything else every time make is invoked.
Will create a pull request with these fixes
from autofdo.
Related Issues (20)
- autofdo doesnt compile. HOT 6
- dwarf2reader.cc:835: Unhandled form type HOT 2
- Huge memory consumption
- couldn't ninja HOT 2
- Disscussion: Does autofdo support .zdebug_{info,line}...
- llvm-16-compile-fix
- Apply PGO to the AutoFDO itself HOT 3
- [bug] No checking about "requires the first loadable segment to be executable". HOT 5
- Don't emit in output profile when sample count is 0. HOT 2
- excessive total_count HOT 1
- sample_reader.cc:102] Error reading from perf_inject_etm_test_loop.data&profile_creator.cc:138] Error reading profile.
- Please allow using system abseil (over bundled abseil)
- Completely broken, will not compile on Clear Linux or other distros I've tried HOT 22
- autofdo needs libprotofbuf-dev
- AutoFDO can not be built with LLVM trunk (LLVM-18)
- Optimization clang with Propeller: create_llvm_prof fails
- Propeller slows down clang ~20% HOT 4
- When support path cloning in propeller
- Build autofdo tool failed for llvm-master HOT 1
- create_gcov can not find binary with buildid and profile_creator can not read profile HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from autofdo.