§2024-12-01

¶ 2024-12-02

      real   780m7.331s
      user  1818m56.729s
      sys    100m38.168s
      real   420m12.897s
      user  2348m10.470s
      sys    86m56.229s
   
$ ./mongod --version  <-- works in Jetson Orin Nano Board
49796 src/third_party/tcmalloc/dist/tcmalloc/system-alloc.cc:755] MmapAligned() failed - unable to allocate with tag (hint=0x4e8180000000, size=1073741824, alignment=1073741824) - is something limiting address placement?
49796 src/third_party/tcmalloc/dist/tcmalloc/arena.cc:48] CHECK in Alloc: FATAL ERROR: Out of memory trying to allocate internal tcmalloc data (bytes=131072, object-size=640); is something preventing mmap from succeeding (sandbox, VSS limitations)?
Aborted (core dumped)
alexlai@opi516G:/opt/xfs/alexlai/build/mongo/build/install/bin$ ls -al
total 8339520
drwxrwxr-x 2 alexlai alexlai         52 Dec  4 01:30 .
drwxrwxr-x 3 alexlai alexlai        100 Nov 23 20:57 ..
-rwxrwxr-x 2 alexlai alexlai 5238863368 Dec  4 01:29 mongod
-rwxrwxr-x 2 alexlai alexlai 3300796096 Dec  4 01:27 mongos
-rwxrw-r-- 2 alexlai alexlai       1782 Nov 23 20:57 resmoke.py
alexlai@opi516G:/opt/xfs/alexlai/build/mongo/build/install/bin$ strip --strip-all mongo*
alexlai@opi516G:/opt/xfs/alexlai/build/mongo/build/install/bin$ ls -al
total 393092
drwxrwxr-x 2 alexlai alexlai        52 Dec  4 05:04 .
drwxrwxr-x 3 alexlai alexlai       100 Nov 23 20:57 ..
-rwxrwxr-x 2 alexlai alexlai 143088144 Dec  4 05:04 mongod
-rwxrwxr-x 2 alexlai alexlai 111600336 Dec  4 05:04 mongos
-rwxrw-r-- 2 alexlai alexlai      1782 Nov 23 20:57 resmoke.py


- buildMongoDB.sh

#!/bin/bash

time nohup python3 buildscripts/scons.py install-core -j5 --ssl --linker=gold CFLAGS="-march=armv8-a+crc -mtune='cortex-a73.cortex-a53' " --disable-warnings-as-errors --release --wiredtiger >log 2>&1 &

time nohup python3 buildscripts/scons.py install-core -j5 --ssl --linker=gold --disable-warnings-as-errors --release --wiredtiger >log 2>&1 &

jetson Orin Nano outof memory error, -j4 failed

increase swap

the following will build binary to be run on Jeson Orin Nano, but not on other arm machine, such as odroid or orangePi

compile with CCFLAGS="-march=armv8.2-a -mtune=generic",

time nohup python3 buildscripts/scons.py install-core -j3 --ssl --linker=gold --disable-warnings-as-errors --release --wiredtiger >log 2>&1 &

try the following to builld for odroid and orangepi

time nohup python3 buildscripts/scons.py install-core -j3 --ssl --linker=gold CFLAGS="-march=armv8-a+crc -mtune='cortex-a73.cortex-a53' " --disable-warnings-as-errors --release --wiredtiger > log 2>&1 &


Jetson.yushei.net 192.168.48.229

alexlai@jetson:/build/Python-3.10.15$ uname -a Linux jetson 5.10.120-tegra #1 SMP PREEMPT Tue Aug 1 12:32:50 PDT 2023 aarch64 aarch64 aarch64 GNU/Linux alexlai@jetson:/build/Python-3.10.15$ cat /etc/os-release NAME="Ubuntu" VERSION="20.04.6 LTS (Focal Fossa)" ... alexlai@jetson:/build/Python-3.10.15$ gcc --version gcc (Ubuntu 9.4.0-1ubuntu120.04.2) 9.4.0``

  1. install requirement for compiling your own pyhton
