Skip to content

Commit 0e9c9c8

Browse files
committed
pymeshlab can be built on linux aarch64 architecture
1 parent 803f3a4 commit 0e9c9c8

File tree

15 files changed

+225
-13
lines changed

15 files changed

+225
-13
lines changed

.devcontainer/Dockerfile_aarch64

+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# must use ubuntu:22.04 for qt 5.15
2+
FROM --platform=linux/aarch64 ubuntu:22.04
3+
4+
ENV DEBIAN_FRONTEND=noninteractive
5+
6+
ARG USERNAME=pymeshlab
7+
ARG USER_UID=1000
8+
ARG USER_GID=$USER_UID
9+
10+
ARG PYTHON_VERSION=3.11
11+
12+
ENV LD_LIBRARY_PATH=/workspaces/pymeshlab/pymeshlab/lib/
13+
14+
RUN apt-get -y update && DEBIAN_FRONTEND=noninteractive apt-get -y install \
15+
build-essential \
16+
fontconfig \
17+
fuse \
18+
gdb \
19+
git \
20+
kmod \
21+
libboost-dev \
22+
libdbus-1-3 \
23+
libegl-dev \
24+
libfuse2 \
25+
libgmp-dev \
26+
libglu1-mesa-dev \
27+
libmpfr-dev \
28+
libpulse-mainloop-glib0 \
29+
libtbb-dev \
30+
libxerces-c-dev \
31+
patchelf \
32+
qtbase5-dev \
33+
qt5-qmake \
34+
rsync \
35+
# to be removed
36+
unzip \
37+
wget
38+
39+
# install python
40+
RUN apt-get -y install software-properties-common && \
41+
add-apt-repository ppa:deadsnakes/ppa -y && apt-get -y update && \
42+
apt-get -y install python${PYTHON_VERSION} python${PYTHON_VERSION}-dev python${PYTHON_VERSION}-distutils && \
43+
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python${PYTHON_VERSION} 1 && \
44+
wget https://bootstrap.pypa.io/get-pip.py && \
45+
python${PYTHON_VERSION} get-pip.py && \
46+
rm get-pip.py && \
47+
pip install numpy
48+
49+
# install latest cmake and embree
50+
RUN apt-get -y purge --auto-remove cmake && \
51+
wget -qO- "https://cmake.org/files/v3.19/cmake-3.19.3-Linux-aarch64.tar.gz" \
52+
| tar --strip-components=1 -xz -C /usr/local &&\
53+
# wget -qO- "https://github.com/embree/embree/releases/download/v4.3.2/embree-4.3.2.x86_64.linux.tar.gz" \
54+
# | tar -xz -C /usr/local && \
55+
# bash /usr/local/embree-vars.sh && \
56+
wget -q "https://github.com/ninja-build/ninja/releases/download/v1.12.1/ninja-linux-aarch64.zip" && \
57+
unzip -o ninja-linux-aarch64.zip -d /usr/bin/ && \
58+
rm ninja-linux-aarch64.zip && \
59+
chmod +x /usr/bin/ninja && \
60+
apt-get -y remove wget unzip && \
61+
apt-get -y autoremove && \
62+
apt-get -y clean && \
63+
rm -rf /var/lib/apt/lists/*
64+
65+
# Generating a universally unique ID for the Container
66+
RUN dbus-uuidgen > /etc/machine-id
67+
68+
# Create the user
69+
RUN groupadd --gid $USER_GID $USERNAME \
70+
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \
71+
# [Optional] Add sudo support.
72+
&& apt-get update \
73+
&& apt-get install -y sudo \
74+
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
75+
&& chmod 0440 /etc/sudoers.d/$USERNAME
76+
77+
USER $USERNAME
File renamed without changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"name": "PyMeshLab aarch64 wheel for Python 3.10",
3+
4+
"build": {
5+
"dockerfile": "../Dockerfile_aarch64",
6+
"args": {
7+
"PYTHON_VERSION": "3.10"
8+
}
9+
},
10+
"runArgs": [
11+
"-v", "/lib/modules:/lib/modules",
12+
"--device", "/dev/fuse",
13+
"--cap-add", "SYS_ADMIN",
14+
"--security-opt", "apparmor=unconfined"
15+
],
16+
"workspaceFolder": "/workspaces/pymeshlab",
17+
"workspaceMount": "source=${localWorkspaceFolder},target=/workspaces/pymeshlab,type=bind",
18+
19+
"postStartCommand": "bash scripts/Linux/make_wheel.sh"
20+
}

.devcontainer/build_wheel_3_10/devcontainer.json .devcontainer/build_wheel_3_10_x86_64/devcontainer.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"name": "PyMeshLab wheel for Python 3.10",
2+
"name": "PyMeshLab x86_64 wheel for Python 3.10",
33

44
"build": {
5-
"dockerfile": "../Dockerfile",
5+
"dockerfile": "../Dockerfile_x86_64",
66
"args": {
77
"PYTHON_VERSION": "3.10"
88
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"name": "PyMeshLab aarch64 wheel for Python 3.11",
3+
4+
"build": {
5+
"dockerfile": "../Dockerfile_aarch64",
6+
"args": {
7+
"PYTHON_VERSION": "3.11"
8+
}
9+
},
10+
"runArgs": [
11+
"-v", "/lib/modules:/lib/modules",
12+
"--device", "/dev/fuse",
13+
"--cap-add", "SYS_ADMIN",
14+
"--security-opt", "apparmor=unconfined"
15+
],
16+
"workspaceFolder": "/workspaces/pymeshlab",
17+
"workspaceMount": "source=${localWorkspaceFolder},target=/workspaces/pymeshlab,type=bind",
18+
19+
"postStartCommand": "bash scripts/Linux/make_wheel.sh"
20+
}

.devcontainer/build_wheel_3_11/devcontainer.json .devcontainer/build_wheel_3_11_x86_64/devcontainer.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"name": "PyMeshLab wheel for Python 3.11",
2+
"name": "PyMeshLab x86_64 wheel for Python 3.11",
33

44
"build": {
5-
"dockerfile": "../Dockerfile",
5+
"dockerfile": "../Dockerfile_x86_64",
66
"args": {
77
"PYTHON_VERSION": "3.11"
88
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"name": "PyMeshLab aarch64 wheel for Python 3.12",
3+
4+
"build": {
5+
"dockerfile": "../Dockerfile_aarch64",
6+
"args": {
7+
"PYTHON_VERSION": "3.12"
8+
}
9+
},
10+
"runArgs": [
11+
"-v", "/lib/modules:/lib/modules",
12+
"--device", "/dev/fuse",
13+
"--cap-add", "SYS_ADMIN",
14+
"--security-opt", "apparmor=unconfined"
15+
],
16+
"workspaceFolder": "/workspaces/pymeshlab",
17+
"workspaceMount": "source=${localWorkspaceFolder},target=/workspaces/pymeshlab,type=bind",
18+
19+
"postStartCommand": "bash scripts/Linux/make_wheel.sh"
20+
}

.devcontainer/build_wheel_3_12/devcontainer.json .devcontainer/build_wheel_3_12_x86_64/devcontainer.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"name": "PyMeshLab wheel for Python 3.12",
2+
"name": "PyMeshLab x86_64 wheel for Python 3.12",
33

44
"build": {
5-
"dockerfile": "../Dockerfile",
5+
"dockerfile": "../Dockerfile_x86_64",
66
"args": {
77
"PYTHON_VERSION": "3.12"
88
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"name": "PyMeshLab aarch64 wheel for Python 3.8",
3+
4+
"build": {
5+
"dockerfile": "../Dockerfile_aarch64",
6+
"args": {
7+
"PYTHON_VERSION": "3.8"
8+
}
9+
},
10+
"runArgs": [
11+
"-v", "/lib/modules:/lib/modules",
12+
"--device", "/dev/fuse",
13+
"--cap-add", "SYS_ADMIN",
14+
"--security-opt", "apparmor=unconfined"
15+
],
16+
"workspaceFolder": "/workspaces/pymeshlab",
17+
"workspaceMount": "source=${localWorkspaceFolder},target=/workspaces/pymeshlab,type=bind",
18+
19+
"postStartCommand": "bash scripts/Linux/make_wheel.sh"
20+
}

.devcontainer/build_wheel_3_8/devcontainer.json .devcontainer/build_wheel_3_8_x86_64/devcontainer.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"name": "PyMeshLab wheel for Python 3.8",
2+
"name": "PyMeshLab x86_64 wheel for Python 3.8",
33

44
"build": {
5-
"dockerfile": "../Dockerfile",
5+
"dockerfile": "../Dockerfile_x86_64",
66
"args": {
77
"PYTHON_VERSION": "3.8"
88
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"name": "PyMeshLab aarch64 wheel for Python 3.9",
3+
4+
"build": {
5+
"dockerfile": "../Dockerfile_aarch64",
6+
"args": {
7+
"PYTHON_VERSION": "3.9"
8+
}
9+
},
10+
"runArgs": [
11+
"-v", "/lib/modules:/lib/modules",
12+
"--device", "/dev/fuse",
13+
"--cap-add", "SYS_ADMIN",
14+
"--security-opt", "apparmor=unconfined"
15+
],
16+
"workspaceFolder": "/workspaces/pymeshlab",
17+
"workspaceMount": "source=${localWorkspaceFolder},target=/workspaces/pymeshlab,type=bind",
18+
19+
"postStartCommand": "bash scripts/Linux/make_wheel.sh"
20+
}

.devcontainer/build_wheel_3_9/devcontainer.json .devcontainer/build_wheel_3_9_x86_64/devcontainer.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"name": "PyMeshLab wheel for Python 3.9",
2+
"name": "PyMeshLab x86_64 wheel for Python 3.9",
33

44
"build": {
5-
"dockerfile": "../Dockerfile",
5+
"dockerfile": "../Dockerfile_x86_64",
66
"args": {
77
"PYTHON_VERSION": "3.9"
88
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"name": "Develop PyMeshLab aarch64",
3+
4+
"build": {
5+
"dockerfile": "../Dockerfile_aarch64",
6+
"args": {
7+
"PYTHON_VERSION": "3.12"
8+
}
9+
},
10+
"runArgs": [
11+
"-ti",
12+
"-v", "/lib/modules:/lib/modules",
13+
"--device", "/dev/fuse",
14+
"--cap-add", "SYS_ADMIN",
15+
"--security-opt", "apparmor=unconfined",
16+
],
17+
"workspaceFolder": "/workspaces/pymeshlab",
18+
"workspaceMount": "source=${localWorkspaceFolder},target=/workspaces/pymeshlab,type=bind",
19+
20+
// vscode extensions
21+
"customizations": {
22+
"vscode": {
23+
"extensions": [
24+
"ms-vscode.cpptools",
25+
"ms-vscode.cpptools-extension-pack",
26+
"ms-vscode.cmake-tools"
27+
],
28+
"settings": {
29+
"cmake.buildDirectory": "${workspaceFolder}/build",
30+
}
31+
}
32+
}
33+
}

.devcontainer/develop/devcontainer.json .devcontainer/develop_x86_64/devcontainer.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"name": "Develop PyMeshLab",
2+
"name": "Develop PyMeshLab x86_64",
33

44
"build": {
5-
"dockerfile": "../Dockerfile",
5+
"dockerfile": "../Dockerfile_x86_64",
66
"args": {
77
"PYTHON_VERSION": "3.12"
88
}

setup.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ def get_tag(self):
3838
platform_tag = 'win_amd64'
3939
elif platform.system() == 'Linux':
4040
arch = sysconfig.get_platform().split('-')[1]
41-
platform_tag = 'manylinux_2_31_' + arch
41+
glibc_version = os.popen('ldd --version').read().split('\n')[0].split()[-1]
42+
glibc_version = glibc_version.replace('.', '_')
43+
platform_tag = 'manylinux_' + glibc_version + '_' + arch
4244
elif platform.system() == 'Darwin':
4345
arch = platform.machine()
4446
pltf = 'macosx_11_0_x86_64'

0 commit comments

Comments
 (0)