Skip to content

Commit

Permalink
pymeshlab can be built on linux aarch64 architecture
Browse files Browse the repository at this point in the history
  • Loading branch information
alemuntoni committed Sep 19, 2024
1 parent 803f3a4 commit 047bd79
Show file tree
Hide file tree
Showing 15 changed files with 225 additions and 13 deletions.
77 changes: 77 additions & 0 deletions .devcontainer/Dockerfile_aarch64
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# must use ubuntu:22.04 for qt 5.15
FROM --platform=linux/aarch64 ubuntu:22.04

ENV DEBIAN_FRONTEND=noninteractive

ARG USERNAME=pymeshlab
ARG USER_UID=1000
ARG USER_GID=$USER_UID

ARG PYTHON_VERSION=3.11

ENV LD_LIBRARY_PATH=/workspaces/pymeshlab/pymeshlab/lib/

RUN apt-get -y update && DEBIAN_FRONTEND=noninteractive apt-get -y install \
build-essential \
fontconfig \
fuse \
gdb \
git \
kmod \
libboost-dev \
libdbus-1-3 \
libegl-dev \
libfuse2 \
libgmp-dev \
libglu1-mesa-dev \
libmpfr-dev \
libpulse-mainloop-glib0 \
libtbb-dev \
libxerces-c-dev \
patchelf \
qtbase5-dev \
qt5-qmake \
rsync \
# to be removed
unzip \
wget

# install python
RUN apt-get -y install software-properties-common && \
add-apt-repository ppa:deadsnakes/ppa -y && apt-get -y update && \
apt-get -y install python${PYTHON_VERSION} python${PYTHON_VERSION}-dev python${PYTHON_VERSION}-distutils && \
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python${PYTHON_VERSION} 1 && \
wget https://bootstrap.pypa.io/get-pip.py && \
python${PYTHON_VERSION} get-pip.py && \
rm get-pip.py && \
pip install numpy