sudo apt-get update && \
sudo apt-get install -y build-essential libbz2-dev libssl-dev libreadline-dev libsqlite3-dev libgdbm-dev libnss3-dev liblzma-dev libuuid1 libffi-dev zlib1g-dev libncurses5-dev libdb-dev libsqlite3-dev tk-dev htop \
git curl  wget 
  1. Using systems python3 <-- failed to use 3.11.2, try 3.10.15
alexlai@JetsonOrinNano:~/build/Python-3.10.15$ ./python -m venv ~/PYTHON-3.10.15
alexlai@JetsonOrinNano:~/build/Python-3.10.15$ source ~/PYTHON-3.10.15/bin/activate
(PYTHON-3.10.15) alexlai@JetsonOrinNano:~/build/Python-3.10.15$ pip install pip --upgrade
  1. verifyy and using Enviroment control

alexlai@n2Bookworm:~/build/src$ source ~/PYTHON-3.11.2/bin/activate
(PYTHON-3.11.2) alexlai@n2Bookworm:~/build/src$ which python3
/home/alexlai/PYTHON-3.11.2/bin/python3
(PYTHON-3.11.2) alexlai@n2Bookworm:~/build/src$ which pip
/home/alexlai/PYTHON-3.11.2/bin/pip
(PYTHON-3.11.2) alexlai@n2Bookworm:~/build/src$ python3 -m bz2
(PYTHON-3.11.2) alexlai@n2Bookworm:~/build/src$ pip install pip --upgrade
  1. git clone

$ cd /build git clone https://github.com/mongodb/mongo.git && cd mongo (PYTHON-3.10.15) alexlai@jetson:/build/mongo$ git branch



5. checkout r8.0.4

- prerequisites
    - pip install 'poetry == 1.15.1'
    - export PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring && \
    /home/alexlai/PYTHON-3.10.15/bin/python3 -m poetry install --no-root --sync


(PYTHON-3.10.15) alexlai@jetson:~/build/mongo$ git checkout r8.0.4 Updating files: 100% (15210/15210), done. Note: switching to 'r8.0.4'.

You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may do so (now or later) by using -c with the switch command. Example:

git switch -c

Or undo this operation with:

