§2023-07-26
- x8664Arch.yushei.com.tw
the precompiled version of https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu2204-7.0.0-rc8.tgz, will have
Illegal instruction (core dumped)
Note: In order to compile C-based Python modules, you'll also need the Python and OpenSSL C headers. Run:
Fedora/RHEL - dnf install python3-devel openssl-devel
Ubuntu (20.04 and newer)/Debian (Bullseye and newer) - apt install python-dev-is-python3 libssl-dev
Ubuntu (18.04 and older)/Debian (Buster and older) - apt install python3.7-dev libssl-dev
$ sudo pacman -Syyuu
$ sudo pacman -Sy base-devel
- Python3
$ python3 --version
Python 3.11.3
[alexlai@x8664Arch bin]$ python3 -m venv ~/PYTHON-3.11.3
[alexlai@x8664Arch bin]$ source ~/PYTHON-3.11.3/bin/activate
(PYTHON-3.11.3) [alexlai@x8664Arch bin]$ which pip3
/home/alexlai/PYTHON-3.11.3/bin/pip3
(PYTHON-3.11.3) [alexlai@x8664Arch bin]$ pip3 cache purge
Files removed: 46
- git clone mongo
$ mkdir -p build && cd $_
$ git clone https://github.com/mongodb/mongo.git && cd mongo
$ git checkout r7.0.0-rc8 -b test
Updating files: 100% (10380/10380), done.
Switched to a new branch 'test'
- pip requirements
pip3 cache purge
first
$ pip3 install -r etc/pip/compile-requirements.txt
...
Successfully installed Cheetah3-3.2.6.post1 PyYAML-6.0 boto3-1.28.12 botocore-1.31.12 certifi-2023.7.22 cffi-1.15.1
charset-normalizer-2.0.12 cryptography-36.0.2 distro-1.8.0 dnspython-2.4.1 gitdb-4.0.10 gitpython-3.1.32 idna-3.4
jmespath-1.0.1 mongo-ninja-python-1.11.1.5 mongo-tooling-metrics-1.0.8 packaging-21.3 psutil-5.8.0 pycparser-2.21
pydantic-1.10.12 pymongo-4.3.3 pymongo-auth-aws-1.1.0 pyparsing-3.1.0 python-dateutil-2.8.2 regex-2021.11.10
requests-2.26.0 requirements_parser-0.3.1 s3transfer-0.6.1 setuptools-58.5.3 six-1.16.0 smmap-5.0.0
types-PyYAML-6.0.12.11 types-setuptools-57.4.18 typing-extensions-4.7.1 urllib3-1.26.16
[notice] A new release of pip available: 22.3.1 -> 23.2.1
[notice] To update, run: pip install --upgrade pip
if pip install psutil errors then
sudo apt install gcc python3-dev
will fix it.
- ~/scripts/buildMongo.sh as (
chmod a+x buildMongo.sh
)
#!/bin/bash
# -j number of CPUS, no plus 2, odroid-n2 -j 6, odroid-hc4 -j4, orangePi5 -j 8, odroid-h2 -j 4, x8664.yushei.com.tw -j4
# execute form git clone https://github.com/mongodb/mongo.git && cd mongo
# under python3 eviromental control
# git checkout r7.0.0-rc8 -b test
# time python3 buildscripts/scons.py install-core -j 4 --ssl --linker=gold CFLAGS="-march=armv8-a+crc -mtune=generic" --disable-warnings-as-errors >log 2>&1 &
# time python3 buildscripts/scons.py install-core -j 4 --ssl --linker=gold --disable-warnings-as-errors >log 2>&1 &
# 2023-07-26
# real 510m26.910s
# user 1795m21.199s
# sys 97m27.014s
# But Illegal instruction (core dumped)
#
# 2023-07-27
time python3 buildscripts/scons.py install-core -j 4 --ssl --linker=gold CXXFLAGS="-march=x86-64 -mtune=generic -O2" --disable-warnings-as-errors >log 2>&1 &
#
#
# install-mongod
# install-mongos
# install-core (includes only mongod and mongos)
# install-servers (includes all server components)
# install-devcore (includes mongod, mongos, and jstestshell (formerly mongo shell))
# install-all (includes a complete end-user distribution and tests)
# install-all-meta (absolutely everything that can be built and installed)
#
- make it
(PYTHON-3.10.6) alexlai@hc4Jammy:~/build/mongo$ ~/scripts/buildMongo.sh
...
g++ @/tmp/tmpvelkdbjc.lnk
Install file: "build/opt/mongo/s/mongos" as "build/install/bin/mongos"
Install file: "build/opt/mongo/db/mongod" as "build/install/bin/mongod"
scons: done building targets.
real 510m26.910s
user 1795m21.199s
sys 97m27.014s
ps aux ; and look for python3 buildscripts/scons.py ... and write down the pid i.e. 1332
thentail -f log
to see the progress
¶ Result
- 2023-07-27 x8664Arch.yushei.net
- out of space error, when compiling mongo it consumes a lot of disk space
df -sh *
- move into /opt/xfs
Traceback (most recent call last):
File "/home/alexlai/build/mongo/src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/dblite.py", line 143, in __del__
File "/home/alexlai/build/mongo/src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/dblite.py", line 140, in close
File "/home/alexlai/build/mongo/src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/dblite.py", line 148, in sync
OSError: [Errno 28] No space left on device
real 592m1.748s
user 2162m38.627s
sys 105m58.523s
- 2023-07-28 15:00
- stopped with the followings
time python3 buildscripts/scons.py install-core -j 4 --ssl --linker=gold --disable-warnings-as-errors >log 2>&1 &
Internal Error: no cycle found for node build/opt/mongo/db/libgeneric_cursor.a (<SCons.Node.FS.File object at 0x558a8dc96e30>) in state pending
Internal Error: no cycle found for node build/opt/third_party/icu4c-57.1/source/i18n/standardplural.o (<SCons.Node.FS.File object at 0x558a8d740e40>) in state pending
Internal Error: no cycle found for node build/opt/mongo/shell/linenoise_utf8.o (<SCons.Node.FS.File object at 0x558a8e628a90>) in state pending
Internal Error: no cycle found for node build/opt/mongo/db/session/session_killer.o (<SCons.Node.FS.File object at 0x558a8e118eb0>) in state pending
Internal Error: no cycle found for node build/opt/third_party/icu4c-57.1/source/i18n/sortkey.o (<SCons.Node.FS.File object at 0x558a8d740720>) in state pending
Internal Error: no cycle found for node build/opt/mongo/util/libperiodic_runner_impl.a (<SCons.Node.FS.File object at 0x558a8e730f90>) in state pending
Internal Error: no cycle found for node build/opt/mongo/scripting/libscripting.a (<SCons.Node.FS.File object at 0x558a8e309be0>) in state pending
File "/opt/xfs/mongo/src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Taskmaster.py", line 1076, in cleanup
build/opt/mongo/db/free_mon/free_mon_options.o failed: Error 1
- 2023-07-29 05:30 started with
- time python3 buildscripts/scons.py install-core -j 4 --ssl --linker=gold CFLAGS="-march=x86-64 -mtune=generic -O2" --disable-warnings-as-errors >log 2>&1 &
- error at 2023-07-29 15:30
-Wno-interference-size'
src/mongo/util/aligned.h:170:99: warning: use of 'std::hardware_destructive_interference_size' [-Winterference-size]
170 | aligned_detail::roundUpByStep<stdx::hardware_destructive_interference_size>(sizeof(T))>;
| ^
src/mongo/util/aligned.h:205:85: warning: use of 'std::hardware_destructive_interference_size' [-Winterference-size]
205 | stdx::hardware_constructive_interference_size>;
| ^
src/mongo/util/aligned.h:205:85: warning: use of 'std::hardware_destructive_interference_size' [-Winterference-size]
scons: building terminated because of errors.
build/opt/mongo/db/free_mon/free_mon_options.o failed: Error 1