Skip to content

Commit 98ab69a

Browse files
committed
Extend search for .so files of GTD
1 parent 300dfd1 commit 98ab69a

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

.github/scripts/cibw_before_build_linux.sh

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,24 @@ cmake ${PROJECT_DIR} \
102102
cmake --build . --config Release --target gtdynamics_py -j${NUM_CORES}
103103
cmake --install .
104104

105+
105106
# 6. Stage GTDynamics extension from Clean Prefix
106-
echo "Copying built extension to source tree..."
107-
find "${GTD_PREFIX}" -name "gtdynamics*.so" -exec cp -v {} "${PROJECT_DIR}/python/gtdynamics/" \;
107+
echo "Staging GTDynamics extension..."
108+
# Robustly find the extension anywhere in the install prefix
109+
GTD_SO_PATH=$(find "${GTD_PREFIX}" -path "*/gtdynamics/*.so" -o -name "gtdynamics*.so" -print -quit)
110+
111+
if [ -z "$GTD_SO_PATH" ]; then
112+
echo "ERROR: Could not find gtdynamics extension in ${GTD_PREFIX}"
113+
# Let's list the prefix so you can see where it went in the logs
114+
find "${GTD_PREFIX}" -maxdepth 4
115+
exit 1
116+
fi
117+
118+
# Copy it and force the name to gtdynamics.so to match your __init__.py
119+
cp -v "$GTD_SO_PATH" "${PROJECT_DIR}/python/gtdynamics/gtdynamics.so"
120+
121+
# DEBUG: List the destination to be 100% sure it's there
122+
ls -lh "${PROJECT_DIR}/python/gtdynamics/gtdynamics.so"
108123

109124
# Finalize GTDynamics library path
110125
rm -f ${INSTALL_PREFIX}/gtd_current

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ path = "hatch_build.py"
6363

6464
[tool.hatch.build.targets.wheel]
6565
packages = ["python/gtdynamics", "python/gtsam"]
66+
artifacts = ["*.so"]
6667

6768
[tool.uv.build-backend]
6869
module-name = "gtdynamics"

0 commit comments

Comments
 (0)