git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at 3921bf53715 SERVER-94440: use generate_token (#28880)

6. run

(PYTHON-3.10.15) alexlai@JetsonOrinNano:~/build/mongo$ tail log No module named 'poetry' Try running: /home/alexlai/PYTHON-3.10.15/bin/python3 -m pip install 'poetry==1.5.1'

run again Detected one or more packages are out of date. Try running: export PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring /home/alexlai/PYTHON-3.10.15/bin/python3 -m poetry install --no-root --sync


(PYTHON-3.10.15) alexlai@JetsonOrinNano:~/build/mongo$ export PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring /home/alexlai/PYTHON-3.10.15/bin/python3 -m poetry install --no-root --sync Installing dependencies from lock file

Package operations: 124 installs, 29 updates, 0 removals

• Installing jmespath (1.0.1) • Installing python-dateutil (2.8.2) • Updating urllib3 (1.26.20 -> 1.26.18) • Installing botocore (1.34.40) • Updating pycparser (2.22 -> 2.21) • Installing s3transfer (0.10.0) • Updating attrs (24.2.0 -> 23.2.0) • Installing boto3 (1.34.40) • Updating cffi (1.17.1 -> 1.16.0) • Updating rpds-py (0.22.0 -> 0.17.1) • Installing smmap (5.0.1) • Installing asn1crypto (1.5.1) • Updating certifi (2024.8.30 -> 2024.2.2): Installing... • Updating certifi (2024.8.30 -> 2024.2.2) • Updating charset-normalizer (3.4.0 -> 3.3.2) • Updating cryptography (44.0.0 -> 36.0.2) • Installing dnspython (2.5.0) • Installing exceptiongroup (1.2.0) • Installing gitdb (4.0.11) • Installing h11 (0.14.0) • Updating idna (3.10 -> 3.6) • Installing markupsafe (2.1.5) • Updating more-itertools (10.5.0 -> 10.2.0) • Installing outcome (1.3.0.post0) • Installing pymongo-auth-aws (1.1.0) • Installing pyparsing (2.4.0) • Updating referencing (0.35.1 -> 0.33.0) • Updating setuptools (65.5.0 -> 58.1.0) • Installing sniffio (1.3.0) • Installing sortedcontainers (2.4.0) • Updating tomli (2.2.1 -> 2.0.1) • Installing typing-extensions (4.9.0) • Installing wrapt (1.16.0) • Updating zipp (3.21.0 -> 3.17.0) • Installing automat (22.10.0) • Installing click (7.1.2) • Installing constantly (23.10.4) • Installing deprecated (1.2.14) • Updating distlib (0.3.9 -> 0.3.8): Installing... • Installing distro (1.5.0) • Updating filelock (3.16.1 -> 3.13.1): Installing... • Installing gitpython (3.1.41) • Installing gitpython (3.1.41) • Updating filelock (3.16.1 -> 3.13.1) • Installing gitpython (3.1.41) • Installing greenlet (3.0.3) • Installing hyperlink (21.0.0) • Updating importlib-metadata (8.5.0 -> 6.11.0) • Installing distro (1.5.0) • Updating filelock (3.16.1 -> 3.13.1) • Installing gitpython (3.1.41) • Installing greenlet (3.0.3) • Installing hyperlink (21.0.0) • Updating importlib-metadata (8.5.0 -> 6.11.0) • Updating distlib (0.3.9 -> 0.3.8) • Installing distro (1.5.0) • Updating filelock (3.16.1 -> 3.13.1) • Installing gitpython (3.1.41) • Installing greenlet (3.0.3) • Installing hyperlink (21.0.0) • Updating importlib-metadata (8.5.0 -> 6.11.0) • Installing incremental (22.10.0) • Installing itsdangerous (2.1.2) • Updating jaraco-classes (3.4.0 -> 3.3.1) • Installing jinja2 (3.1.4) • Updating jsonschema-specifications (2024.10.1 -> 2023.12.1) • Installing lazy-object-proxy (1.10.0) • Updating msgpack (1.1.0 -> 1.0.7) • Installing oauthlib (3.2.2) • Installing oscrypto (1.3.0) • Updating packaging (24.2 -> 21.3) • Installing protobuf (4.25.2) • Installing pyasn1 (0.5.1) • Installing pydantic (1.10.14) • Installing pymongo (4.3.3) • Updating pyproject-hooks (1.2.0 -> 1.0.0) • Installing pysocks (1.7.1) • Updating rapidfuzz (3.10.1 -> 3.6.1) • Updating requests (2.32.3 -> 2.31.0) • Installing trio (0.24.0) • Installing werkzeug (2.3.7) • Installing wsproto (1.2.0) • Installing zope-interface (5.0.0) • Installing argcomplete (3.2.2) • Installing astroid (2.15.8): Installing... • Installing backoff (2.2.1) • Installing backoff (2.2.1) • Installing astroid (2.15.8) • Installing backoff (2.2.1) • Installing bottle (0.12.25) • Installing croniter (1.4.1) • Installing decorator (5.1.1) • Installing defusedxml (0.7.1) • Installing dill (0.3.8) • Installing enum-compat (0.0.3) • Installing flask (2.0.3) • Installing isort (5.13.2) • Updating jsonschema (4.23.0 -> 4.21.1): Installing... • Installing mccabe (0.7.0) • Installing mongo-tooling-metrics (1.0.8) • Installing mypy-extensions (1.0.0) • Installing ocspbuilder (0.10.2) • Installing opentelemetry-api (1.22.0) • Installing opentelemetry-proto (1.22.0) • Installing opentelemetry-semantic-conventions (0.43b0) • Installing passlib (1.7.4) • Installing pathspec (0.12.1) • Updating pkginfo (1.12.0 -> 1.9.6): Installing... • Installing mccabe (0.7.0) • Installing mongo-tooling-metrics (1.0.8) • Installing mypy-extensions (1.0.0) • Installing ocspbuilder (0.10.2) • Installing opentelemetry-api (1.22.0) • Installing opentelemetry-proto (1.22.0) • Installing opentelemetry-semantic-conventions (0.43b0) • Installing passlib (1.7.4) • Installing pathspec (0.12.1) • Updating pkginfo (1.12.0 -> 1.9.6): Installing... • Updating jsonschema (4.23.0 -> 4.21.1) • Installing mccabe (0.7.0) • Installing mongo-tooling-metrics (1.0.8) • Installing mypy-extensions (1.0.0) • Installing ocspbuilder (0.10.2) • Installing opentelemetry-api (1.22.0) • Installing opentelemetry-proto (1.22.0) • Installing opentelemetry-semantic-conventions (0.43b0) • Installing passlib (1.7.4) • Installing pathspec (0.12.1) • Updating pkginfo (1.12.0 -> 1.9.6): Installing... • Installing psutil (5.8.0) • Installing psutil (5.8.0) • Updating pkginfo (1.12.0 -> 1.9.6) • Installing psutil (5.8.0) • Installing py (1.11.0) • Installing pyasn1-modules (0.3.0) • Installing pyjwt (2.3.0) • Installing pynacl (1.5.0) • Installing pyopenssl (22.0.0) • Installing pyyaml (5.3.1) • Installing requests-oauthlib (1.3.1) • Installing sentinels (1.0.0) • Installing snowballstemmer (2.2.0) • Installing sqlalchemy (2.0.26) • Installing structlog (23.1.0) • Installing tenacity (8.2.3) • Updating tomlkit (0.13.2 -> 0.12.3) • Installing trio-websocket (0.11.1) • Updating trove-classifiers (2024.10.21.16 -> 2024.1.31) • Installing twisted (24.3.0) • Installing types-urllib3 (1.26.25.14) • Installing userpath (1.9.1) • Updating virtualenv (20.28.0 -> 20.25.0) • Installing websocket-client (1.7.0) • Installing cheetah3 (3.2.6.post1) • Installing colorama (0.4.6) • Installing curatorbin (1.2.3): Pending... • Installing docker (6.1.3) • Installing evergreen-lint (0.1.6) • Installing evergreen-py (3.6.22) • Installing gdbmongo (0.14.0) • Installing geckodriver-autoinstaller (0.1.0) • Installing googleapis-common-protos (1.62.0) • Installing inject (5.2.0) • Installing jira (3.1.1) • Installing ldaptor (19.0.0) • Installing memory-profiler (0.61.0) • Installing mock (5.1.0) • Installing mongo-ninja-python (1.11.1.7) • Installing mongomock (4.1.2) • Installing mypy (1.3.0): Installing... • Installing networkx (3.2.1): Installing... • Installing ocspresponder (0.5.0) • Installing opentelemetry-exporter-otlp-proto-common (1.22.0) • Installing opentelemetry-sdk (1.22.0) • Installing pipx (1.4.3) • Installing pkce (1.0.3) • Installing proxy-protocol (0.7.5) • Installing ocspresponder (0.5.0) • Installing opentelemetry-exporter-otlp-proto-common (1.22.0) • Installing opentelemetry-sdk (1.22.0) • Installing pipx (1.4.3) • Installing pkce (1.0.3) • Installing proxy-protocol (0.7.5) • Installing networkx (3.2.1) • Installing ocspresponder (0.5.0) • Installing opentelemetry-exporter-otlp-proto-common (1.22.0) • Installing opentelemetry-sdk (1.22.0) • Installing pipx (1.4.3) • Installing pkce (1.0.3) • Installing proxy-protocol (0.7.5) • Installing docker (6.1.3) • Installing evergreen-lint (0.1.6) • Installing evergreen-py (3.6.22) • Installing gdbmongo (0.14.0) • Installing geckodriver-autoinstaller (0.1.0) • Installing googleapis-common-protos (1.62.0) • Installing inject (5.2.0) • Installing jira (3.1.1) • Installing ldaptor (19.0.0) • Installing memory-profiler (0.61.0) • Installing mock (5.1.0) • Installing mongo-ninja-python (1.11.1.7) • Installing mongomock (4.1.2) • Installing mypy (1.3.0): Installing... • Installing networkx (3.2.1) • Installing ocspresponder (0.5.0) • Installing opentelemetry-exporter-otlp-proto-common (1.22.0) • Installing opentelemetry-sdk (1.22.0) • Installing pipx (1.4.3) • Installing pkce (1.0.3) • Installing proxy-protocol (0.7.5) • Installing curatorbin (1.2.3): Installing... • Installing docker (6.1.3) • Installing evergreen-lint (0.1.6) • Installing evergreen-py (3.6.22) • Installing gdbmongo (0.14.0) • Installing geckodriver-autoinstaller (0.1.0) • Installing googleapis-common-protos (1.62.0) • Installing inject (5.2.0) • Installing jira (3.1.1) • Installing ldaptor (19.0.0) • Installing memory-profiler (0.61.0) • Installing mock (5.1.0) • Installing mongo-ninja-python (1.11.1.7) • Installing mongomock (4.1.2) • Installing mypy (1.3.0): Installing... • Installing networkx (3.2.1) • Installing ocspresponder (0.5.0) • Installing opentelemetry-exporter-otlp-proto-common (1.22.0) • Installing opentelemetry-sdk (1.22.0) • Installing pipx (1.4.3) • Installing pkce (1.0.3) • Installing proxy-protocol (0.7.5) • Installing networkx (3.2.1) • Installing ocspresponder (0.5.0) • Installing opentelemetry-exporter-otlp-proto-common (1.22.0) • Installing opentelemetry-sdk (1.22.0) • Installing pipx (1.4.3) • Installing pkce (1.0.3) • Installing proxy-protocol (0.7.5) • Installing mypy (1.3.0) • Installing networkx (3.2.1) • Installing ocspresponder (0.5.0) • Installing opentelemetry-exporter-otlp-proto-common (1.22.0) • Installing opentelemetry-sdk (1.22.0) • Installing pipx (1.4.3) • Installing pkce (1.0.3) • Installing proxy-protocol (0.7.5) • Installing docker (6.1.3) • Installing evergreen-lint (0.1.6) • Installing evergreen-py (3.6.22) • Installing gdbmongo (0.14.0) • Installing geckodriver-autoinstaller (0.1.0) • Installing googleapis-common-protos (1.62.0) • Installing inject (5.2.0) • Installing jira (3.1.1) • Installing ldaptor (19.0.0) • Installing memory-profiler (0.61.0) • Installing mock (5.1.0) • Installing mongo-ninja-python (1.11.1.7) • Installing mongomock (4.1.2) • Installing mypy (1.3.0) • Installing networkx (3.2.1) • Installing ocspresponder (0.5.0) • Installing opentelemetry-exporter-otlp-proto-common (1.22.0) • Installing opentelemetry-sdk (1.22.0) • Installing pipx (1.4.3) • Installing pkce (1.0.3) • Installing proxy-protocol (0.7.5) • Installing curatorbin (1.2.3) • Installing docker (6.1.3) • Installing evergreen-lint (0.1.6) • Installing evergreen-py (3.6.22) • Installing gdbmongo (0.14.0) • Installing geckodriver-autoinstaller (0.1.0) • Installing googleapis-common-protos (1.62.0) • Installing inject (5.2.0) • Installing jira (3.1.1) • Installing ldaptor (19.0.0) • Installing memory-profiler (0.61.0) • Installing mock (5.1.0) • Installing mongo-ninja-python (1.11.1.7) • Installing mongomock (4.1.2) • Installing mypy (1.3.0) • Installing networkx (3.2.1) • Installing ocspresponder (0.5.0) • Installing opentelemetry-exporter-otlp-proto-common (1.22.0) • Installing opentelemetry-sdk (1.22.0) • Installing pipx (1.4.3) • Installing pkce (1.0.3) • Installing proxy-protocol (0.7.5) • Installing puremagic (1.20) • Installing pydocstyle (6.3.0) • Installing pygithub (1.56) • Installing pykmip (0.10.0) • Installing pylint (2.17.4) • Installing regex (2021.11.10) • Installing requests-oauth (0.4.1) • Installing retry (0.9.2) • Installing selenium (4.17.2) • Installing service-identity (18.1.0) • Installing shrub-py (3.5.0) • Installing tabulate (0.9.0) • Installing tqdm (4.66.2) • Installing types-pyyaml (6.0.12.12) • Installing types-requests (2.31.0.1) • Installing types-retry (0.9.9.4) • Installing types-setuptools (57.4.12) • Installing unittest-xml-reporting (3.0.4) • Installing yamllint (1.32.0) • Installing yapf (0.26.0) (PYTHON-3.10.15) alexlai@JetsonOrinN


7. run

- time nohup python3 buildscripts/scons.py install-core -j3 --ssl --linker=gold --disable-warnings-as-errors --release --wiredtiger >log 2>&1 &

"CCFLAGS": [ "$CCFLAGS_GENERATE_WERROR", "$_FORCEINCLUDES", "-ffp-contract=off", "-fasynchronous-unwind-tables", "-g2", "-Wall", "-Wsign-compare", "-Wno-unknown-pragmas", "-Winvalid-pch", "-fno-omit-frame-pointer", "-fno-strict-aliasing", "-O2", "-march=armv8.2-a", "-mtune=generic", "-Wno-unused-local-typedefs", "-Wno-unused-function", "-Wno-deprecated-declarations", "-Wno-unused-const-variable", "-Wno-unused-but-set-variable", "-Wno-missing-braces", "-Wno-psabi", "-fstack-protector-strong", "-gdwarf32", "-fdebug-types-section", "-Wa,--nocompress-debug-sections", "-DTCMALLOC_INTERNAL_8K_PAGES", "-Werror", "-Wno-array-bounds", "-Wno-attribute-alias", "-Wno-deprecated-declarations", "-Wno-sign-compare", "-Wno-stringop-overflow", "-Wno-uninitialized", "-Wno-unused-function", "-Wno-unused-result", "-Wno-unused-variable" ]


- 
# try the following to builld for odroid and orangepi
time nohup python3 buildscripts/scons.py install-core -j3 --ssl --linker=gold CFLAGS="-march=armv8-a+crc -mtune='cortex-a73.cortex-a53' " --disable-warnings-as-errors --release --wiredtiger > log 2>&1 &

"CCFLAGS": [ "$CCFLAGS_GENERATE_WERROR", "$_FORCEINCLUDES", "-ffp-contract=off", "-fasynchronous-unwind-tables", "-g2", "-Wall", "-Wsign-compare", "-Wno-unknown-pragmas", "-Winvalid-pch", "-fno-omit-frame-pointer", "-fno-strict-aliasing", "-O2", "-Wno-unused-local-typedefs", "-Wno-unused-function", "-Wno-deprecated-declarations", "-Wno-unused-const-variable", "-Wno-unused-but-set-variable", "-Wno-missing-braces", "-Wno-psabi", "-fstack-protector-strong", "-gdwarf32", "-fdebug-types-section", "-Wa,--nocompress-debug-sections", "-DTCMALLOC_INTERNAL_8K_PAGES", "-Werror", "-Wno-array-bounds", "-Wno-attribute-alias", "-Wno-deprecated-declarations", "-Wno-sign-compare", "-Wno-stringop-overflow", "-Wno-uninitialized", "-Wno-unused-function", "-Wno-unused-result", "-Wno-unused-variable" ]

 
 - by chatGPT
 

Summary of Key Flags: Flag Description -march=armv8-a Targets ARMv8-A architecture (aarch64) -mcpu=cortex-a73 Optimizes for the Cortex-A73 processor -mtune=cortex-a73 Fine-tuning optimizations for Cortex-A73 -mfpu=neon-fp-armv8 Enables NEON (ARMv8) floating-point support -mfloat-abi=hard Uses hardware floating-point operations -O2 or -O3 Optimization level (2 for general use, 3 for more aggressive optimizations) -flto Link-Time Optimization -mabi=lp64 Specifies 64-bit ABI for ARMv8-A -m64 Forces 64-bit mode (aarch64)


> python3 buildscripts/scons.py --clean