§2024-11-23
It looks like you can not do native comipling on odroid anymore. Failed!!
- orgpi516G.yushei.net
real 389m35.331s
user 2456m47.875s
sys 91m30.396s
$ ./mongod --version
186024 src/third_party/tcmalloc/dist/tcmalloc/system-alloc.cc:755] MmapAligned() failed - unable to allocate with tag (hint=0x2c7f40000000, size=1073741824, alignment=1073741824) - is something limiting address placement?
186024 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)
- 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
2. compile your own python3
see `https://munetaka.me:43413/user/alexlai/files/JupyterHub/Computer/2024/Python/compile-from-source.md?_xsrf=2%7Cf86e6437%7C45cecc0ddfefd59886cf8ceed4c22b36%7C1732339068`
3. verifyy and using Enviroment control
alexlai@hc4Jammy:~$ cd build/Python-3.10.15/
alexlai@hc4Jammy:~/build/Python-3.10.15$ ./python -m venv ~/PYTHON-3.10.15
alexlai@hc4Jammy:~/build/Python-3.10.15$ source ~/PYTHON-3.10.15/bin/activate
(PYTHON-3.10.15) alexlai@hc4Jammy:~/build/Python-3.10.15$ ./python --version
Python 3.10.15
(PYTHON-3.10.15) alexlai@hc4Jammy:~/build/Python-3.10.15$ ./python -m bz2
(PYTHON-3.10.15) alexlai@hc4Jammy:~/build/Python-3.10.15
(PYTHON-3.10.15) alexlai@hc4Jammy:~/build/Python-3.10.15$ pip --version
pip 23.0.1 from /home/alexlai/PYTHON-3.10.15/lib/python3.10/site-packages/pip (python 3.10)
(PYTHON-3.10.15) alexlai@hc4Jammy:~/build/Python-3.10.15$ pip install pip --upgrade
- git clone
$ cd ~/build git clone https://github.com/mongodb/mongo.git && cd mongo
5. checkout r8.0.4
$ git checkout r8.0.4 Updating files: 100% (15221/15221), 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. ~/scripts/buildMongoDB.sh
#!/bin/bash
time nohup python3 buildscripts/scons.py install-core -j3 --ssl --linker=gold --disable-warnings-as-errors --release --wiredtiger >log 2>&1 &
(PYTHON-3.10.15) alexlai@n2Jammy:~/build/mongo$ ~/scripts/buildMongoDB.sh
(PYTHON-3.10.15) alexlai@n2Jammy:~/build/mongo$
real 0m0.094s
user 0m0.065s
sys 0m0.019s
(PYTHON-3.10.15) alexlai@n2Jammy:~/build/mongo$ tail -f log
No module named 'poetry'
Try running:
/home/alexlai/PYTHON-3.10.15/bin/python3 -m pip install 'poetry==1.5.1'
$ pip install 'poetry==1.5.1'
$ pip install --upgrade pip
$ export PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring
/home/alexlai/PYTHON-3.10.15/bin/s
$ pip wheel --use-pep517 "zope-interface (==5.0.0)"
$ export PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring
/home/alexlai/PYTHON-3.10.15/bin/python3 -m poetry install --no-root --syn
- checkout r8.0.3
$ git checkout r8.0.3
Updating files: 100% (15248/15248), done.
Note: switching to 'r8.0.3'.
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 <new-branch-name>
Or undo this operation with:
git switch -
Turn off this advice by setting config variable advice.detachedHead to false
HEAD is now at 2640cbf824a SERVER-94798 Defend against embedded null in getField (#27758)
(PYTHON-3.10.15) alexlai@hc4Jammy:~/build/mongo$ git branch
* (HEAD detached at r8.0.3)
master
- edit
buildscripts/poetry_sync.sh
and run it under python env control
(PYTHON-3.10.15) alexlai@hc4Jammy:~/build/mongo$ ls -l buildscripts/poetry_sync.sh
-rw-r--r-- 1 root root 2710 Nov 23 14:01 buildscripts/poetry_sync.sh
(PYTHON-3.10.15) alexlai@hc4Jammy:~/build/mongo$ sudo chmod a+x buildscripts/poetry_sync.sh
(PYTHON-3.10.15) alexlai@hc4Jammy:~/build/mongo$ ./buildscripts/poetry_sync.sh
....
at ~/PYTHON-3.10.15/lib/python3.10/site-packages/poetry/installation/chef.py:164 in _prepare
160│
161│ error = ChefBuildError("\n\n".join(message_parts))
162│
163│ if error is not None:
→ 164│ raise error from None
165│
166│ return path
167│
168│ def _prepare_sdist(self, archive: Path, destination: Path | None = None) -> Path:
Note: This error originates from the build backend, and is likely not a problem with poetry but with zope-interface (5.0.0) not supporting PEP 517 builds. You can verify this by running 'pip wheel --no-cache-dir --use-pep517 "zope-interface (==5.0.0)"'.
(PYTHON-3.10.15) alexlai@hc4Jammy:~/build/mongo$ pip wheel --no-cache-dir --use-pep517 "zope-interface (==5.0.0)"
Collecting zope-interface==5.0.0
Downloading zope.interface-5.0.0.tar.gz (214 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Collecting setuptools (from zope-interface==5.0.0)
Downloading setuptools-75.6.0-py3-none-any.whl.metadata (6.7 kB)
Downloading setuptools-75.6.0-py3-none-any.whl (1.2 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.2/1.2 MB 5.5 MB/s eta 0:00:00
Saved ./setuptools-75.6.0-py3-none-any.whl
Building wheels for collected packages: zope-interface
Building wheel for zope-interface (pyproject.toml) ... done
Created wheel for zope-interface: filename=zope.interface-5.0.0-cp310-cp310-linux_aarch64.whl size=226660 sha256=915255aff246a9e91f2cedde8b3e949a7fef66376ac22b998685c764c79c8ca8
Stored in directory: /tmp/pip-ephem-wheel-cache-1lmr10cd/wheels/50/df/a5/b736a1b44a34305e5b24cb50af62716052acb5b435c7040195
Successfully built zope-interface
(PYTHON-3.10.15) alexlai@hc4Jammy:~/build/mongo$ ./buildscripts/poetry_sync.sh <-- run it again
and this time is OK
- compile it with
#!/bin/bash
python3 buildscripts/scons.py install-core -j3 --ssl --linker=gold --disable-warnings-as-errors >log 2>&1 &