3 Commits

5 changed files with 20 additions and 4 deletions

View File

@@ -28,7 +28,7 @@ jobs:
unzip libtorch-cxx11-abi-shared-with-deps-2.3.1+cpu.zip unzip libtorch-cxx11-abi-shared-with-deps-2.3.1+cpu.zip
- name: Tests & build-wrapper - name: Tests & build-wrapper
run: | run: |
cmake -S . -B build -Wno-dev -DCMAKE_PREFIX_PATH=$(pwd)/libtorch cmake -S . -B build -Wno-dev -DCMAKE_PREFIX_PATH=$(pwd)/libtorch -DENABLE_TESTING=ON
build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} cmake --build build/ --config Release build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} cmake --build build/ --config Release
cd build cd build
make make

2
.gitignore vendored
View File

@@ -33,6 +33,8 @@
**/build **/build
build_Debug build_Debug
build_Release build_Release
build_debug
build_release
**/lcoverage **/lcoverage
.idea .idea
cmake-* cmake-*

View File

@@ -6,4 +6,6 @@ include_directories(${TORCH_INCLUDE_DIRS})
add_library(mdlp CPPFImdlp.cpp Metrics.cpp BinDisc.cpp Discretizer.cpp) add_library(mdlp CPPFImdlp.cpp Metrics.cpp BinDisc.cpp Discretizer.cpp)
target_link_libraries(mdlp "${TORCH_LIBRARIES}") target_link_libraries(mdlp "${TORCH_LIBRARIES}")
add_subdirectory(sample) add_subdirectory(sample)
add_subdirectory(tests) if (ENABLE_TESTING)
add_subdirectory(tests)
endif(ENABLE_TESTING)

13
Makefile Normal file
View File

@@ -0,0 +1,13 @@
SHELL := /bin/bash
.DEFAULT_GOAL := build
.PHONY: build test
build:
@if [ -d build_release ]; then rm -fr build_release; fi
@mkdir build_release
@cmake -B build_release -S . -DCMAKE_BUILD_TYPE=Release -DENABLE_TESTING=OFF
@cmake --build build_release
test:
@echo "Testing..."
@cd tests && ./test

View File

@@ -34,6 +34,5 @@ build/sample/sample -h
To run the tests and see coverage (llvm & gcovr have to be installed), execute the following commands: To run the tests and see coverage (llvm & gcovr have to be installed), execute the following commands:
```bash ```bash
cd tests make test
./test
``` ```