[SERVER-17563] GPerfTools does not build on PPC64 (Power8) platform Created: 12/Mar/15  Updated: 08/Jan/24  Resolved: 11/Feb/16

Status: Closed
Project: Core Server
Component/s: Build
Affects Version/s: 3.0.0
Fix Version/s: 3.2.5, 3.3.2

Type: Bug Priority: Major - P3
Reporter: Jorik Blaas Assignee: Mark Benvenuto
Resolution: Done Votes: 0
Labels: code-only
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by SERVER-18626 MongoDB version 3.0 build from source... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Completed:
Steps To Reproduce:

get a linux ppc64/power8 system, then untar a clean 3.0.0 mongodb build, and run 'scons --js-engine=none'

Participants:

 Description   

It seems that mongodb in version 3.0 always includes the gperf header (coming from the cpu_profile_command), even through the command is only available when mongodb is explicitly built with the profiler.

scons: Building targets ...
Generating build/linux2/normal/buildinfo.cpp
g++ -o build/linux2/normal/third_party/gperftools-2.2/src/base/spinlock_internal.o -c -Wnon-virtual-dtor -Woverloaded-virtual -std=c++11 -fPIC -fno-strict-aliasing -ggdb -pthread -Wno-unknown-pragmas -Winvalid-pch -pipe -O3 -Wno-unused-local-typedefs -Wno-unused-function -Wno-deprecated-declarations -Wno-unused-but-set-variable -Wno-missing-braces -fno-builtin-memcmp -DBOOST_ALL_NO_LIB -D_SCONS -DMONGO_EXPOSE_MACROS -DSUPPORT_UTF8 -DMONGO_OPTIMIZED_BUILD -DMONGO_BYTE_ORDER=1234 -D_FILE_OFFSET_BITS=64 -DMONGO_HAVE___THREAD -DMONGO_HAVE_CXX11_ATOMICS -DMONGO_HAVE_HEADER_UNISTD_H -DMONGO_HAVE_POSIX_MONOTONIC_CLOCK -DMONGO_HAVE_EXECINFO_BACKTRACE -DMALLOC_HOOK_MAYBE_VOLATILE=volatile -DNO_TCMALLOC_SAMPLES -DNO_HEAP_CHECK -DNDEBUG -Ibuild/linux2/normal/third_party/gperftools-2.2/src -Isrc/third_party/gperftools-2.2/src -Isrc/third_party/gperftools-2.2 -Ibuild/linux2/normal -Isrc src/third_party/gperftools-2.2/src/base/spinlock_internal.cc
In file included from src/third_party/gperftools-2.2/src/base/spinlock_internal.cc:52:0:
src/third_party/gperftools-2.2/src/base/spinlock_linux-inl.h: In constructor '{anonymous}::InitModule::InitModule()':
src/third_party/gperftools-2.2/src/base/spinlock_linux-inl.h:59:49: error: 'sys_futex' was not declared in this scope
                   sys_futex(&x, FUTEX_WAKE, 1, 0) >= 0);
                                                 ^
src/third_party/gperftools-2.2/src/base/spinlock_linux-inl.h: In function 'void base::internal::SpinLockDelay(volatile Atomic32*, int32, int)':
src/third_party/gperftools-2.2/src/base/spinlock_linux-inl.h:88:71: error: 'sys_futex' was not declared in this scope
                 value, reinterpret_cast<struct kernel_timespec *>(&tm));
                                                                       ^
src/third_party/gperftools-2.2/src/base/spinlock_linux-inl.h: In function 'void base::internal::SpinLockWake(volatile Atomic32*, bool)':
src/third_party/gperftools-2.2/src/base/spinlock_linux-inl.h:99:67: error: 'sys_futex' was not declared in this scope
               FUTEX_WAKE | futex_private_flag, all? INT_MAX : 1, 0);
                                                                   ^
scons: *** [build/linux2/normal/third_party/gperftools-2.2/src/base/spinlock_internal.o] Error 1
scons: building terminated because of errors.



 Comments   
Comment by Githook User [ 08/Mar/16 ]

Author:

{u'username': u'markbenvenuto', u'name': u'Mark Benvenuto', u'email': u'mark.benvenuto@mongodb.com'}

Message: SERVER-17563 GPerfTools does not build on PPC64LE (Power8) platform

(cherry picked from commit df981d0766beb3e1c423f72eba1831ec510bd457)
Branch: v3.2
https://github.com/mongodb/mongo/commit/6bcaea60782137725eec2b73f53ca9bad2e34741

Comment by Githook User [ 11/Feb/16 ]

Author:

