Skip to content

Commit 51d835e

Browse files
Build System - Add support for Linux build.
1 parent 3329037 commit 51d835e

File tree

4 files changed

+257
-0
lines changed

4 files changed

+257
-0
lines changed

scripts/build_mmSolver_all.bat

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,3 +90,8 @@ docker container run --volume %VOLUME% %NAME% "bash -c './scripts/build_mmSolver
9090
set NAME=mmsolver-linux-maya2025-build
9191
docker buildx build --file "%DOCKERFILE_DIR%\Dockerfile_maya2025" -t %NAME% "%PROJECT_ROOT%"
9292
docker container run --volume %VOLUME% %NAME% "bash -c './scripts/build_mmSolver_linux_maya2025.bash'"
93+
94+
:: Linux - Maya 2026 Build
95+
set NAME=mmsolver-linux-maya2026-build
96+
docker buildx build --file "%DOCKERFILE_DIR%\Dockerfile_maya2026" -t %NAME% "%PROJECT_ROOT%"
97+
docker container run --volume %VOLUME% %NAME% "bash -c './scripts/build_mmSolver_linux_maya2026.bash'"
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Copyright (C) 2019, 2022, 2023, 2024 David Cattermole.
4+
#
5+
# This file is part of mmSolver.
6+
#
7+
# mmSolver is free software: you can redistribute it and/or modify it
8+
# under the terms of the GNU Lesser General Public License as
9+
# published by the Free Software Foundation, either version 3 of the
10+
# License, or (at your option) any later version.
11+
#
12+
# mmSolver is distributed in the hope that it will be useful,
13+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
# GNU Lesser General Public License for more details.
16+
#
17+
# You should have received a copy of the GNU Lesser General Public License
18+
# along with mmSolver. If not, see <https://www.gnu.org/licenses/>.
19+
# ---------------------------------------------------------------------
20+
#
21+
# Builds the Maya MatchMove Solver project.
22+
23+
# Build location - where to build the project.
24+
#
25+
# Defaults to ${PROJECT_ROOT}/.. if not set.
26+
if [ -z "$BUILD_DIR_BASE" ]; then
27+
BUILD_DIR_BASE="$(pwd)/.."
28+
fi
29+
30+
# Maya
31+
MAYA_VERSION=2026
32+
MAYA_LOCATION=/usr/autodesk/maya2026/
33+
34+
# Executable names/paths used for build process.
35+
PYTHON_EXE=python3.9
36+
CMAKE_EXE=cmake3
37+
RUST_CARGO_EXE=cargo
38+
39+
# OpenColorIO specific options.
40+
OPENCOLORIO_TARBALL_NAME="OpenColorIO-2.3.2.tar.gz"
41+
OPENCOLORIO_TARBALL_EXTRACTED_DIR_NAME="OpenColorIO-2.3.2"
42+
EXPAT_RELATIVE_CMAKE_DIR=lib64/cmake/expat-2.4.1/
43+
EXPAT_RELATIVE_LIB_PATH=lib64/libexpat.a
44+
# yaml-cpp 0.7.0
45+
YAML_RELATIVE_CMAKE_DIR=share/cmake/yaml-cpp
46+
YAML_RELATIVE_LIB_PATH=lib64/libyaml-cpp.a
47+
PYSTRING_RELATIVE_LIB_PATH=lib64/libpystring.a
48+
ZLIB_RELATIVE_LIB_PATH=lib/libz.a
49+
50+
# Manually override OpenGL include headers, because CMake doesn't seem
51+
# to automatically find OpenGL headers on RockyLinux8 (which is used
52+
# in the Docker containers).
53+
OPENGL_INCLUDE_DIR=/usr/include/
54+
55+
# Which version of the VFX platform are we "using"? (Maya doesn't
56+
# currently conform to the VFX Platform.)
57+
VFX_PLATFORM=2024
58+
59+
# C++ Standard to use.
60+
CXX_STANDARD=14
61+
62+
# The -e flag causes the script to exit as soon as one command returns
63+
# a non-zero exit code.
64+
set -ev
65+
66+
CWD=`pwd`
67+
68+
# These scripts assume 'RUST_CARGO_EXE' has been set to the Rust
69+
# 'cargo' executable.
70+
source "${CWD}/scripts/internal/build_openColorIO_linux.bash"
71+
source "${CWD}/scripts/internal/build_mmSolverLibs_linux.bash"
72+
source "${CWD}/scripts/internal/build_mmSolver_linux.bash"
73+
74+
cd ${CWD}

