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

benchmark complile error #70

Open
rangerToby opened this issue Jan 11, 2020 · 1 comment
Open

benchmark complile error #70

rangerToby opened this issue Jan 11, 2020 · 1 comment

Comments

@rangerToby
Copy link

rangerToby commented Jan 11, 2020

benchmark complile error
device: jetson nano
os: ubuntu18.04
gcc7.4/g++7.4/cmake3.10.2

when i try to compile dabnn and its third part code on jetson nano ubuntu16.04(arm-noAndroid),
cmake .. is all right
when i come to “cmake --build .” ,i got some errors about benchmark code:

In file included from /home/t/project_win/02_190731_BNN/dabnn/benchmark/benchmark_single_model.cpp:3:0:
/home/t/project_win/02_190731_BNN/dabnn/third_party/benchmark/src/../include/benchmark/benchmark.h: In instantiation of ‘benchmark::RegisterBenchmark(const char*, Lambda&&, Args&& ...)::<lambda(benchmark::State&)> [with Lambda = void (&)(benchmark::State&, std::__cxx11::basic_string); Args = {char*&}]’:
/home/t/project_win/02_190731_BNN/dabnn/third_party/benchmark/src/../include/benchmark/benchmark.h:1053:48: required from ‘struct benchmark::RegisterBenchmark(const char*, Lambda&&, Args&& ...) [with Lambda = void (&)(benchmark::State&, std::__cxx11::basic_string); Args = {char*&}]::<lambda(class benchmark::State&)>’
/home/t/project_win/02_190731_BNN/dabnn/third_party/benchmark/src/../include/benchmark/benchmark.h:1052:38: required from ‘benchmark::internal::Benchmark* benchmark::RegisterBenchmark(const char*, Lambda&&, Args&& ...) [with Lambda = void (&)(benchmark::State&, std::__cxx11::basic_string); Args = {char*&}]’/home/t/project_win/02_190731_BNN/dabnn/benchmark/benchmark_single_model.cpp:22:74: required from here
/home/t/project_win/02_190731_BNN/dabnn/third_party/benchmark/src/../include/benchmark/benchmark.h:1053:41: error: variable ‘fn’ has function type
name, [=](benchmark::State& st) { fn(st, args...); });
^~
/home/t/project_win/02_190731_BNN/dabnn/third_party/benchmark/src/../include/benchmark/benchmark.h:1053:41: error: variable ‘fn’ has function type
/home/t/project_win/02_190731_BNN/dabnn/third_party/benchmark/src/../include/benchmark/benchmark.h: In instantiation of ‘struct benchmark::RegisterBenchmark(const char*, Lambda&&, Args&& ...) [with Lambda = void (&)(benchmark::State&, std::__cxx11::basic_string); Args = {char*&}]::<lambda(class benchmark::State&)>’:
/home/t/project_win/02_190731_BNN/dabnn/third_party/benchmark/src/../include/benchmark/benchmark.h:1052:38: required from ‘benchmark::internal::Benchmark* benchmark::RegisterBenchmark(const char*, Lambda&&, Args&& ...) [with Lambda = void (&)(benchmark::State&, std::__cxx11::basic_string); Args = {char*&}]’/home/t/project_win/02_190731_BNN/dabnn/benchmark/benchmark_single_model.cpp:22:74: required from here
/home/t/project_win/02_190731_BNN/dabnn/third_party/benchmark/src/../include/benchmark/benchmark.h:1053:41: error: field ‘benchmark::RegisterBenchmark(const char*, Lambda&&, Args&& ...) [with Lambda = void (&)(benchmark::State&, std::__cxx11::basic_string); Args = {char*&}]::<lambda(benchmark::State&)>::’ invalidly declared function type
/home/t/project_win/02_190731_BNN/dabnn/third_party/benchmark/src/../include/benchmark/benchmark.h:1039:22: warning: ‘benchmark::internal::Benchmark* benchmark::RegisterBenchmark(const char*, Lambda&&) [with Lambda = benchmark::RegisterBenchmark(const char*, Lambda&&, Args&& ...) [with Lambda = void (&)(benchmark::State&, std::__cxx11::basic_string); Args = {char*&}]::<lambda(benchmark::State&)>]’, declared using local type ‘benchmark::RegisterBenchmark(const char*, Lambda&&, Args&& ...) [with Lambda = void (&)(benchmark::State&, std::__cxx11::basic_string); Args = {char*&}]::<lambda(benchmark::State&)>’, is used but never defined [-fpermissive]
internal::Benchmark* RegisterBenchmark(const char* name, Lambda&& fn) {
^~~~~~~~~~~~~~~~~
benchmark/CMakeFiles/benchmark_single_model.dir/build.make:62: recipe for target 'benchmark/CMakeFiles/benchmark_single_model.dir/benchmark_single_model.cpp.o' failed

i tried to add "add_cxx_compiler_flag(-fpermissive)" in benchmark/CMakeLists.txt , and third_part/benchmark/CMakeLists.txt,but got the same error.
I googled it and got close issue on this link: gabime/spdlog#931

tmp solution :
set CMakeLists.txt
option(BNN_BUILD_BENCHMARK "Build benchmark" OFF)
option(BNN_NET_BENCHMARK "define BNN_BENCHMARK" OFF)
rm old cmake files and compile again, it can be compiled completely.

@danyan0820
Copy link

I have the issue too.I solved it by add '&' before 'BM_single_model' in benchmark_single_model.cpp.
benchmark::RegisterBenchmark("single_model", &BM_single_model, argv[1]);

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

2 participants