{u'username': u'markbenvenuto', u'name': u'Mark Benvenuto', u'email': u'mark.benvenuto@mongodb.com'}

Message: SERVER-17563 GPerfTools does not build on PPC64LE (Power8) platform
Branch: master
https://github.com/mongodb/mongo/commit/df981d0766beb3e1c423f72eba1831ec510bd457

Comment by Andrew Morrow (Inactive) [ 18/May/15 ]

jorik.blaas@synerscope.com Some of them, possibly. However, many of the replication and sharding tests expect to be able to spawn servers from the shell while running tests, this will not work against a remote server.

Comment by Jorik Blaas [ 18/May/15 ]

Would I be able to run the integration tests from a different machine (with JS), against this power8 machine as a remote?

Comment by Andrew Morrow (Inactive) [ 18/May/15 ]

jorik.blaas@synerscope.com - Yes, that is correct. Please note that MongoDB does no testing on Power8 at this time, so this is definitely not a supported configuration. Additionally, you will not be able to run the JavaScript integration tests because they require the mongo shell, which you can't build when using --js-engine=none.

Comment by Jorik Blaas [ 18/May/15 ]

That was the combination that did it, I now have a mongodb build, haven't run any tests yet.

~/build/mongodb-src-r3.0.0$ scons --js-engine=none --allocator=system --wiredtiger=off -j40

Install file: "build/linux2/allocator_system/wiredtiger_off/mongo/mongod" as "mongod"
scons: done building targets.

That does mean that I do not have V8 javascript, do not have wiredtiger, and are not using tcmalloc, right?

Comment by Andrew Morrow (Inactive) [ 18/May/15 ]

WiredTiger as embedded in the MongoDB source tree does not currently support PPC64. You can disable it when building by adding --wiredtiger=off to the SCons invocation.

Comment by Jorik Blaas [ 18/May/15 ]

I think this is more about memory write barriers than about disk write barriers (as the link you have posted seems to suggest).

http://www.makelinux.net/books/lkd2/ch09lev1sec10

Comment by Anup Halarnkar [ 18/May/15 ]

Thanks Jorik.
I built with the option you mentioned and received same errors. I just checked this link on official Red Hat website

https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Storage_Administration_Guide/writebarrieronoff.html#writebarrfilesyserrors

Any idea on how this option of turning off write barrier could help or not?

Thanks,
Anup

Comment by Jorik Blaas [ 18/May/15 ]

v8 by default isn't available on power8, so that is causing a compilation failure.

When compiling with scons --js-engine=none --allocator=system

The error becomes different once again, due to an unimplemented WRITE_BARRIER primitive.

gcc -o build/linux2/allocator_system/third_party/wiredtiger/src/block/block_ext.o -c -std=c99 -fPIC -fno-strict-aliasing -ggdb -pthread -Wall -Wsign-compare -Wno-unknown-pragmas -Winvalid-pch -pipe -Werror -O3 -Wno-unused-local-typedefs -Wno-unused-function -Wno-deprecated-declarations -Wno-unused-but-set-variable -Wno-missing-braces -fno-builtin-memcmp -DBOOST_ALL_NO_LIB -D_SCONS -DMONGO_EXPOSE_MACROS -DSUPPORT_UTF8 -DMONGO_OPTIMIZED_BUILD -DMONGO_BYTE_ORDER=1234 -D_FILE_OFFSET_BITS=64 -DMONGO_HAVE___THREAD -DMONGO_HAVE_CXX11_ATOMICS -DMONGO_HAVE_HEADER_UNISTD_H -DMONGO_HAVE_POSIX_MONOTONIC_CLOCK -DMONGO_HAVE_EXECINFO_BACKTRACE -D_GNU_SOURCE -DHAVE_BUILTIN_EXTENSION_ZLIB -DHAVE_BUILTIN_EXTENSION_SNAPPY -Ibuild/linux2/allocator_system/third_party/wiredtiger -Isrc/third_party/wiredtiger -Isrc/third_party/snappy-1.1.2 -Isrc/third_party/zlib-1.2.8 -Ibuild/linux2/allocator_system/third_party/wiredtiger/src/include -Isrc/third_party/wiredtiger/src/include -Ibuild/linux2/allocator_system/third_party/wiredtiger/build_linux -Isrc/third_party/wiredtiger/build_linux src/third_party/wiredtiger/src/block/block_ext.c
In file included from src/third_party/wiredtiger/src/include/wt_internal.h:279:0,
from src/third_party/wiredtiger/src/async/async_api.c:9:
src/third_party/wiredtiger/src/include/gcc.h:162:2: error: #error "No write barrier implementation for this hardware"
#error "No write barrier implementation for this hardware"
^
In file included from src/third_party/wiredtiger/src/include/wt_internal.h:331:0,
from src/third_party/wiredtiger/src/async/async_api.c:9:
src/third_party/wiredtiger/src/include/txn.i: In function '__wt_txn_am_oldest':
src/third_party/wiredtiger/src/include/txn.i:384:2: error: implicit declaration of function 'WT_READ_BARRIER' [-Werror=implicit-function-declaration]
WT_ORDERED_READ(session_cnt, conn->session_cnt);
^

