[SERVER-68043] Unable to build on ppc64le Created: 14/Jul/22  Updated: 20/Jul/22  Resolved: 20/Jul/22

Status: Closed
Project: Core Server
Component/s: Build
Affects Version/s: 5.3.0, 6.0.0-rc0
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Aiman Shaharuddin Assignee: Unassigned
Resolution: Done Votes: 0
Labels: RHEL, ppc64le
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:
  1. uname -a
    Linux p1313-pvm1 4.18.0-348.7.1.el8_5.ppc64le #1 SMP Wed Dec 8 21:26:34 EST 2021 ppc64le ppc64le ppc64le GNU/Linux
  1. cat /etc/redhat-release
    Red Hat Enterprise Linux release 8.6 (Ootpa)

Attachments: Text File build-2-error.txt     Text File build-3-error.txt     Text File build-error.txt    
Issue Links:
Related
related to SERVER-68160 Add note to building.md to consider u... Closed
Operating System: ALL
Steps To Reproduce:

dnf update -ydnf install -y git gcc gcc-c++ openssl openssl-devel bzip2 bzip2-devel libffi libffi-devel zlib zlib-devel xz xz-devel make autoconf automake curl curl-develcd /usr/srcwget https://www.python.org/ftp/python/3.7.13/Python-3.7.13.tgztar xzf Python-3.7.13.tgzcd Python-3.7.13./configure --enable-optimizationsmake altinstallupdate-alternatives --install /usr/bin/python3 python3 /usr/local/bin/python3.7 1update-alternatives --set python3 /usr/local/bin/python3.7python3 -m pip install --upgrade pipcd ..git clone https://github.com/mongodb/mongo.gitcd mongo/git fetch origingit switch -c v5.3 origin/v5.3python3 -m pip install -r etc/pip/compile-requirements.txtpython3 buildscripts/scons.py DESTDIR=/opt/mongo install-mongod --disable-warnings-as-errors

Participants:

 Description   

As per mentioned on https://github.com/mongodb/mongo/blob/v5.3/docs/building.md

MongoDB supports the following architectures: arm64, ppc64le, s390x, and x86-64. More detailed platform instructions can be found below.

I tried to build it but keep getting errors like:

 

{{{}g++: fatal error: Killed signal terminated program cc1plus
{}}}compilation terminated.

and

build/opt/mongo/db/query/sbe_stage_builder_index_scan.o failed: Error 1

 

Error as per attached



 Comments   
Comment by Githook User [ 20/Jul/22 ]

Author:

{'name': 'kelly-cs', 'email': 'likai31197@gmail.com', 'username': 'kelly-cs'}

Message: Note (-j1) for building on memory-constrained systems

Per https://jira.mongodb.org/browse/SERVER-68043, some users may have issues building from source on memory-constrained systems. This may manifest as an error:
g++: fatal error: Killed signal terminated program cc1plus.
Branch: j1-note-for-building
https://github.com/mongodb/mongo/commit/1aca85d73a4b64e0d49780198df87cdc81b9479b

Comment by Aiman Shaharuddin [ 14/Jul/22 ]

it works! I'll try with -j2 & -j3 later (and maybe more) Hopefully this is documented instead, at least in the FAQ section.

 

I'm not sure how to close this as resolve.

Comment by Daniel Moody [ 14/Jul/22 ]

you may be able to use -j2 or even -j3 with 32 GB. A single job should not take more than 16 GB, but this changes frequently as the code base changes.

Comment by Aiman Shaharuddin [ 14/Jul/22 ]

# cat /proc/meminfo | grep MemTotal
MemTotal:       32247552 kB

Let me try with -j1 option

Comment by Daniel Moody [ 14/Jul/22 ]

aiman.shaharuddin@gmail.com This message most likely means the system has run out of memory. Do you know the amount of memory available (use the command "cat /proc/meminfo | grep MemTotal")? It will need to be at least 16 GB to build, but 32 GB is a more realistic requirement.

Also, by default the build will use max cores for number of jobs to build with. Try building with -j1 to limit memory usage during the build.

Comment by Aiman Shaharuddin [ 14/Jul/22 ]

Not sure how to edit the Steps To Reproduce. So I'm posting it here instead:

 

  1. dnf update -y
  2. dnf install -y git gcc gcc-c++ openssl openssl-devel bzip2 bzip2-devel libffi libffi-devel zlib zlib-devel xz xz-devel make autoconf automake curl curl-devel
  3. cd /usr/src
  4. wget https://www.python.org/ftp/python/3.7.13/Python-3.7.13.tgz
  5. tar xzf Python-3.7.13.tgz
  6. cd Python-3.7.13
  7. ./configure --enable-optimizations
  8. make altinstall
  9. update-alternatives --install /usr/bin/python3 python3 /usr/local/bin/python3.7 1
  10. update-alternatives --set python3 /usr/local/bin/python3.7
  11. /usr/bin/python3 -m pip install --upgrade pip
  12. cd ..
  13. git clone https://github.com/mongodb/mongo.git
  14. cd mongo/
  15. git fetch origin
  16. git switch -c v5.3 origin/v5.3
  17. python3 -m pip install -r etc/pip/compile-requirements.txt
  18. python3 buildscripts/scons.py DESTDIR=/opt/mongo install-mongod --disable-warnings-as-errors
Generated at Thu Feb 08 06:09:43 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.