@@ -12,8 +12,9 @@ NUM_CORES=$(sysctl -n hw.logicalcpu)
1212# Source environment from before-all
1313source ${INSTALL_PREFIX} /env.sh
1414
15- # Get the Python executable provided by cibuildwheel
16- PYTHON_EXE=$( which python)
15+ # Get the Python executable provided by cibuildwheel (full path)
16+ # Use `python -c` so we get the exact interpreter executable path
17+ PYTHON_EXE=$( python -c " import sys; print(sys.executable)" )
1718PYTHON_VERSION=$( $PYTHON_EXE -c " import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}')" )
1819
1920echo " Building for Python ${PYTHON_VERSION} at ${PYTHON_EXE} "
@@ -106,7 +107,8 @@ sed -i '' 's/Interpreter Development/Interpreter Development.Module/g' \
106107# Build GTDynamics C++ extension for this Python version
107108echo " Building GTDynamics C++ extension..."
108109GTD_BUILD=" ${INSTALL_PREFIX} /gtd_build_py${PYTHON_VERSION} "
109- rm -rf ${GTD_BUILD}
110+ GTD_PREFIX=" ${INSTALL_PREFIX} /gtd_py${PYTHON_VERSION} "
111+ rm -rf ${GTD_BUILD} ${GTD_PREFIX}
110112mkdir -p ${GTD_BUILD}
111113
112114cd ${GTD_BUILD}
@@ -133,14 +135,13 @@ find ${GTD_BUILD}/python/gtdynamics -name "gtdynamics*.so" \
133135 -exec cp {} ${PROJECT_DIR} /python/gtdynamics/ \;
134136
135137# Install GTDynamics shared library where delocate-wheel can find it
136- GTD_PREFIX=" ${INSTALL_PREFIX} /gtd_py${PYTHON_VERSION} "
137138mkdir -p ${GTD_PREFIX} /lib
138139find ${GTD_BUILD} -maxdepth 2 -name " libgtdynamics*.dylib" \
139140 -exec cp {} ${GTD_PREFIX} /lib/ \;
140141rm -f ${INSTALL_PREFIX} /gtd_current
141142ln -sf ${GTD_PREFIX} ${INSTALL_PREFIX} /gtd_current
142143
143- # Remove any accidental duplicate gtsam dylibs from GTDynamics lib directory
144+ # Remove any duplicate gtsam dylibs from GTDynamics lib directory
144145find ${GTD_PREFIX} /lib -name " libgtsam*.dylib" -delete
145146
146147export DYLD_LIBRARY_PATH=" ${GTD_PREFIX} /lib:${DYLD_LIBRARY_PATH} "
0 commit comments