Comment by Anup Halarnkar [ 18/May/15 ]

Hi Sam,
The nature of the error has changed after applying your tweak (scons mongod --allocator=system). Please find the log below,

g++ -o build/PowerPC/allocator_system/third_party/snappy-1.1.2/snappy-sinksource.o -c -Wnon-virtual-dtor -Woverloaded-virtual -std=c++11 -fPIC -fno-strict-aliasing -ggdb -pthread -Wall -Wsign-compare -Wno-unknown-pragmas -Winvalid-pch -Werror -O2 -Wno-unused-local-typedefs -Wno-unused-function -Wno-deprecated-declarations -Wno-unused-but-set-variable -Wno-missing-braces -fno-builtin-memcmp -Wno-sign-compare -Wno-unused-function -DPCRE_STATIC -Isrc/third_party/snappy-1.1.2 -Ibuild/PowerPC/allocator_system -Isrc src/third_party/snappy-1.1.2/snappy-sinksource.cc
Generating placeholder library build/PowerPC/allocator_system/third_party/snappy-1.1.2/libsnappy.a
Skipping ranlib for build/PowerPC/allocator_system/third_party/snappy-1.1.2/libsnappy.a
g++ -o build/PowerPC/allocator_system/third_party/v8/src/x64/assembler-x64.o -c -Wnon-virtual-dtor -Woverloaded-virtual -std=c++11 -fPIC -fno-strict-aliasing -ggdb -pthread -Wsign-compare -Wno-unknown-pragmas -Winvalid-pch -O2 -Wno-unused-local-typedefs -Wno-unused-function -Wno-deprecated-declarations -Wno-unused-but-set-variable -Wno-missing-braces -fno-builtin-memcmp -ansi -pedantic -Wno-unused-parameter -DPCRE_STATIC -DV8_TARGET_ARCH_X64 -DENABLE_DEBUGGER_SUPPORT -Isrc/third_party/v8/src src/third_party/v8/src/x64/assembler-x64.cc
In file included from src/third_party/v8/src/v8globals.h:31:0,
from src/third_party/v8/src/v8.h:53,
from src/third_party/v8/src/x64/assembler-x64.cc:28:
src/third_party/v8/src/globals.h:90:2: error: #error Host architecture was not detected as supported by v8
#error Host architecture was not detected as supported by v8
^
src/third_party/v8/src/globals.h:116:2: error: #error Target architecture x64 is only supported on x64 host
#error Target architecture x64 is only supported on x64 host
^
In file included from src/third_party/v8/src/platform.h:81:0,
from src/third_party/v8/src/v8utils.h:32,
from src/third_party/v8/src/v8.h:56,
from src/third_party/v8/src/x64/assembler-x64.cc:28:
src/third_party/v8/src/atomicops.h:164:2: error: #error "Atomic operations are not supported on your platform"
#error "Atomic operations are not supported on your platform"
^
In file included from src/third_party/v8/src/lazy-instance.h:94:0,
from src/third_party/v8/src/platform.h:82,
from src/third_party/v8/src/v8utils.h:32,
from src/third_party/v8/src/v8.h:56,
from src/third_party/v8/src/x64/assembler-x64.cc:28:
src/third_party/v8/src/once.h: In function 'void v8::internal::CallOnce(v8::internal::OnceType*, v8::internal::NoArgFunction)':
src/third_party/v8/src/once.h:106:24: error: cannot convert 'v8::internal::OnceType*

