Skip to content
Merged
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
15 changes: 11 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.12"]

steps:
Expand Down Expand Up @@ -61,19 +61,26 @@ jobs:
-DMTLEARN_BUILD_PYTHON=ON \
-DMTLEARN_WITH_TORCH=ON \
-DMTLEARN_ENABLE_EMBED=OFF \
-DCMAKE_BUILD_TYPE=Release \
-DPYTHON_EXECUTABLE="$(python -c 'import sys; print(sys.executable)')" \
-DCMAKE_PREFIX_PATH="${{ steps.cmake-prefix.outputs.value }}"

- name: Build
run: cmake --build build --parallel
run: cmake --build build --parallel --config Release

- name: Run CTest
run: ctest --test-dir build --output-on-failure
run: ctest --test-dir build --output-on-failure -C Release

- name: Run Python tests
shell: bash
run: |
export PYTHONPATH="${PWD}/mtlearn/python:${PWD}/build/mtlearn/bindings"
if [[ "${RUNNER_OS}" == "Windows" ]]; then
package_path="$(cygpath -w "${PWD}/mtlearn/python")"
bindings_path="$(cygpath -w "${PWD}/build/mtlearn/bindings")"
export PYTHONPATH="${package_path};${bindings_path}"
else
export PYTHONPATH="${PWD}/mtlearn/python:${PWD}/build/mtlearn/bindings"
fi
python -m pytest -q -m "not gradcheck" mtlearn/tests/python
python -m pytest -q -m gradcheck mtlearn/tests/python

Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ The main public experiment example is:
notebooks/experiments/Example_screws_filtering.ipynb
```

Representative ICPR 2026 experiment notebooks are available in
[notebooks/ICPR2026](notebooks/ICPR2026/README.md).

## Implementation Notes

`ConnectedFilterPreprocessingLayer` is the recommended implementation for new
Expand Down
10 changes: 9 additions & 1 deletion mtlearn/bindings/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,15 @@ if(MTLEARN_WITH_TORCH)
target_compile_definitions(_mtlearn PRIVATE MTLEARN_WITH_TORCH=1)
endif()

set_target_properties(_mtlearn PROPERTIES OUTPUT_NAME "_mtlearn")
set_target_properties(_mtlearn PROPERTIES
OUTPUT_NAME "_mtlearn"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
foreach(_mtlearn_config DEBUG RELEASE RELWITHDEBINFO MINSIZEREL)
set_target_properties(_mtlearn PROPERTIES
LIBRARY_OUTPUT_DIRECTORY_${_mtlearn_config} "${CMAKE_CURRENT_BINARY_DIR}"
RUNTIME_OUTPUT_DIRECTORY_${_mtlearn_config} "${CMAKE_CURRENT_BINARY_DIR}")
endforeach()
set_property(TARGET _mtlearn PROPERTY CXX_STANDARD 20)
set_property(TARGET _mtlearn PROPERTY CXX_STANDARD_REQUIRED ON)
set_property(TARGET _mtlearn PROPERTY CXX_EXTENSIONS OFF)
Expand Down
10 changes: 5 additions & 5 deletions mtlearn/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,24 +102,24 @@ if(_mtlearn_build_python_tests)
"`pip install -e .[test]`.")
endif()

set(_mtlearn_path_separator ":")
if(WIN32)
set(_mtlearn_pythonpath "${PROJECT_SOURCE_DIR}/mtlearn/python;${CMAKE_BINARY_DIR}/mtlearn/bindings")
else()
set(_mtlearn_pythonpath "${PROJECT_SOURCE_DIR}/mtlearn/python:${CMAKE_BINARY_DIR}/mtlearn/bindings")
set(_mtlearn_path_separator "$<SEMICOLON>")
endif()
set(_mtlearn_pythonpath "${PROJECT_SOURCE_DIR}/mtlearn/python${_mtlearn_path_separator}${CMAKE_BINARY_DIR}/mtlearn/bindings")

add_test(
NAME mtl_python_bindings
COMMAND
${CMAKE_COMMAND} -E env
PYTHONPATH=${_mtlearn_pythonpath}
"PYTHONPATH=${_mtlearn_pythonpath}"
${Python3_EXECUTABLE} -m pytest -q -m "not gradcheck" ${CMAKE_CURRENT_SOURCE_DIR}/python
)
add_test(
NAME mtl_python_gradchecks
COMMAND
${CMAKE_COMMAND} -E env
PYTHONPATH=${_mtlearn_pythonpath}
"PYTHONPATH=${_mtlearn_pythonpath}"
${Python3_EXECUTABLE} -m pytest -q -m gradcheck ${CMAKE_CURRENT_SOURCE_DIR}/python
)
endif()
Expand Down
31 changes: 20 additions & 11 deletions mtlearn/tests/cmake/installed_consumer_test.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,18 @@ file(WRITE "${consumer_source_dir}/main.cpp"
" return 0;\n"
"}\n")

set(consumer_configure_command
"${CMAKE_COMMAND}"
-S "${consumer_source_dir}"
-B "${consumer_build_dir}"
"-DCMAKE_PREFIX_PATH=${prefix}")

if(DEFINED MTLEARN_CTEST_CONFIG AND NOT "${MTLEARN_CTEST_CONFIG}" STREQUAL "")
list(APPEND consumer_configure_command "-DCMAKE_BUILD_TYPE=${MTLEARN_CTEST_CONFIG}")
endif()

execute_process(
COMMAND
"${CMAKE_COMMAND}"
-S "${consumer_source_dir}"
-B "${consumer_build_dir}"
"-DCMAKE_PREFIX_PATH=${prefix}"
COMMAND ${consumer_configure_command}
RESULT_VARIABLE configure_result
OUTPUT_VARIABLE configure_output
ERROR_VARIABLE configure_error)
Expand Down Expand Up @@ -111,14 +117,17 @@ if(NOT build_result EQUAL 0)
"stderr:\n${build_error}")
endif()

set(consumer_executable "${consumer_build_dir}/consumer")

if(DEFINED MTLEARN_CTEST_CONFIG AND NOT "${MTLEARN_CTEST_CONFIG}" STREQUAL "")
set(consumer_executable "${consumer_build_dir}/${MTLEARN_CTEST_CONFIG}/consumer")
set(consumer_executable_name "consumer")
if(WIN32)
set(consumer_executable_name "consumer.exe")
endif()

if(WIN32)
set(consumer_executable "${consumer_executable}.exe")
set(consumer_executable "${consumer_build_dir}/${consumer_executable_name}")
if(DEFINED MTLEARN_CTEST_CONFIG AND NOT "${MTLEARN_CTEST_CONFIG}" STREQUAL "")
set(config_consumer_executable "${consumer_build_dir}/${MTLEARN_CTEST_CONFIG}/${consumer_executable_name}")
if(EXISTS "${config_consumer_executable}")
set(consumer_executable "${config_consumer_executable}")
endif()
endif()

execute_process(
Expand Down
Loading
Loading