Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .github/workflows/conda-packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,17 +96,17 @@ jobs:
# Check Python module in site-packages
echo "Checking Python module..."
SITE_PACKAGES=$(conda run -n test-install python -c "import sysconfig; print(sysconfig.get_path('purelib'))")
if [ -f "$SITE_PACKAGES/simcoon/simmit.so" ] || ls "$SITE_PACKAGES/simcoon"/simmit.cpython*.so 1>/dev/null 2>&1; then
echo "✓ simmit.so found in site-packages/simcoon"
if [ -f "$SITE_PACKAGES/simcoon/_core.so" ] || ls "$SITE_PACKAGES/simcoon"/_core.cpython*.so 1>/dev/null 2>&1; then
echo "✓ _core.so found in site-packages/simcoon"
else
echo "✗ ERROR: simmit.so NOT found in site-packages/simcoon"
echo "✗ ERROR: _core.so NOT found in site-packages/simcoon"
ls -la $SITE_PACKAGES/simcoon/ || true
exit 1
fi

# Verify simmit links to system libsimcoon (not bundled)
echo "Checking simmit RPATH..."
SIMMIT_PATH=$(find $SITE_PACKAGES/simcoon -name "simmit*.so" | head -1)
# Verify _core links to system libsimcoon (not bundled)
echo "Checking _core RPATH..."
SIMMIT_PATH=$(find $SITE_PACKAGES/simcoon -name "_core*.so" | head -1)
if [ -n "$SIMMIT_PATH" ]; then
if command -v readelf &> /dev/null; then
readelf -d "$SIMMIT_PATH" | grep -E "(RPATH|RUNPATH)" || echo "(no RPATH/RUNPATH found)"
Expand All @@ -126,7 +126,7 @@ jobs:

# Test import
echo "Testing Python import..."
conda run -n test-install python -c "import simcoon; import simcoon.simmit; print('✓ Import successful')"
conda run -n test-install python -c "import simcoon; import simcoon._core; print('✓ Import successful')"

- name: Install and verify package structure (Windows)
if: runner.os == 'Windows'
Expand Down Expand Up @@ -163,7 +163,7 @@ jobs:

# Test import
Write-Host "Testing Python import..."
conda run -n test-install python -c "import simcoon; import simcoon.simmit; print('Import successful')"
conda run -n test-install python -c "import simcoon; import simcoon._core; print('Import successful')"

- name: Upload to Anaconda
if: github.event_name == 'workflow_dispatch'
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ target_link_libraries(simcoon
)

# On Windows with Python bindings, link libsimcoon to carma to use NumPy's memory allocator.
# This prevents heap corruption when Armadillo objects cross the libsimcoon/simmit boundary.
# This prevents heap corruption when Armadillo objects cross the libsimcoon/_core boundary.
# Only needed on Windows due to stricter heap validation.
# See: https://github.com/RUrlus/carma/issues/89
if(WIN32 AND BUILD_PYTHON_BINDINGS)
Expand Down
4 changes: 2 additions & 2 deletions Install.bat
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
:: conda install -c conda-forge git cmake python=3.9 boost -y
:: conda install -c conda-forge git cmake python=3.9 -y

set PREFIX=%CONDA_PREFIX%
set SRC_DIR=%cd%
Expand Down Expand Up @@ -55,7 +55,7 @@ cd %SP_DIR%
mkdir simcoon
cd simcoon
type NUL > __init__.py
xcopy /s /i %SRC_DIR%\simcoon-python-builder\build\lib\Release\simmit.pyd %SP_DIR%\simcoon
xcopy /s /i %SRC_DIR%\simcoon-python-builder\build\lib\Release\_core.pyd %SP_DIR%\simcoon
if errorlevel 1 exit 1

REM xcopy /s /i %SRC_DIR%\armadillo\examples\lib_win64\libopenblas.dll %PREFIX%\Library\bin
Expand Down
8 changes: 4 additions & 4 deletions Install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ fi

#Ask for installation of the simcoon library
while true; do
read -p "Do you want to install simcoon library (necessary to use libsimcoon.so and simmit) ? " yn
read -p "Do you want to install simcoon library (necessary to use libsimcoon.so) ? " yn
case $yn in
[YyOo]* ) Install_check='OK'; break;;
[Nn]* ) Install_check='NO'; break;;
Expand Down Expand Up @@ -221,7 +221,7 @@ then

cd ..
cd ..
cp ${current_dir}/simcoon-python-builder/build/lib/simmit.so ${current_dir}/python-setup/simcoon/simmit.so
cp ${current_dir}/simcoon-python-builder/build/lib/_core.so ${current_dir}/python-setup/simcoon/_core.so
cd ${current_dir}/python-setup

#Change the current dir and install python library
Expand All @@ -233,8 +233,8 @@ then
# if [ $OS = "Mac" ]
# then
# install_name_tool -change libsimcoon.dylib @rpath/libsimcoon.dylib $CONDA_PREFIX/lib/libarma2numpy.dylib
# install_name_tool -change libarma2numpy.dylib @rpath/libarma2numpy.dylib $CONDA_PREFIX/lib/python${python_version}/site-packages/simcoon/simmit.so
# install_name_tool -change libsimcoon.dylib @rpath/libsimcoon.dylib $CONDA_PREFIX/lib/python${python_version}/site-packages/simcoon/simmit.so
# install_name_tool -change libarma2numpy.dylib @rpath/libarma2numpy.dylib $CONDA_PREFIX/lib/python${python_version}/site-packages/simcoon/_core.so
# install_name_tool -change libsimcoon.dylib @rpath/libsimcoon.dylib $CONDA_PREFIX/lib/python${python_version}/site-packages/simcoon/_core.so
# fi

cd ${current_dir}/simcoon-python-builder/build
Expand Down
Loading
Loading