ยง2023-07-25

  1. Requirements
$ sudo pacman -Syyuu
$ sudo pacman -S base-devel
resolving dependencies...
looking for conflicting packages...

Packages (19) autoconf-2.71-4  automake-1.16.5-2  bison-3.8.2-5  debugedit-5.0-5  fakeroot-1.31-2  flex-2.6.4-5  gc-8.2.4-1  gcc-12.1.0-2.1  guile-3.0.9-1  libisl-0.26-1  libmpc-1.3.1-1  libtool-2.4.7-2  m4-1.4.19-3  make-4.4.1-2  patch-2.7.6-10  pkgconf-1.8.1-1  texinfo-7.0.3-1  which-2.21-6  base-devel-1-1

Total Download Size:    46.56 MiB
Total Installed Size:  224.22 MiB

:: Proceed with installation? [Y/n] 

$ $ sudo pacman -S openssl xz  git python3
warning: openssl-3.1.1-1 is up to date -- reinstalling
warning: xz-5.4.3-1 is up to date -- reinstalling
warning: python-3.11.3-2 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...

Packages (7) perl-error-0.17029-4  perl-mailtools-2.21-6  perl-timedate-2.33-4  git-2.41.0-1  openssl-3.1.1-1  python-3.11.3-2  xz-5.4.3-1

Total Download Size:    24.99 MiB
Total Installed Size:  129.82 MiB
Net Upgrade Size:       41.09 MiB

:: Proceed with installation? [Y/n] 
$ gcc --version
gcc (GCC) 12.1.0
  1. Python3
$ python3 --version
Python 3.11.3
$ python3 -m venv ~/PYTHON/3.11.3
$ source ~/PYTHON3.11.3/bin/activate
(PYTHON3.11.3) [alexlai@n2Mnjaro ~]$ which pip3
/opt/xfs/home/alexlai/PYTHON3.11.3/bin/pip3
  1. 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'
  1. pip requirements
$ pip3 install -r etc/pip/compile-requirements.txt   <-- requirements have been changed using 

Successfully installed Cheetah3-3.2.6.post1 PyYAML-6.0 anyio-3.7.1 boto3-1.28.10 botocore-1.31.10 certifi-2023.7.22 
cffi-1.15.1 charset-normalizer-2.0.12 cryptography-36.0.2 distro-1.8.0 dnspython-2.4.0 gitdb-4.0.10 gitpython-3.1.32 
h11-0.14.0 httpcore-0.17.3 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 sniffio-1.3.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.

r7.1.x

$ python3 -m venv <venv_path> --prompt mongo # Optional (venv_path can be a path of your choice)
$ source <venv_path>/bin/activate # Optional (might be slightly different based on the your shell)
$ python3 -m pip install 'poetry==1.5.1'
$ python3 -m poetry install --no-root --sync
  1. ~/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
# 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 -j6 --ssl --linker=gold CFLAGS="-march=armv8-a+crc -mtune=generic" --disable-warnings-as-errors >log 2>&1 &
time python3 buildscripts/scons.py install-core -j6 --ssl --linker=gold CFLAGS="-march=armv8-a+crc -mtune='cortex-a73.cortex-a53' " --disable-warnings-as-errors >log 2>&1 &

# CFLAGS="-march=armv8-a+crc -mtune='cortex-a73.cortex-a53' " 2023-07-25
#
#   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)
#
  1. make it
(PYTHON-3.10.6) alexlai@hc4Jammy:~/build/mongo$ ~/scripts/buildMongo.sh

ps aux ; and look for python3 buildscripts/scons.py ... and write down the pid i.e. 1332 then tail -f log to see the progress


real  3526m39943s
user  4219m57985s
sys   2985557s

[alexlai@n2Mnjaro ~]$ cd build/mongo/build/install/bin/
[alexlai@n2Mnjaro bin]$ ls
mongod  mongos  resmoke.py

[alexlai@n2Mnjaro bin]$ ls mongod mongos resmoke.py

[alexlai@n2Mnjaro bin]$ ./mongos --version mongos version v7.0.0-rc8 Build Info: { "version": "7.0.0-rc8", "gitVersion": "27da922959c12df48ae2ecf8aad0f37f42f71451", "openSSLVersion": "OpenSSL 3.1.1 30 May 2023", "modules": [], "allocator": "tcmalloc", "environment": { "distarch": "aarch64", "target_arch": "aarch64" } }

[alexlai@n2Mnjaro bin]$ ./mongod --version db version v7.0.0-rc8 Build Info: { "version": "7.0.0-rc8", "gitVersion": "27da922959c12df48ae2ecf8aad0f37f42f71451", "openSSLVersion": "OpenSSL 3.1.1 30 May 2023", "modules": [], "allocator": "tcmalloc", "environment": { "distarch": "aarch64", "target_arch": "aarch64" } }

[alexlai@n2Mnjaro bin]$ ls -l total 6520432 -rwxr-xr-x 2 alexlai alexlai 4250577184 Jul 28 02:30 mongod-aarch64-7.0.0-rc8-MnJaroN2 -rwxr-xr-x 2 alexlai alexlai 2426337936 Jul 28 01:56 mongos-aarch64-7.0.0-rc8-MnJaroN2 -rwxr--r-- 2 alexlai alexlai 1782 Jul 26 02:38 resmoke.py [alexlai@n2Mnjaro bin]$ strip --strip-all mongod-aarch64-7.0.0-rc8-MnJaroN2 [alexlai@n2Mnjaro bin]$ strip --strip-all mongos-aarch64-7.0.0-rc8-MnJaroN2 [alexlai@n2Mnjaro bin]$ ls -l total 262020 -rwxr-xr-x 2 alexlai alexlai 121585888 Jul 28 04:30 mongod-aarch64-7.0.0-rc8-MnJaroN2 -rwxr-xr-x 2 alexlai alexlai 88134176 Jul 28 04:30 mongos-aarch64-7.0.0-rc8-MnJaroN2 -rwxr--r-- 2 alexlai alexlai 1782 Jul 26 02:38 resmoke.py