share/docker/Dockerfile_maya2026

Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
# To create and run the docker container in PowerShell or BASH:
2+
#
3+
# $ cd /path/to/project/root/mayaMatchMoveSolver/
4+
# $ docker build --file share/docker/Dockerfile_maya2026 -t mmsolver-linux-maya2026-build .
5+
# $ docker run --rm --interactive --volume "${PWD}:/mmSolver" --tty mmsolver-linux-maya2026-build bash
6+
#
7+
#
8+
# Once the docker image is built and run, you can execute the
9+
# following...
10+
#
11+
#
12+
# Install Python and run tools:
13+
#
14+
# $ source ./scripts/python_venv_activate_maya2026.bash
15+
# $ ./scripts/python_linter_run_pylint.bash
16+
# $ ./scripts/python_linter_run_flake8.bash
17+
# $ ./scripts/python_linter_run_cpplint.bash
18+
# $ ./scripts/python_formatter_run_black_check.bash
19+
# $ deactivate
20+
#
21+
#
22+
# Build CMake project:
23+
#
24+
# $ ./scripts/build_mmSolver_linux_maya2026.bash
25+
# $ mayapy tests/runTests.py
26+
#
27+
28+
FROM rockylinux:8
29+
30+
# Maya documentation for installing on RHEL8 / Rocky8:
31+
# https://help.autodesk.com/view/MAYAUL/2025/ENU/?guid=GUID-D2B5433C-E0D2-421B-9BD8-24FED217FD7F
32+
#
33+
# And this forum post:
34+
# https://forums.autodesk.com/t5/maya-forum/install-maya-2023-update-3-on-rocky-linux-8-7-instructions/td-p/11735138
35+
36+
# Install Extra Packages Enterprise Linux (EPEL) repo for extra tools.
37+
RUN dnf install --assumeyes https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm \
38+
&& dnf install --assumeyes epel-release \
39+
&& dnf update --assumeyes \
40+
&& dnf makecache
41+
42+
# General packages
43+
RUN dnf install --assumeyes \
44+
glibc \
45+
libSM \
46+
libICE \
47+
zlib \
48+
openssl-libs \
49+
nss \
50+
libnsl \
51+
dbus \
52+
redhat-lsb-core \
53+
pcre-utf16 \
54+
pciutils \
55+
libXdamage
56+
57+
# Multimedia Packages
58+
RUN dnf install --assumeyes \
59+
mesa-libGL \
60+
mesa-libGL-devel \
61+
mesa-libGLU \
62+
mesa-libGLw \
63+
gamin \
64+
audiofile-devel \
65+
e2fsprogs-libs \
66+
libcap \
67+
libdrm \
68+
libmng \
69+
speech-dispatcher \
70+
cups \
71+
libpng15
72+
73+
# X Window – Xcb – X11 Packages
74+
RUN dnf install --assumeyes \
75+
libX11 \
76+
libXScrnSaver \
77+
libXau \
78+
libXcomposite \
79+
libXcursor \
80+
libXext \
81+
libXfixes \
82+
libXi \
83+
libXinerama \
84+
libXmu \
85+
libXp \
86+
libXpm \
87+
libXrandr \
88+
libXrender \
89+
libXt \
90+
libXtst \
91+
libxcb \
92+
libxkbcommon \
93+
libxkbcommon-x11 \
94+
libxshmfence \
95+
xcb-util \
96+
xcb-util-image \
97+
xcb-util-keysyms \
98+
xcb-util-renderutil \
99+
xcb-util-wm \
100+
xorg-x11-server-Xorg \
101+
xorg-x11-server-Xvfb
102+
103+
# Install fonts needed by Maya.
104+
# This is probably only needed by the GUI (which we will not open),
105+
# but it's good to have everything needed, just in case.
106+
RUN dnf install --assumeyes \
107+
fontconfig \
108+
freetype \
109+
xorg-x11-fonts-ISO8859-1-100dpi \
110+
xorg-x11-fonts-ISO8859-1-75dpi \
111+
liberation-mono-fonts \
112+
liberation-fonts-common \
113+
liberation-sans-fonts \
114+
liberation-serif-fonts
115+
116+
# OpenSource "mesa" OpenGL Driver.
117+
RUN dnf install --assumeyes \
118+
mesa-libGLw \
119+
mesa-libGLU \
120+
mesa-libGL-devel \
121+
mesa-libEGL-devel \
122+
mesa-libGLES-devel \
123+
mesa-libGLU-devel \
124+
mesa-libGLw-devel \
125+
libglvnd \
126+
libglvnd-opengl \
127+
libglvnd-egl \
128+
libglvnd-glx \
129+
libglvnd-gles \
130+
libglvnd-core-devel \
131+
libglvnd-devel
132+
133+
# Install latest stable Rust with 'rustup'.
134+
#
135+
# TODO: Define a minimum Rust version to install.
136+
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y \
137+
&& source ${HOME}/.cargo/env
138+
ENV PATH=/root/.cargo/bin:$PATH
139+
140+
# Development tools for Maya 2026.
141+
RUN dnf install --assumeyes \
142+
git \
143+
python39 \
144+
cmake \
145+
clang-tools-extra \
146+
gcc-toolset-11
147+
148+
# Install Maya from archive.
149+
ADD ./external/archives/Autodesk_Maya_2026_ML_Linux_64bit.tgz /temp
150+
# 'rpm --force' is needed to override the dependency conflict of using
151+
# 'tcl' (which is required by 'gcc-toolset-11', because it's a
152+
# "software collection" using environment modules written in tcl).
153+
RUN rpm -Uvh --force /temp/Packages/Maya2026*.rpm && rm -r /temp
154+
ENV MAYA_LOCATION=/usr/autodesk/maya/
155+
ENV PATH=$MAYA_LOCATION/bin:$PATH
156+
157+
# Workaround for Maya "Segmentation fault (core dumped)" issue.
158+
# See https://forums.autodesk.com/t5/maya-general/render-crash-on-linux/m-p/5608552/highlight/true
159+
ENV MAYA_DISABLE_CIP=1
160+
161+
WORKDIR /mmSolver
162+
163+
# Maya 2026 development environment.
164+
ENTRYPOINT [ "scl", "enable", "gcc-toolset-11" ]
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Python Package Requirements.
2+
#
3+
# Expects Python 3.9.x
4+
5+
# Tools needed for code linting and formatting.
6+
black == 24.8.0
7+
pylint == 3.2.7
8+
flake8 == 7.1.1
9+
cpplint == 1.6.1
10+
ruff == 0.6.5
11+
12+
# Tools needed for documentation building.
13+
Sphinx == 7.4.7
14+
furo == 2024.8.6

0 commit comments

Comments
 (0)