Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] MongoDB failed to build
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM
View previous topic :: View next topic  
Author Message
itachiluan
n00b
n00b


Joined: 11 Jan 2020
Posts: 3

PostPosted: Tue Jan 14, 2020 8:58 am    Post subject: [SOLVED] MongoDB failed to build Reply with quote

Hi, first of all thanks very much Gentoo ARM team for making such a good 64bit OS for Raspberry Pi.

I understand that all MongoDB versions are masked missing keywords for this OS, but since there's been a working mongoDB version available for ubuntu ARM64, I figured why not give it a go.

But the build has failed anyway.

My machine: Raspberry Pi 3B+

Below is my emerge --info

Code:

Portage 2.3.81 (python 3.6.9-final-0, default/linux/arm64/17.0/desktop, gcc-9.2.0, glibc-2.30-r3, 4.19.89-v8-edc6ef437bd6-bis+ aarch64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-4.19.89-v8-edc6ef437bd6-bis+-aarch64-with-gentoo-2.6
KiB Mem:      884832 total,    619824 free
KiB Swap:    1048572 total,    916996 free
Timestamp of repository gentoo: Sat, 14 Dec 2019 00:45:01 +0000
Head commit of repository gentoo: c5227a29c1272001ee4809bbced9020b57e899ca
Head commit of repository sakaki-tools: 36a2a3d5a7a0674782044cbcb5004d555ae4715e

Head commit of repository genpi64: 2f7e2e2517376e273431c7404a5bdef6c285f609

sh bash 5.0_p11
ld GNU ld (Gentoo 2.33.1 p1) 2.33.1
distcc 3.3.3 aarch64-unknown-linux-gnu [disabled]
app-shells/bash:          5.0_p11::gentoo
dev-lang/perl:            5.30.1::gentoo
dev-lang/python:          2.7.17::gentoo, 3.5.9::gentoo, 3.6.9-r1::genpi64, 3.7.4-r2::genpi64
dev-util/cmake:           3.16.1::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.6-r1::gentoo
sys-apps/openrc:          0.42.1-r2::genpi64
sys-apps/sandbox:         2.18::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r5::gentoo
sys-devel/automake:       1.16.1-r2::gentoo
sys-devel/binutils:       2.33.1::gentoo
sys-devel/gcc:            9.2.0-r2::gentoo
sys-devel/gcc-config:     2.1::gentoo
sys-devel/libtool:        2.4.6-r5::gentoo
sys-devel/make:           4.2.1-r4::gentoo
sys-kernel/linux-headers: 4.19::gentoo (virtual/os-headers)
sys-libs/glibc:           2.30-r3::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: rsync
    sync-uri: rsync://isshoni.org/gentoo-portage-pi64-gem
    priority: -1000
    sync-rsync-extra-opts:
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-max-age: 24
    sync-rsync-verify-metamanifest: yes

sakaki-tools
    location: /var/db/repos/sakaki-tools
    sync-type: git
    sync-uri: https://github.com/sakaki-/sakaki-tools.git
    masters: gentoo
    priority: 50

genpi64
    location: /var/db/repos/genpi64
    sync-type: git
    sync-uri: https://github.com/sakaki-/genpi64-overlay.git
    masters: gentoo
    priority: 100

ACCEPT_KEYWORDS="arm64 ~arm64"
ACCEPT_LICENSE="@FREE CC-Sampling-Plus-1.0"
CBUILD="aarch64-unknown-linux-gnu"
CFLAGS="-march=armv8-a+crc -mtune=cortex-a72 -ftree-vectorize -O2 -pipe"
CHOST="aarch64-unknown-linux-gnu"
CONFIG_PROTECT="/boot/cmdline.txt /boot/config.txt /boot/startup.sh /etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=armv8-a+crc -mtune=cortex-a72 -ftree-vectorize -O2 -pipe"
DISTDIR="/var/cache/distfiles"
EMERGE_DEFAULT_OPTS="--jobs=5 --load-average=4"
ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-O2"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg config-protect-if-modified distlocks ebuild-locks fixlafiles getbinpkg ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2"
GENTOO_MIRRORS="http://gentoo.osuosl.org/ http://trumpetti.atm.tut.fi/gentoo/ http://distfiles.gentoo.org"
LANG="en_GB.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j5 -l4"
PKGDIR="/var/cache/binpkgs"
PORTAGE_BINHOST="https://isshoni.org/pi64pie"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="X a52 aac acl acpi alsa arm64 berkdb bindist bluetooth branding bzip2 cairo cdda cdr cli consolekit crypt cups cxx dbus dri dts dvdr egl emboss encode exif fam ffmpeg flac fortran gdbm gif gles1 gles2 gpm gtk iconv icu ipv6 jpeg lcms ldap libnotify libtirpc lock mad mng mp3 mp4 mpeg ncurses nls nptl ogg opengl openmp pam pango pcre pdf png policykit ppds pulseaudio qt4 qt5 readline sdl seccomp spell split-usr ssl startup-notification svg tcpd thunar tiff truetype udev udisks unicode upower usb vorbis wxwidgets x264 xattr xcb xml xv xvid zlib" ADA_TARGET="gnat_2018" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_ARM="edsp neon thumb thumb2 v4 v5 v6 v7 v8 vfp vfp-d32 vfpv3 vfpv4" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="evdev synaptics" KERNEL="linux" L10N="en en-GB" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LLVM_TARGETS="WebAssembly BPF" NETBEANS_MODULES="apisupport cnd groovy gsf harness ide identity j2ee java mobility nb php profiler soa visualweb webcommon websvccommon xml" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-2" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_6" PYTHON_TARGETS="python2_7 python3_5 python3_6 python3_7" QEMU_SOFTMMU_TARGETS="aarch64 arm i386 x86_64" QEMU_USER_TARGETS="aarch64" RUBY_TARGETS="ruby24 ruby25" USERLAND="GNU" VIDEO_CARDS="fbdev vc4" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS



Somehow I couldn't post the topic with the complete build log, the headings and the error line are as follows:

Code:

* Package:    dev-db/mongodb-4.0.13
 * Repository: gentoo
 * Maintainer: ultrabug@gentoo.org
 * USE:        arm64 elibc_glibc kernel_linux ssl tools userland_GNU
 * FEATURES:   network-sandbox preserve-libs sandbox userpriv usersandbox
>>> Unpacking source...
>>> Unpacking mongodb-src-r4.0.13.tar.gz to /var/tmp/portage/dev-db/mongodb-4.0.13/work
>>> Source unpacked in /var/tmp/portage/dev-db/mongodb-4.0.13/work
>>> Preparing source in /var/tmp/portage/dev-db/mongodb-4.0.13/work/mongodb-src-r4.0.13 ...
 * Applying mongodb-3.6.1-fix-scons.patch ...
 [ ok ]
 * Applying mongodb-4.0.0-no-compass.patch ...
 [ ok ]
 * Applying mongodb-4.0.12-boost-1.71-cxxabi-include.patch ...
 [ ok ]
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/dev-db/mongodb-4.0.13/work/mongodb-src-r4.0.13 ...
>>> Source configured.
>>> Compiling source in /var/tmp/portage/dev-db/mongodb-4.0.13/work/mongodb-src-r4.0.13 ...
scons -j5 CC=aarch64-unknown-linux-gnu-gcc CXX=aarch64-unknown-linux-gnu-g++ --disable-warnings-as-errors --use-system-boost --use-system-pcre --use-system-snappy --use-system-stemmer --use-system-yaml --use-system-zlib --ssl core tools
scons: Reading SConscript files ...
 * Unable to trace static ELF: /sbin/ldconfig: /sbin/ldconfig -p
Mkdir("build/scons")
scons version: 3.1.1
python version: 2 7 17 'final' 0
Checking whether the C compiler works... yes
Checking whether the C++ compiler works... yes
Checking that the C++ compiler can link a C++ program... yes
Checking if C++ compiler "aarch64-unknown-linux-gnu-g++" is GCC... yes
Checking if C compiler "aarch64-unknown-linux-gnu-gcc" is GCC... yes
Detected a aarch64 processor
Checking if target OS linux is supported by the toolchain... yes
Checking if C compiler is GCC 5.3.0 or newer...yes
Checking if C++ compiler is GCC 5.3.0 or newer...yes
Checking if C compiler supports -Wno-unused-local-typedefs... yes
Checking if C compiler supports -Wno-unused-function... yes
Checking if C compiler supports -Wno-unused-private-field... no
Checking if C compiler supports -Wno-deprecated-declarations... yes
Checking if C compiler supports -Wno-tautological-constant-out-of-range-compare... no
Checking if C compiler supports -Wno-tautological-constant-compare... no
Checking if C compiler supports -Wno-tautological-unsigned-zero-compare... no
Checking if C compiler supports -Wno-tautological-unsigned-enum-zero-compare... no
Checking if C compiler supports -Wno-unused-const-variable... yes
Checking if C compiler supports -Wno-unused-but-set-variable... yes
Checking if C compiler supports -Wno-missing-braces... yes
Checking if C compiler supports -Wno-inconsistent-missing-override... no
Checking if C compiler supports -Wno-potentially-evaluated-expression... no
Checking if C++ compiler supports -Wpessimizing-move... yes
Checking if C++ compiler supports -Wredundant-move... yes
Checking if C++ compiler supports -Wno-maybe-uninitialized... yes
Checking if C++ compiler supports -Wno-undefined-var-template... no
Checking if C++ compiler supports -Wno-instantiation-after-specialization... no
Checking if C compiler supports -Wno-unused-lambda-capture... no
Checking if C compiler supports -Wno-exceptions... no
Checking -Wnon-virtual-dtor for false positives... no
Checking if C compiler supports -fstack-protector-strong... yes
Checking if we are using libstdc++... yes
Checking if C++ compiler supports -std=c++14... yes
Checking if C compiler supports -std=c11... yes
WARNING: System versions of C++ libraries must be compiled with C++14 support
Checking for C++14... yes
Checking for memset_s... no
Checking for C function strnlen()... yes
Checking for libstdc++ 5.3.0 or better... yes
Checking if we are on a POSIX system... yes
Checking if the POSIX monotonic clock is supported... yes
Checking off_t is 8 bytes... yes
Checking if linker supports -fuse-ld=gold... yes
Checking if linker supports -Wl,--build-id... yes
Checking if linker supports -Wl,--hash-style=gnu... yes
Checking if linker supports -Wl,-z,noexecstack... yes
Checking if linker supports -Wl,--warn-execstack... yes
Checking if linker supports -Wl,-z,relro... yes
Checking for glibc with non-broken _FORTIFY_SOURCE...yes
Checking if C compiler supports -fno-builtin-memcmp... yes
Checking for storage class thread_local yes
Checking for C++14 std::enable_if_t support...yes
Checking for C++14 std::make_unique support... yes
Checking if pthread_setname_np is supported... yes
Checking for SSLeay_version(0) in C library crypto... yes
Checking for SSL_version(NULL) in C library ssl... yes
Checking that linking to OpenSSL works...yes
Checking whether FIPS_mode_set is declared... yes
Checking whether d2i_ASN1_SEQUENCE_ANY is declared... yes
Checking if SSL_[CTX_]_set_ecdh_auto is supported... yes
Using SSL Provider: openssl
Checking for curl_global_init(0) in C library curl... yes
Checking for C library pcre... yes
Checking for C library pcrecpp... yes
Checking for C library snappy... yes
Checking for C library z... yes
Checking for C library stemmer... yes
Checking for C library yaml-cpp... yes
Checking for C++ header file boost/filesystem/operations.hpp... yes
Checking if system boost version is 1.49 or newer...yes
Checking for C++ library boost_filesystem-mt... yes
Checking for C++ library boost_program_options-mt... yes
Checking for C++ library boost_system-mt... yes
Checking for C++ library boost_iostreams-mt... yes
Checking for C library rt... yes
Checking for C library dl... yes
Checking for C++ header file execinfo.h... yes
Checking whether backtrace is declared... yes
Checking whether backtrace_symbols is declared... yes
Checking whether backtrace_symbols_fd is declared... yes
Checking for C library pcap... yes
Checking if std::atomic<int64_t> works... yes
Checking if std::atomic<uint64_t> works... yes
Checking if std::atomic<int32_t> works... yes
Checking if std::atomic<uint32_t> works... yes
Checking for extended alignment 64 for concurrency types... yes
Checking for mongoc_get_major_version() in C library mongoc-1.0... no
*** Run 'pip2 install --user regex' to speed up error code checking
Checking if __malloc_hook is declared volatile... yes
Checking for C function fallocate()... yes
Checking for C function sync_file_range()... yes
Checking for C header file arm_neon.h... yes
scons: done reading SConscript files.
scons: Building targets ...



Code:

scons: building terminated because of errors.
build/opt/mongo/db/pipeline/document_source_internal_inhibit_optimization.o failed: Error 1
 * ERROR: dev-db/mongodb-4.0.13::gentoo failed (compile phase):
 *   escons failed.
 *
 * Call stack:
 *     ebuild.sh, line  125:  Called src_compile
 *   environment, line 2969:  Called escons 'CC=aarch64-unknown-linux-gnu-gcc' 'CXX=aarch64-unknown-linux-gnu-g++' '--disable-warnings-as-errors' '--use-system-boost' '--use-system-pcre' '--use-system-snappy' '--use-system-stemmer' '--use-system-yaml' '--use-system-zlib' '--ssl' 'core' 'tools'
 *   environment, line 1278:  Called die
 * The specific snippet of code:
 *                   die -n "escons failed."


I'm hoping someone could give me a hand, thanks!!

Update: The complete build log:
https://gist.github.com/itachiluan/3aa7a404ca2fbbdd3005caf2295efc3b


Last edited by itachiluan on Wed Jan 15, 2020 2:42 am; edited 1 time in total
Back to top
View user's profile Send private message
guitou
Guru
Guru


Joined: 02 Oct 2003
Posts: 433
Location: France

PostPosted: Tue Jan 14, 2020 1:10 pm    Post subject: Reply with quote

Hello

Code:
aarch64-unknown-linux-gnu-g++: fatal error: Killed signal terminated program cc1plus

Looks like an OOM kill

++
Gi)
Back to top
View user's profile Send private message
Sakaki
Guru
Guru


