benchmark icon indicating copy to clipboard operation
benchmark copied to clipboard

Build fails on ppc64le

Open jayfurmanek opened this issue 7 years ago • 3 comments

Hi, I've tried building this on a ppc64le machine (power8) and it fails in src/cycleclock.h:

In file included from /tmp/build/protobuf/third_party/benchmark/src/sysinfo.cc:44:0: /tmp/build/protobuf/third_party/benchmark/src/cycleclock.h: In function 'int64_t benchmark::cycleclock::Now()': /tmp/build/protobuf/third_party/benchmark/src/cycleclock.h:82:23: error: 'int64' does not name a type tbl &= -static_cast(tbu0 == tbu1);

It looks like there is no 64bit ppc timebase instructions. The needed instruction is 'mfspr'. It returns a 64bit unsigned int and no need for low/high bit wrangling.

I'd submit a patch, but I haven't signed the CLA yet. Please let me know if you need a patch and I can get that started.

jayfurmanek avatar Sep 27 '17 22:09 jayfurmanek

I'd like a patch, but are you running at head? the line numbers don't line up (it's 91 at head) and it was replaced with int64_t at some point.

Dominic Hamon | Google There are no bad ideas; only good ideas that go horribly wrong.

On Wed, Sep 27, 2017 at 3:33 PM, jayfurmanek [email protected] wrote:

Hi, I've tried building this on a ppc64le machine (power8) and it fails in src/cycleclock.h:

In file included from /tmp/build/protobuf/third_ party/benchmark/src/sysinfo.cc:44:0: /tmp/build/protobuf/third_party/benchmark/src/cycleclock.h: In function 'int64_t benchmark::cycleclock::Now()': /tmp/build/protobuf/third_party/benchmark/src/cycleclock.h:82:23: error: 'int64' does not name a type tbl &= -static_cast(tbu0 == tbu1);

It looks like there is no 64bit ppc timebase instructions. The needed instruction is 'mfspr'. It returns a 64bit unsigned int and no need for low/high bit wrangling.

I'd submit a patch, but I haven't signed the CLA yet. Please let me know if you need a patch and I can get that started.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/google/benchmark/issues/449, or mute the thread https://github.com/notifications/unsubscribe-auth/AAfIMjmMiTIyyT4pUgsPeoS8QPwOE5q7ks5sms0-gaJpZM4PmfNP .

dmah42 avatar Sep 27 '17 23:09 dmah42

Oh I guess I was working on the commit level that is a sub-module of protobuf. Yea, there is the that int64/int64_t bug in the powerpc section, but that whole section is old and generally aimed at 32bit systems. The new mfspr instruction in the 64bit ISA is better and more appropriate for powerpc64 systems.

I'll work on the CLA

jayfurmanek avatar Sep 28 '17 19:09 jayfurmanek

@jayfurmanek I'm trying to build caffe2 on ppc64le (POWER8) and it got stuck in this error. It would be appreciated if you can get started on the patch for this.

/home/u0017649/caffe2/third_party/benchmark/src/cycleclock.h:82:23: error: ‘int64’ does not name a type tbl &= -static_cast<int64>(tbu0 == tbu1); ^ third_party/benchmark/src/CMakeFiles/benchmark.dir/build.make:230: recipe for target 'third_party/benchmark/src/CMakeFiles/benchmark.dir/sysinfo.cc.o' failed

nasica88 avatar Oct 16 '17 08:10 nasica88