{aka long int*}' to 'const volatile Atomic32* {aka const volatile int*}' for argument '1' to 'v8::internal::Atomic32 v8::internal::Acquire_Load(const volatile Atomic32*)'
if (Acquire_Load(once) != ONCE_STATE_DONE) {
^
src/third_party/v8/src/once.h: In function 'void v8::internal::CallOnce(v8::internal::OnceType*, typename v8::internal::OneArgFunction<Arg*>::type, Arg*)':
src/third_party/v8/src/once.h:115:24: error: cannot convert 'v8::internal::OnceType* {aka long int*}

' to 'const volatile Atomic32*

{aka const volatile int*}

' for argument '1' to 'v8::internal::Atomic32 v8::internal::Acquire_Load(const volatile Atomic32*)'
if (Acquire_Load(once) != ONCE_STATE_DONE) {
^
In file included from src/third_party/v8/src/incremental-marking.h:32:0,
from src/third_party/v8/src/heap.h:35,
from src/third_party/v8/src/elements.h:33,
from src/third_party/v8/src/objects-inl.h:38,
from src/third_party/v8/src/v8.h:60,
from src/third_party/v8/src/x64/assembler-x64.cc:28:
src/third_party/v8/src/execution.h: At global scope:
src/third_party/v8/src/execution.h:262:74: error: a function call cannot appear in a constant-expression
static const uintptr_t kInterruptLimit = V8_UINT64_C(0xfffffffffffffffe);
^
src/third_party/v8/src/execution.h:263:72: error: a function call cannot appear in a constant-expression
static const uintptr_t kIllegalLimit = V8_UINT64_C(0xfffffffffffffff8);
^
In file included from src/third_party/v8/src/isolate.h:44:0,
from src/third_party/v8/src/elements.h:34,
from src/third_party/v8/src/objects-inl.h:38,
from src/third_party/v8/src/v8.h:60,
from src/third_party/v8/src/x64/assembler-x64.cc:28:
src/third_party/v8/src/optimizing-compiler-thread.h: In constructor 'v8::internal::OptimizingCompilerThread::OptimizingCompilerThread(v8::internal::Isolate*)':
src/third_party/v8/src/optimizing-compiler-thread.h:51:66: error: cannot convert 'volatile AtomicWord*

{aka volatile long int*}

' to 'volatile Atomic32*

{aka volatile int*}

' for argument '1' to 'void v8::internal::NoBarrier_Store(volatile Atomic32*, v8::internal::Atomic32)'
NoBarrier_Store(&stop_thread_, static_cast<AtomicWord>(false));
^
In file included from src/third_party/v8/src/macro-assembler.h:50:0,
from src/third_party/v8/src/x64/assembler-x64.cc:32:
src/third_party/v8/src/x64/assembler-x64.h: In function 'bool v8::internal::is_uint32(int64_t)':
src/third_party/v8/src/x64/assembler-x64.h:49:60: error: 'V8_UINT64_C' was not declared in this scope
static const uint64_t kMaxUInt32 = V8_UINT64_C(0xffffffff);
^
src/third_party/v8/src/x64/assembler-x64.h: In function 'bool v8::internal::is_int32(int64_t)':
src/third_party/v8/src/x64/assembler-x64.h:54:58: error: 'V8_INT64_C' was not declared in this scope
static const int64_t kMinInt32 = -V8_INT64_C(0x80000000);
^
src/third_party/v8/src/x64/assembler-x64.h: In function 'bool v8::internal::uint_is_int32(uint64_t)':
src/third_party/v8/src/x64/assembler-x64.h:59:59: error: 'V8_UINT64_C' was not declared in this scope
static const uint64_t kMaxInt32 = V8_UINT64_C(0x7fffffff);
^
src/third_party/v8/src/x64/assembler-x64.h: In function 'bool v8::internal::is_uint32(uint64_t)':
src/third_party/v8/src/x64/assembler-x64.h:64:60: error: 'V8_UINT64_C' was not declared in this scope
static const uint64_t kMaxUInt32 = V8_UINT64_C(0xffffffff);
^
src/third_party/v8/src/x64/assembler-x64.h: In static member function 'static bool v8::internal::CpuFeatures::IsSupported(v8::internal::CpuFeature)':
src/third_party/v8/src/x64/assembler-x64.h:462:40: error: 'V8_UINT64_C' was not declared in this scope
return (supported_ & (V8_UINT64_C(1) << f)) != 0;
^
scons: *** [build/PowerPC/allocator_system/third_party/v8/src/x64/assembler-x64.o] Error 1
scons: building terminated because of errors.

Thanks in advance,
Anup

Comment by Anup Halarnkar [ 18/May/15 ]

Hi Sam,
I have encountered same issue on ppc64. I will try the tweak you have mentioned and get back with results.
Thanks,
Anup

Comment by Sam Kleinman (Inactive) [ 15/May/15 ]

Hello,

Sorry for not getting back to you sooner. We've looked into this issue, but it looks like there's an interaction between the default allocator tcmalloc and gperftools on PPC/Power systems. If you can pass --allocator=system to scons when you build mongod does this work?

Regards,
sam

Generated at Thu Feb 08 03:44:54 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.