Joined: 21 May 2014
Posts: 359

PostPosted: Tue Jan 14, 2020 5:23 pm    Post subject: Reply with quote

Hi itachiluan,

Not sure about v4.0.13, but I've just built v4.2.2 of mongodb successfully and pushed the resulting binary package to the gentoo-on-rpi-64bit project's binhost (here). Build was on a 4GiB RPi4B (natively) running the v1.5.3 image.

As it appears you are also using this image (or an earlier version), you can prepare to use this by first issuing:
Code:
demouser@pi64 ~ $ sudo genup

Wait for that to bring your machine fully up to date (may take several hours!), then run:
Code:
demouser@pi64 ~ $ sudo dispatch-conf

to deal with any configuration file updates. Once complete, reboot.

Once restarted, then just issue:
Code:
demouser@pi64 ~ $ sudo emerge -v dev-db/mongodb

and with luck mongodb (+deps) should be installed from the binhost.

Edited to fix missing 'sudo'.
_________________
Regards,

sakaki


Last edited by Sakaki on Wed Jan 15, 2020 9:56 am; edited 1 time in total
Back to top
View user's profile Send private message
itachiluan
n00b
n00b


Joined: 11 Jan 2020
Posts: 3

PostPosted: Wed Jan 15, 2020 2:42 am    Post subject: Thanks! Reply with quote

