-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathpixi.toml
More file actions
581 lines (539 loc) · 25.6 KB
/
pixi.toml
File metadata and controls
581 lines (539 loc) · 25.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
[workspace]
name = "momentum"
channels = ["conda-forge"]
platforms = ["linux-64", "osx-64", "osx-arm64", "win-64"]
version = "0.1.0"
description = "A library providing foundational algorithms for human kinematic motion and numerical optimization solvers to apply human motion in various applications"
license = "MIT"
readme = "README.md"
homepage = "https://facebookresearch.github.io/momentum/"
repository = "https://github.com/facebookresearch/momentum"
[dependencies]
# build and test dependencies
c-compiler = ">=1.11.0,<2"
clang-format = "==21.1.2"
cmake = ">=3.28.0,<4"
cxx-compiler = ">=1.11.0,<2"
gtest = ">=1.17.0,<2"
libboost-devel = ">=1.84.0,<2"
ninja = ">=1.13.1,<2"
rerun-sdk = ">=0.23.3,<0.24"
pip = ">=25.2,<26"
pybind11 = ">=2.13.6,<4"
pytest = ">=8.4.2,<9"
scikit-build-core = ">=0.10.0,<0.11"
scipy = ">=1.10.0,<2"
setuptools = ">=80.9.0,<81"
setuptools-scm = ">=8.0.0,<9"
sphinx = ">=7.0.0,<9"
sphinx-rtd-theme = ">=3.0.2,<4"
tracy-profiler-gui = ">=0.11.1,<0.13"
twine = ">=6.1.0,<7"
jinja2 = ">=3.1.0,<4"
# runtime dependencies
blas = ">=2.135,<3"
ceres-solver = ">=2.2.0,<3"
cli11 = ">=2.5.0,<3"
dispenso = ">=1.4.0,<2"
eigen = ">=3.4.0,<4"
ezc3d = ">=1.5.19,<2"
drjit-cpp = ">=1.2.0,<2"
fmt = ">=11.2.0,<12"
fx-gltf = ">=2.0.0,<3"
indicators = ">=2.3,<3"
kokkos = ">=4.6.2,<5"
librerun-sdk = ">=0.23.3,<0.24"
ms-gsl = ">=4.2.0,<5"
nlohmann_json = ">=3.12.0,<4"
openfbx = ">=0.9,<0.10"
openusd = ">=25.05,<26"
openssl = ">=3.5.4,<4"
pytorch = ">=2.8.0,<3"
re2 = ">=2025.8.12,<2026"
spdlog = ">=1.15.3,<2"
tracy-profiler-client = ">=0.12.2,<0.13"
urdfdom = ">=4.0.1,<5"
zlib = ">=1.3.1,<2"
[tasks]
clean = { cmd = """
rm -rf build \
&& rm -rf .pixi \
&& rm pixi.lock
""", description = "Clean all build artifacts and pixi cache" }
lint = { cmd = "clang-format -i axel/**/*.h axel/**/*.cpp momentum/**/*.h momentum/**/*.cpp pymomentum/**/*.h pymomentum/**/*.cpp", description = "Format C++ code using clang-format" }
lint-check = { cmd = "clang-format --dry-run --Werror axel/**/*.h axel/**/*.cpp momentum/**/*.h momentum/**/*.cpp pymomentum/**/*.h pymomentum/**/*.cpp", description = "Check if code is properly formatted without modifying files" }
config = { cmd = """
cmake \
-S . \
-B build/$PIXI_ENVIRONMENT_NAME/cpp/release \
-G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \
-DBUILD_SHARED_LIBS=ON \
-DMOMENTUM_ENABLE_FBX_SAVING=$MOMENTUM_ENABLE_FBX_SAVING \
-DMOMENTUM_BUILD_TESTING=ON \
-DMOMENTUM_BUILD_EXAMPLES=ON \
-DMOMENTUM_BUILD_PYMOMENTUM=$MOMENTUM_BUILD_PYMOMENTUM \
-DMOMENTUM_ENABLE_PROFILING=ON \
-DMOMENTUM_ENABLE_SIMD=$MOMENTUM_ENABLE_SIMD \
-DMOMENTUM_INSTALL_EXAMPLES=ON \
-DMOMENTUM_USE_SYSTEM_GOOGLETEST=ON \
-DMOMENTUM_USE_SYSTEM_PYBIND11=ON \
-DMOMENTUM_USE_SYSTEM_RERUN_CPP_SDK=ON \
-DMOMENTUM_USE_SYSTEM_TRACY=ON
""", env = { MOMENTUM_ENABLE_FBX_SAVING = "OFF", MOMENTUM_ENABLE_SIMD = "ON", MOMENTUM_BUILD_PYMOMENTUM = "ON" }, description = "Configure CMake for Release build" }
config_dev = { cmd = """
cmake \
-S . \
-B build/$PIXI_ENVIRONMENT_NAME/cpp/debug \
-G Ninja \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \
-DBUILD_SHARED_LIBS=ON \
-DMOMENTUM_ENABLE_FBX_SAVING=$MOMENTUM_ENABLE_FBX_SAVING \
-DMOMENTUM_BUILD_TESTING=ON \
-DMOMENTUM_BUILD_EXAMPLES=ON \
-DMOMENTUM_BUILD_PYMOMENTUM=$MOMENTUM_BUILD_PYMOMENTUM \
-DMOMENTUM_ENABLE_PROFILING=ON \
-DMOMENTUM_ENABLE_SIMD=$MOMENTUM_ENABLE_SIMD \
-DMOMENTUM_INSTALL_EXAMPLES=ON \
-DMOMENTUM_USE_SYSTEM_GOOGLETEST=ON \
-DMOMENTUM_USE_SYSTEM_PYBIND11=ON \
-DMOMENTUM_USE_SYSTEM_RERUN_CPP_SDK=ON \
-DMOMENTUM_USE_SYSTEM_TRACY=ON
""", env = { MOMENTUM_ENABLE_FBX_SAVING = "OFF", MOMENTUM_ENABLE_SIMD = "ON", MOMENTUM_BUILD_PYMOMENTUM = "ON" }, description = "Configure CMake for Debug build" }
build = { cmd = "cmake --build build/$PIXI_ENVIRONMENT_NAME/cpp/release -j --target all", depends-on = [
"config",
], description = "Build Release version" }
build_dev = { cmd = "cmake --build build/$PIXI_ENVIRONMENT_NAME/cpp/debug -j --target all", depends-on = [
"config_dev",
], description = "Build Debug version" }
build_fast = { cmd = "cmake --build build/$PIXI_ENVIRONMENT_NAME/cpp/release -j4 --target all", depends-on = [
"config",
], description = "Build Release version with limited parallelism" }
test = { cmd = "ctest --test-dir build/$PIXI_ENVIRONMENT_NAME/cpp/release --output-on-failure", depends-on = [
"build",
], description = "Run C++ tests (Release)" }
test_dev = { cmd = "ctest --test-dir build/$PIXI_ENVIRONMENT_NAME/cpp/debug --output-on-failure", depends-on = [
"build_dev",
], description = "Run C++ tests (Debug)" }
test_verbose = { cmd = "ctest --test-dir build/$PIXI_ENVIRONMENT_NAME/cpp/release --output-on-failure --verbose", depends-on = [
"build",
], description = "Run C++ tests with verbose output" }
hello_world = { cmd = "build/$PIXI_ENVIRONMENT_NAME/cpp/release/hello_world", depends-on = [
"build",
], description = "Run hello world example" }
convert_model = { cmd = "build/$PIXI_ENVIRONMENT_NAME/cpp/release/convert_model", depends-on = [
"build",
], description = "Run model conversion tool" }
c3d_viewer = { cmd = "build/$PIXI_ENVIRONMENT_NAME/cpp/release/c3d_viewer", depends-on = [
"build",
], description = "Run C3D file viewer" }
fbx_viewer = { cmd = "build/$PIXI_ENVIRONMENT_NAME/cpp/release/fbx_viewer", depends-on = [
"build",
], description = "Run FBX file viewer" }
glb_viewer = { cmd = "build/$PIXI_ENVIRONMENT_NAME/cpp/release/glb_viewer", depends-on = [
"build",
], description = "Run GLB file viewer" }
urdf_viewer = { cmd = "build/$PIXI_ENVIRONMENT_NAME/cpp/release/urdf_viewer", depends-on = [
"build",
], description = "Run URDF file viewer" }
process_markers = { cmd = "build/$PIXI_ENVIRONMENT_NAME/cpp/release/process_markers_app", depends-on = [
"build",
], description = "Run marker processing application" }
refine_motion = { cmd = "build/$PIXI_ENVIRONMENT_NAME/cpp/release/refine_motion", depends-on = [
"build",
], description = "Run motion refinement tool" }
export_objs = { cmd = "build/$PIXI_ENVIRONMENT_NAME/cpp/release/export_objs", depends-on = [
"build",
], description = "Export animated mesh sequence as objs" }
animate_shapes = { cmd = "build/$PIXI_ENVIRONMENT_NAME/cpp/release/animate_shapes", depends-on = [
"build",
], description = "Export animation of blendshapes" }
install = { cmd = "cmake --build build/$PIXI_ENVIRONMENT_NAME/cpp/release -j --target install", depends-on = [
"build",
], description = "Install built libraries and executables" }
tracy = { cmd = "tracy-profiler", description = "Launch Tracy profiler GUI" }
test_py = { cmd = "pytest pymomentum/test/*.py", env = { MOMENTUM_MODELS_PATH = "momentum/" }, depends-on = [
"build_py",
], description = "Run Python tests" }
test_py_verbose = { cmd = "pytest pymomentum/test/*.py -v", env = { MOMENTUM_MODELS_PATH = "momentum/" }, depends-on = [
"build_py",
], description = "Run Python tests with verbose output" }
doc_py = { cmd = "sphinx-build -a -E -W -b html pymomentum/doc build/python_api_doc", depends-on = [
"build_py",
], description = "Build Python API documentation with warnings as errors" }
open_doc_py = { cmd = "open build/python_api_doc/index.html", depends-on = [
"doc_py",
], description = "Open Python documentation in browser" }
# ==================
# Wheel Publishing
# ==================
# CPU environments (py312, py313) build CPU wheels
# GPU environments (py312-cuda129, py313-cuda129) build GPU wheels
# Usage:
# CPU: pixi run -e py312 wheel_build
# GPU: pixi run -e py312-cuda129 wheel_build
# Generate pyproject-pypi-{cpu,gpu}.toml from template
# This task is mainly for CI. For local use, run directly:
# python scripts/generate_pyproject.py --torch-min-py312 X.X --torch-max-py312 X.X --torch-min-py313 Y.Y --torch-max-py313 Y.Y
wheel_generate_config = { cmd = "python scripts/generate_pyproject.py", description = "Wheel: Generate pyproject-pypi-{cpu,gpu}.toml from template (uses defaults from script)" }
# Clean distribution artifacts
wheel_clean = { cmd = """
rm -rf dist; \
find build -maxdepth 1 -type f \\( -name '*.whl' -o -name '*.tar.gz' \\) -delete 2>/dev/null || true
""", description = "Wheel: Remove distribution artifacts from previous builds" }
# Check wheel files with twine
wheel_check = { cmd = "twine check dist/pymomentum_*.whl", description = "Wheel: Check wheel files with twine" }
# Test wheel imports in a clean environment using uv
wheel_test = { cmd = "python scripts/test_wheel.py", description = "Wheel: Test wheel imports in a clean virtual environment using uv" }
# Publish to TestPyPI for testing
wheel_publish_test = { cmd = "twine upload --repository testpypi --skip-existing dist/pymomentum_*.whl", depends-on = [
"wheel_check",
"wheel_test",
], description = "Wheel: Publish to TestPyPI for testing" }
# CPU-specific wheel tasks - build CPU wheels (default)
# CPU environments (py312, py313) use these tasks
wheel_build = { cmd = """
python -c "import sys, os, shutil; py_ver = str(sys.version_info.major) + str(sys.version_info.minor); os.makedirs('.tmp', exist_ok=True); shutil.copy('pyproject.toml', '.tmp/pyproject-backup.toml'); shutil.copy(f'pyproject-pypi-cpu-py{py_ver}.toml', 'pyproject.toml')" && \
pip wheel . --no-deps --no-build-isolation --wheel-dir=dist && \
python -c "import shutil; shutil.move('.tmp/pyproject-backup.toml', 'pyproject.toml')"
""", depends-on = [
"wheel_generate_config",
], description = "Wheel: Build CPU wheel for current Python version. On CI (Ubuntu), produces Colab-compatible wheels. On newer systems (Fedora 42+), produces wheels for local testing only." }
wheel_repair = { cmd = """
bash -c '
# Try to repair to manylinux_2_28 first (Colab compatible)
if auditwheel repair --plat manylinux_2_28_x86_64 \
--exclude "libtorch*.so" --exclude "libc10*.so" --exclude "libmkl*.so" \
dist/pymomentum_cpu-*-linux_x86_64.whl -w dist/ 2>&1; then
echo "Successfully repaired to manylinux_2_28 (Colab compatible)"
rm dist/pymomentum_cpu-*-linux_x86_64.whl
else
echo "Cannot repair to manylinux_2_28, falling back to auto-detect"
auditwheel repair \
--exclude "libtorch*.so" --exclude "libc10*.so" --exclude "libmkl*.so" \
dist/pymomentum_cpu-*-linux_x86_64.whl -w dist/ && \
rm dist/pymomentum_cpu-*-linux_x86_64.whl
fi
' || echo "Skip auditwheel (non-Linux)"
""", description = "Wheel: Repair CPU wheel with auditwheel (Linux only). Attempts manylinux_2_28 for Colab compatibility, falls back to auto-detect if symbols are too recent." }
wheel_publish = { cmd = "twine upload --repository pymomentum-cpu dist/pymomentum_cpu-*.whl", depends-on = [
"wheel_check",
"wheel_test",
], description = "Wheel: Publish CPU wheels to PyPI" }
#===========
# linux-64
#===========
[target.linux-64.dependencies]
nvtx-c = ">=3.1.0" # TODO: Add to pytorch as run dep
sysroot_linux-64 = "2.28.*" # Pin to 2.28 for manylinux_2_28 compatibility (Colab requires glibc 2.35 or older)
patchelf = ">=0.17.2,<0.18"
auditwheel = ">=6.4.2,<7"
[target.linux-64.tasks]
# TODO: Check sha256 of fbx202037_fbxsdk_linux
install_fbxsdk = { cmd = """
mkdir -p .deps \
&& curl -fsSL https://damassets.autodesk.net/content/dam/autodesk/www/files/fbx202037_fbxsdk_gcc_linux.tar.gz -o .deps/fbx_sdk.tar.gz \
&& mkdir -p .deps/fbxsdk_download \
&& tar -xzf .deps/fbx_sdk.tar.gz -C .deps/fbxsdk_download \
&& rm .deps/fbx_sdk.tar.gz \
&& chmod ugo+x .deps/fbxsdk_download/fbx202037_fbxsdk_linux \
&& mkdir -p .deps/fbxsdk/2020.3.7 \
&& yes yes | .deps/fbxsdk_download/fbx202037_fbxsdk_linux .deps/fbxsdk/2020.3.7 \
&& rm -rf .deps/fbxsdk_download/fbx202037_fbxsdk_linux
""", outputs = [
".deps/fbxsdk/2020.3.7",
] }
install_deps = { depends-on = ["install_fbxsdk"] }
config = { cmd = """
cmake \
-S . \
-B build/$PIXI_ENVIRONMENT_NAME/cpp/release \
-G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \
-DBUILD_SHARED_LIBS=ON \
-DMOMENTUM_ENABLE_FBX_SAVING=ON \
-DMOMENTUM_BUILD_TESTING=ON \
-DMOMENTUM_BUILD_EXAMPLES=ON \
-DMOMENTUM_BUILD_PYMOMENTUM=$MOMENTUM_BUILD_PYMOMENTUM \
-DMOMENTUM_ENABLE_PROFILING=ON \
-DMOMENTUM_ENABLE_SIMD=$MOMENTUM_ENABLE_SIMD \
-DMOMENTUM_INSTALL_EXAMPLES=ON \
-DMOMENTUM_USE_SYSTEM_GOOGLETEST=ON \
-DMOMENTUM_USE_SYSTEM_PYBIND11=ON \
-DMOMENTUM_USE_SYSTEM_RERUN_CPP_SDK=ON \
-DMOMENTUM_USE_SYSTEM_TRACY=ON
""", env = { FBXSDK_PATH = ".deps/fbxsdk", MOMENTUM_ENABLE_SIMD = "ON", MOMENTUM_BUILD_PYMOMENTUM = "ON" }, depends-on = [
"install_deps",
] }
config_dev = { cmd = """
cmake \
-S . \
-B build/$PIXI_ENVIRONMENT_NAME/cpp/debug \
-G Ninja \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \
-DBUILD_SHARED_LIBS=ON \
-DMOMENTUM_ENABLE_FBX_SAVING=ON \
-DMOMENTUM_BUILD_TESTING=ON \
-DMOMENTUM_BUILD_EXAMPLES=ON \
-DMOMENTUM_BUILD_PYMOMENTUM=$MOMENTUM_BUILD_PYMOMENTUM \
-DMOMENTUM_ENABLE_PROFILING=ON \
-DMOMENTUM_ENABLE_SIMD=$MOMENTUM_ENABLE_SIMD \
-DMOMENTUM_INSTALL_EXAMPLES=ON \
-DMOMENTUM_USE_SYSTEM_GOOGLETEST=ON \
-DMOMENTUM_USE_SYSTEM_PYBIND11=ON \
-DMOMENTUM_USE_SYSTEM_RERUN_CPP_SDK=ON \
-DMOMENTUM_USE_SYSTEM_TRACY=ON
""", env = { FBXSDK_PATH = ".deps/fbxsdk", MOMENTUM_ENABLE_SIMD = "ON", MOMENTUM_BUILD_PYMOMENTUM = "ON" }, depends-on = [
"install_deps",
] }
build_py = { cmd = "pip install . -v --no-build-isolation", env = { FBXSDK_PATH = ".deps/fbxsdk", CMAKE_ARGS = """
-DMOMENTUM_ENABLE_FBX_SAVING=ON \
-DMOMENTUM_ENABLE_SIMD=$MOMENTUM_ENABLE_SIMD \
-DMOMENTUM_USE_SYSTEM_GOOGLETEST=ON \
-DMOMENTUM_USE_SYSTEM_PYBIND11=OFF \
-DMOMENTUM_USE_SYSTEM_RERUN_CPP_SDK=ON \
-DBUILD_SHARED_LIBS=OFF
""", MOMENTUM_ENABLE_SIMD = "ON", TORCH_CUDA_ARCH_LIST = "5.0;6.0;6.1;7.0;7.5;8.0;8.6;8.9;9.0+PTX" }, depends-on = [
"install_deps",
] }
test_py = { cmd = "pytest pymomentum/test/*.py", env = { MOMENTUM_MODELS_PATH = "momentum/" }, depends-on = [
"build_py",
] }
doc_py = { cmd = "sphinx-build -a -E -W -b html pymomentum/doc build/python_api_doc", depends-on = [
"build_py",
] }
open_doc_py = { cmd = "open build/python_api_doc/index.html", depends-on = [
"doc_py",
] }
#============
# osx-64
#============
[target.osx.dependencies]
[target.osx.tasks]
build_py = { cmd = "pip install . -v", env = { CMAKE_ARGS = """
-DMOMENTUM_ENABLE_FBX_SAVING=$MOMENTUM_ENABLE_FBX_SAVING \
-DMOMENTUM_ENABLE_SIMD=$MOMENTUM_ENABLE_SIMD \
-DMOMENTUM_USE_SYSTEM_GOOGLETEST=ON \
-DMOMENTUM_USE_SYSTEM_PYBIND11=ON \
-DMOMENTUM_USE_SYSTEM_RERUN_CPP_SDK=ON \
-DBUILD_SHARED_LIBS=OFF
""", MOMENTUM_ENABLE_FBX_SAVING = "OFF", MOMENTUM_ENABLE_SIMD = "ON" } }
# TODO: Remove -k option, once saving tests are disabled programmatically when Autodesk FBX SDK is unavailable (FBX loading always works via OpenFBX)
test_py = { cmd = "pytest pymomentum/test/*.py -k 'not (TestFBXIO and (test_save_motions_with_joint_params or test_save_motions_with_model_params))'", env = { MOMENTUM_MODELS_PATH = "momentum/" }, depends-on = [
"build_py", "install",
] }
doc_py = { cmd = "sphinx-build -a -E -W -b html pymomentum/doc build/python_api_doc", depends-on = [
"build_py",
] }
open_doc_py = { cmd = "open build/python_api_doc/index.html", depends-on = [
"doc_py",
] }
#============
# osx-arm64
#============
[target.osx-arm64.dependencies]
[target.osx-arm64.tasks]
build_py = { cmd = "pip install . -v", env = { CMAKE_ARGS = """
-DMOMENTUM_ENABLE_FBX_SAVING=$MOMENTUM_ENABLE_FBX_SAVING \
-DMOMENTUM_ENABLE_SIMD=$MOMENTUM_ENABLE_SIMD \
-DMOMENTUM_USE_SYSTEM_GOOGLETEST=ON \
-DMOMENTUM_USE_SYSTEM_PYBIND11=ON \
-DMOMENTUM_USE_SYSTEM_RERUN_CPP_SDK=ON \
-DBUILD_SHARED_LIBS=OFF
""", MOMENTUM_ENABLE_FBX_SAVING = "OFF", MOMENTUM_ENABLE_SIMD = "ON" } }
# TODO: Remove -k option, once saving tests are disabled programmatically when Autodesk FBX SDK is unavailable (FBX loading always works via OpenFBX)
test_py = { cmd = "pytest pymomentum/test/*.py -k 'not (TestFBXIO and (test_save_motions_with_joint_params or test_save_motions_with_model_params))'", env = { MOMENTUM_MODELS_PATH = "momentum/" }, depends-on = [
"build_py", "install",
] }
doc_py = { cmd = "sphinx-build -a -E -W -b html pymomentum/doc build/python_api_doc", depends-on = [
"build_py",
] }
open_doc_py = { cmd = "open build/python_api_doc/index.html", depends-on = [
"doc_py",
] }
#=========
# win-64
#=========
[target.win-64.dependencies]
delvewheel = ">=1.8.7,<2"
[target.win-64.tasks]
config = { cmd = """
cmake \
-S . \
-B build/$PIXI_ENVIRONMENT_NAME/cpp \
-G 'Visual Studio 17 2022' \
-DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \
-DBUILD_SHARED_LIBS=ON \
-DMOMENTUM_BUILD_EXAMPLES=ON \
-DMOMENTUM_ENABLE_FBX_SAVING=$MOMENTUM_ENABLE_FBX_SAVING \
-DMOMENTUM_BUILD_PYMOMENTUM=$MOMENTUM_BUILD_PYMOMENTUM \
-DMOMENTUM_BUILD_TESTING=ON \
-DMOMENTUM_ENABLE_PROFILING=ON \
-DMOMENTUM_ENABLE_SIMD=%MOMENTUM_ENABLE_SIMD% \
-DMOMENTUM_INSTALL_EXAMPLES=ON \
-DMOMENTUM_USE_SYSTEM_GOOGLETEST=ON \
-DMOMENTUM_USE_SYSTEM_PYBIND11=ON \
-DMOMENTUM_USE_SYSTEM_RERUN_CPP_SDK=ON \
-DMOMENTUM_USE_SYSTEM_TRACY=ON
""", env = { MOMENTUM_ENABLE_FBX_SAVING = "OFF", MOMENTUM_BUILD_PYMOMENTUM = "OFF", MOMENTUM_ENABLE_SIMD = "ON" } }
open_vs = { cmd = "cmd /c start build\\$PIXI_ENVIRONMENT_NAME\\cpp\\momentum.sln", depends-on = [
"config",
] }
build = { cmd = "cmake --build build/$PIXI_ENVIRONMENT_NAME/cpp --config Release --parallel", depends-on = [
"config",
] }
build_dev = { cmd = "cmake --build build/$PIXI_ENVIRONMENT_NAME/cpp --config Debug --parallel", depends-on = [
"config",
] }
test = { cmd = "cmd /c \"set PATH=build\\$PIXI_ENVIRONMENT_NAME\\cpp\\Release;%PATH% & ctest --test-dir build/$PIXI_ENVIRONMENT_NAME/cpp --output-on-failure --build-config Release\"", depends-on = [
"build",
] }
test_dev = { cmd = "cmd /c \"set PATH=build\\$PIXI_ENVIRONMENT_NAME\\cpp\\Debug;%PATH% & ctest --test-dir build/$PIXI_ENVIRONMENT_NAME/cpp --output-on-failure --build-config Debug\"", depends-on = [
"build_dev",
] }
hello_world = { cmd = "build/$PIXI_ENVIRONMENT_NAME/cpp/Release/hello_world.exe", depends-on = [
"build",
] }
convert_model = { cmd = "build/$PIXI_ENVIRONMENT_NAME/cpp/Release/convert_model.exe", depends-on = [
"build",
] }
c3d_viewer = { cmd = "build/$PIXI_ENVIRONMENT_NAME/cpp/Release/c3d_viewer.exe", depends-on = [
"build",
] }
fbx_viewer = { cmd = "build/$PIXI_ENVIRONMENT_NAME/cpp/Release/fbx_viewer.exe", depends-on = [
"build",
] }
glb_viewer = { cmd = "build/$PIXI_ENVIRONMENT_NAME/cpp/Release/glb_viewer.exe", depends-on = [
"build",
] }
urdf_viewer = { cmd = "build/$PIXI_ENVIRONMENT_NAME/cpp/Release/urdf_viewer.exe", depends-on = [
"build",
] }
process_markers = { cmd = "build/$PIXI_ENVIRONMENT_NAME/cpp/Release/process_markers_app.exe", depends-on = [
"build",
] }
refine_motion = { cmd = "build/$PIXI_ENVIRONMENT_NAME/cpp/Release/refine_motion.exe", depends-on = [
"build",
] }
export_objs = { cmd = "build/$PIXI_ENVIRONMENT_NAME/cpp/Release/export_objs.exe", depends-on = [
"build",
] }
animate_shapes = { cmd = "build/$PIXI_ENVIRONMENT_NAME/cpp/Release/animate_shapes.exe", depends-on = [
"build",
] }
install = { cmd = "cmake --build build/$PIXI_ENVIRONMENT_NAME/cpp --target install --config Release --parallel", depends-on = [
"build",
] }
tracy = { cmd = "tracy-profiler.exe" }
build_py = { cmd = "pip install . -v", env = { CMAKE_ARGS = """
-DMOMENTUM_ENABLE_FBX_SAVING=$MOMENTUM_ENABLE_FBX_SAVING \
-DMOMENTUM_ENABLE_SIMD=$MOMENTUM_ENABLE_SIMD \
-DMOMENTUM_USE_SYSTEM_GOOGLETEST=ON \
-DMOMENTUM_USE_SYSTEM_PYBIND11=OFF \
-DMOMENTUM_USE_SYSTEM_RERUN_CPP_SDK=ON \
-DBUILD_SHARED_LIBS=OFF
""", MOMENTUM_ENABLE_FBX_SAVING = "OFF", MOMENTUM_ENABLE_SIMD = "ON", TORCH_CUDA_ARCH_LIST = "5.0;6.0;6.1;7.0;7.5;8.0;8.6;8.9;9.0+PTX" } }
# TODO: Remove -k option, once saving tests are disabled programmatically when Autodesk FBX SDK is unavailable (FBX loading always works via OpenFBX)
# TODO: Remove test_lighting skip once stack overflow issue on Windows is resolved (currently causes crash with CMake build)
test_py = { cmd = "pytest pymomentum/test/*.py -k 'not ((TestFBXIO and (test_save_motions_with_joint_params or test_save_motions_with_model_params)) or test_lighting)'", env = { MOMENTUM_MODELS_PATH = "momentum/" }, depends-on = [
"build_py", "install",
] }
#==============
# Feature: CPU
#==============
[feature.py312]
dependencies = { python = "3.12.*" }
[feature.py313]
dependencies = { python = "3.13.*" }
#==============
# Feature: GPU
#==============
[feature.py312-cuda129]
platforms = ["linux-64", "win-64"]
system-requirements = { cuda = "12" }
dependencies = { cuda-toolkit = ">=12.9.0,<13", nvtx-c = ">=3.1.1", cuda-version = "12.9.*", python = "3.12.*", pytorch-gpu = ">=2.8.0,<3" }
[feature.py312-cuda129.tasks]
# GPU-specific wheel tasks - build GPU wheels
wheel_build = { cmd = """
python -c "import os, shutil; os.makedirs('.tmp', exist_ok=True); shutil.copy('pyproject.toml', '.tmp/pyproject-backup.toml'); shutil.copy('pyproject-pypi-gpu.toml', 'pyproject.toml')" && \
pip wheel . --no-deps --no-build-isolation --wheel-dir=dist && \
python -c "import shutil; shutil.move('.tmp/pyproject-backup.toml', 'pyproject.toml')"
""", depends-on = [
"wheel_generate_config",
], description = "Wheel: Build GPU wheel for current Python version. On CI (Ubuntu), produces Colab-compatible wheels. On newer systems (Fedora 42+), produces wheels for local testing only." }
wheel_repair = { cmd = """
bash -c '
# Try to repair to manylinux_2_28 first (Colab compatible)
if auditwheel repair --plat manylinux_2_28_x86_64 \
--exclude "libtorch*.so" --exclude "libc10*.so" \
--exclude "libcu*.so*" --exclude "libnv*.so*" --exclude "libmkl*.so" \
dist/pymomentum_gpu-*-linux_x86_64.whl -w dist/ 2>&1; then
echo "Successfully repaired to manylinux_2_28 (Colab compatible)"
rm dist/pymomentum_gpu-*-linux_x86_64.whl
else
echo "Cannot repair to manylinux_2_28, falling back to auto-detect"
auditwheel repair \
--exclude "libtorch*.so" --exclude "libc10*.so" \
--exclude "libcu*.so*" --exclude "libnv*.so*" --exclude "libmkl*.so" \
dist/pymomentum_gpu-*-linux_x86_64.whl -w dist/ && \
rm dist/pymomentum_gpu-*-linux_x86_64.whl
fi
' || echo "Skip auditwheel (non-Linux)"
""", description = "Wheel: Repair GPU wheel with auditwheel (Linux only). Attempts manylinux_2_28 for Colab compatibility, falls back to auto-detect if symbols are too recent." }
wheel_publish = { cmd = "twine upload --repository pymomentum-gpu dist/pymomentum_gpu-*.whl", depends-on = [
"wheel_check",
"wheel_test",
], description = "Wheel: Publish GPU wheels to PyPI" }
[feature.py313-cuda129]
platforms = ["linux-64", "win-64"]
system-requirements = { cuda = "12" }
dependencies = { cuda-toolkit = ">=12.9.0,<13", nvtx-c = ">=3.1.1", cuda-version = "12.9.*", python = "3.13.*", pytorch-gpu = ">=2.8.0,<3" }
[feature.py313-cuda129.tasks]
# GPU-specific wheel tasks - build GPU wheels
wheel_build = { cmd = """
python -c "import os, shutil; os.makedirs('.tmp', exist_ok=True); shutil.copy('pyproject.toml', '.tmp/pyproject-backup.toml'); shutil.copy('pyproject-pypi-gpu.toml', 'pyproject.toml')" && \
pip wheel . --no-deps --no-build-isolation --wheel-dir=dist && \
python -c "import shutil; shutil.move('.tmp/pyproject-backup.toml', 'pyproject.toml')"
""", depends-on = [
"wheel_generate_config",
], description = "Wheel: Build GPU wheel for current Python version. On CI (Ubuntu), produces Colab-compatible wheels. On newer systems (Fedora 42+), produces wheels for local testing only." }
wheel_repair = { cmd = """
bash -c '
# Try to repair to manylinux_2_28 first (Colab compatible)
if auditwheel repair --plat manylinux_2_28_x86_64 \
--exclude "libtorch*.so" --exclude "libc10*.so" \
--exclude "libcu*.so*" --exclude "libnv*.so*" --exclude "libmkl*.so" \
dist/pymomentum_gpu-*-linux_x86_64.whl -w dist/ 2>&1; then
echo "Successfully repaired to manylinux_2_28 (Colab compatible)"
rm dist/pymomentum_gpu-*-linux_x86_64.whl
else
echo "Cannot repair to manylinux_2_28, falling back to auto-detect"
auditwheel repair \
--exclude "libtorch*.so" --exclude "libc10*.so" \
--exclude "libcu*.so*" --exclude "libnv*.so*" --exclude "libmkl*.so" \
dist/pymomentum_gpu-*-linux_x86_64.whl -w dist/ && \
rm dist/pymomentum_gpu-*-linux_x86_64.whl
fi
' || echo "Skip auditwheel (non-Linux)"
""", description = "Wheel: Repair GPU wheel with auditwheel (Linux only). Attempts manylinux_2_28 for Colab compatibility, falls back to auto-detect if symbols are too recent." }
wheel_publish = { cmd = "twine upload --repository pymomentum-gpu dist/pymomentum_gpu-*.whl", depends-on = [
"wheel_check",
"wheel_test",
], description = "Wheel: Publish GPU wheels to PyPI" }
#==============
# Environments
#==============
[environments]
# CPU environments (default - no feature needed since pytorch-cpu is in global dependencies)
py312 = ["py312"]
py313 = ["py313"]
# GPU environments
py312-cuda129 = ["py312-cuda129"]
py313-cuda129 = ["py313-cuda129"]
gpu = ["py312-cuda129"]
# Default environment
default = ["py312"]