# install latest cmake and embree
RUN apt-get -y purge --auto-remove cmake && \
wget -qO- "https://cmake.org/files/v3.19/cmake-3.19.3-Linux-aarch64.tar.gz" \
| tar --strip-components=1 -xz -C /usr/local &&\
# wget -qO- "https://github.com/embree/embree/releases/download/v4.3.2/embree-4.3.2.x86_64.linux.tar.gz" \
# | tar -xz -C /usr/local && \
# bash /usr/local/embree-vars.sh && \
wget -q "https://github.com/ninja-build/ninja/releases/download/v1.12.1/ninja-linux-aarch64.zip" && \
unzip -o ninja-linux-aarch64.zip -d /usr/bin/ && \
rm ninja-linux-aarch64.zip && \
chmod +x /usr/bin/ninja && \
apt-get -y remove wget unzip && \
apt-get -y autoremove && \
apt-get -y clean && \
rm -rf /var/lib/apt/lists/*

# Generating a universally unique ID for the Container
RUN dbus-uuidgen > /etc/machine-id

# Create the user
RUN groupadd --gid $USER_GID $USERNAME \
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \
# [Optional] Add sudo support.
&& apt-get update \
&& apt-get install -y sudo \
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
&& chmod 0440 /etc/sudoers.d/$USERNAME

USER $USERNAME
File renamed without changes.
20 changes: 20 additions & 0 deletions .devcontainer/build_wheel_3_10_aarch64/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "PyMeshLab aarch64 wheel for Python 3.10",

"build": {
"dockerfile": "../Dockerfile_x86_64",
"args": {
"PYTHON_VERSION": "3.10"
}
},
"runArgs": [
"-v", "/lib/modules:/lib/modules",
"--device", "/dev/fuse",
"--cap-add", "SYS_ADMIN",
"--security-opt", "apparmor=unconfined"
],
"workspaceFolder": "/workspaces/pymeshlab",
"workspaceMount": "source=${localWorkspaceFolder},target=/workspaces/pymeshlab,type=bind",

"postStartCommand": "bash scripts/Linux/make_wheel.sh"
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "PyMeshLab wheel for Python 3.10",
"name": "PyMeshLab x86_64 wheel for Python 3.10",

"build": {
"dockerfile": "../Dockerfile",
"dockerfile": "../Dockerfile_x86_64",
"args": {
"PYTHON_VERSION": "3.10"
}
Expand Down
20 changes: 20 additions & 0 deletions .devcontainer/build_wheel_3_11_aarch64/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "PyMeshLab aarch64 wheel for Python 3.11",

"build": {
"dockerfile": "../Dockerfile_x86_64",
"args": {
"PYTHON_VERSION": "3.11"
}
},
"runArgs": [
"-v", "/lib/modules:/lib/modules",
"--device", "/dev/fuse",
"--cap-add", "SYS_ADMIN",
"--security-opt", "apparmor=unconfined"
],
"workspaceFolder": "/workspaces/pymeshlab",
"workspaceMount": "source=${localWorkspaceFolder},target=/workspaces/pymeshlab,type=bind",

"postStartCommand": "bash scripts/Linux/make_wheel.sh"
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "PyMeshLab wheel for Python 3.11",
"name": "PyMeshLab x86_64 wheel for Python 3.11",

"build": {
"dockerfile": "../Dockerfile",
"dockerfile": "../Dockerfile_x86_64",
"args": {
"PYTHON_VERSION": "3.11"
}
Expand Down
20 changes: 20 additions & 0 deletions .devcontainer/build_wheel_3_12_aarch64/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "PyMeshLab aarch64 wheel for Python 3.12",

"build": {
"dockerfile": "../Dockerfile_x86_64",
"args": {
"PYTHON_VERSION": "3.12"
}
},
"runArgs": [
"-v", "/lib/modules:/lib/modules",
"--device", "/dev/fuse",
"--cap-add", "SYS_ADMIN",
"--security-opt", "apparmor=unconfined"
],
"workspaceFolder": "/workspaces/pymeshlab",
"workspaceMount": "source=${localWorkspaceFolder},target=/workspaces/pymeshlab,type=bind",

"postStartCommand": "bash scripts/Linux/make_wheel.sh"
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "PyMeshLab wheel for Python 3.12",
"name": "PyMeshLab x86_64 wheel for Python 3.12",

"build": {
"dockerfile": "../Dockerfile",
"dockerfile": "../Dockerfile_x86_64",
"args": {
"PYTHON_VERSION": "3.12"
}
Expand Down
20 changes: 20 additions & 0 deletions .devcontainer/build_wheel_3_8_aarch64/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "PyMeshLab aarch64 wheel for Python 3.8",

"build": {
"dockerfile": "../Dockerfile_x86_64",
"args": {
"PYTHON_VERSION": "3.8"
}
},
"runArgs": [
"-v", "/lib/modules:/lib/modules",
"--device", "/dev/fuse",
"--cap-add", "SYS_ADMIN",
"--security-opt", "apparmor=unconfined"
],
"workspaceFolder": "/workspaces/pymeshlab",
"workspaceMount": "source=${localWorkspaceFolder},target=/workspaces/pymeshlab,type=bind",

"postStartCommand": "bash scripts/Linux/make_wheel.sh"
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "PyMeshLab wheel for Python 3.8",
"name": "PyMeshLab x86_64 wheel for Python 3.8",

"build": {
"dockerfile": "../Dockerfile",
"dockerfile": "../Dockerfile_x86_64",
"args": {
"PYTHON_VERSION": "3.8"
}
Expand Down
20 changes: 20 additions & 0 deletions .devcontainer/build_wheel_3_9_aarch64/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "PyMeshLab aarch64 wheel for Python 3.9",

"build": {
"dockerfile": "../Dockerfile_x86_64",
"args": {
"PYTHON_VERSION": "3.9"
}
},
"runArgs": [
"-v", "/lib/modules:/lib/modules",
"--device", "/dev/fuse",
"--cap-add", "SYS_ADMIN",
"--security-opt", "apparmor=unconfined"
],
"workspaceFolder": "/workspaces/pymeshlab",
"workspaceMount": "source=${localWorkspaceFolder},target=/workspaces/pymeshlab,type=bind",

"postStartCommand": "bash scripts/Linux/make_wheel.sh"
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "PyMeshLab wheel for Python 3.9",
"name": "PyMeshLab x86_64 wheel for Python 3.9",

"build": {
"dockerfile": "../Dockerfile",
"dockerfile": "../Dockerfile_x86_64",
"args": {
"PYTHON_VERSION": "3.9"
}
Expand Down
33 changes: 33 additions & 0 deletions .devcontainer/develop_aarch64/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"name": "Develop PyMeshLab aarch64",

"build": {
"dockerfile": "../Dockerfile_aarch64",
"args": {
"PYTHON_VERSION": "3.12"
}
},
"runArgs": [
"-ti",
"-v", "/lib/modules:/lib/modules",
"--device", "/dev/fuse",
"--cap-add", "SYS_ADMIN",
"--security-opt", "apparmor=unconfined",
],
"workspaceFolder": "/workspaces/pymeshlab",
"workspaceMount": "source=${localWorkspaceFolder},target=/workspaces/pymeshlab,type=bind",

// vscode extensions
"customizations": {
"vscode": {
"extensions": [
"ms-vscode.cpptools",
"ms-vscode.cpptools-extension-pack",
"ms-vscode.cmake-tools"
],
"settings": {
"cmake.buildDirectory": "${workspaceFolder}/build",
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "Develop PyMeshLab",
"name": "Develop PyMeshLab x86_64",

"build": {
"dockerfile": "../Dockerfile",
"dockerfile": "../Dockerfile_x86_64",
"args": {
"PYTHON_VERSION": "3.12"
}
Expand Down
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ def get_tag(self):
platform_tag = 'win_amd64'
elif platform.system() == 'Linux':
arch = sysconfig.get_platform().split('-')[1]
platform_tag = 'manylinux_2_31_' + arch
glibc_version = os.popen('ldd --version').read().split('\n')[0].split()[-1]
glibc_version = glibc_version.replace('.', '_')
platform_tag = 'manylinux_' + glibc_version + '_' + arch
elif platform.system() == 'Darwin':
arch = platform.machine()
pltf = 'macosx_11_0_x86_64'
Expand Down

0 comments on commit 047bd79

Please sign in to comment.