Hi Sakaki,

Thanks so much!

I can confirm that your binary for MongoDB 4.2.2 works for me perfectly, really appreciate your help!

guitou wrote:
Hello

Code:
aarch64-unknown-linux-gnu-g++: fatal error: Killed signal terminated program cc1plus

Looks like an OOM kill

++
Gi)


Hi guitou,
Thanks so much for the quick response, although the problem has been solved already, for future reference, say if I came across a OOM(I'm assuming it's the acronym for out-of-memory) kill again, how should I cope with this situation? (since there is a 1GB default swap in my system).
I know this might be a silly question but I'm a complete noob for Gentoo.. or even Linux in general.

Thanks!
Back to top
View user's profile Send private message
guitou
Guru
Guru


Joined: 02 Oct 2003
Posts: 433
Location: France

PostPosted: Wed Jan 15, 2020 12:49 pm    Post subject: Reply with quote

Hi.

Regarding memory consuming emerges (yep, your assumption is right about the acronym), would I try to give you detailed explanations, I would then probably mislead you more than help (not because of you, but rather due to my poor teaching ability). Anyway, as a general rule, you could consider the following options (and easily find help on the subjects):
- lower the number of simultaneous jobs (the -j option for MAKE_OPTS): if having an OOMKill even with -j1 option, then no choice but go for second option
- Increase swap space (you may simply create and activate a new swap partition for example, provided you still have free space on disk)

Anyway, since you are OK with binary package, you may as well avoid worrying about that ;)

++
Gi)
Back to top
View user's profile Send private message
Sakaki
Guru
Guru


Joined: 21 May 2014
Posts: 359

PostPosted: Wed Jan 15, 2020 1:06 pm    Post subject: Reply with quote

A fallback option (since swap can become extremely slow if used heavily) is to build memory-intensive packages (for arm64/aarch64) on your PC, via a binfmt_misc QEMU chroot. It is how I emerge e.g. the Chromium browser for the above binhost.

For details, please see this project's open wiki, here.
_________________
Regards,

sakaki
Back to top
View user's profile Send private message
itachiluan
n00b
n00b


Joined: 11 Jan 2020
Posts: 3

PostPosted: Thu Jan 16, 2020 7:19 am    Post subject: Reply with quote

Hi guitou,

Thanks very much for the reply, and yes I would prefer straight-forward answers since I probably couldn't understand the detailed one anyway :oops: , your hints should be well enough for me to get going, really appreciated!


Hi Sakaki,

Thanks so much for the article, yes it would be really nice to redistribute compilations to my PC, will check it out!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum