mirror of
https://github.com/rmontanana/mdlp.git
synced 2025-08-15 15:35:55 +00:00
2.9 KiB
2.9 KiB
Conan Package for fimdlp
This directory contains the Conan package configuration for the fimdlp library.
Dependencies
The package manages the following dependencies:
Build Requirements
- libtorch/2.4.1 - PyTorch C++ library for tensor operations
Test Requirements (when testing enabled)
- catch2/3.8.1 - Modern C++ testing framework
- arff-files - ARFF file format support (included locally in tests/lib/Files/)
Building with Conan
1. Install Dependencies and Build
# Install dependencies
conan install . --output-folder=build --build=missing
# Build the project
cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Release
cmake --build .
2. Using the Build Script
# Build release version
./scripts/build_conan.sh
# Build with tests
./scripts/build_conan.sh --test
Creating a Package
1. Create Package Locally
conan create . --profile:build=default --profile:host=default
2. Create Package with Options
# Create with testing enabled
conan create . -o enable_testing=True --profile:build=default --profile:host=default
# Create shared library version
conan create . -o shared=True --profile:build=default --profile:host=default
3. Using the Package Creation Script
./scripts/create_package.sh
Uploading to Cimmeria
1. Configure Remote
# Add Cimmeria remote
conan remote add cimmeria <cimmeria-server-url>
# Login to Cimmeria
conan remote login cimmeria <username>
2. Upload Package
# Upload the package
conan upload fimdlp/2.1.0 --remote=cimmeria --all
# Or use the script (will configure remote instructions if not set up)
./scripts/create_package.sh
Using the Package
In conanfile.txt
[requires]
fimdlp/2.1.0
[generators]
CMakeDeps
CMakeToolchain
In conanfile.py
def requirements(self):
self.requires("fimdlp/2.1.0")
In CMakeLists.txt
find_package(fimdlp REQUIRED)
target_link_libraries(your_target fimdlp::fimdlp)
Package Options
Option | Values | Default | Description |
---|---|---|---|
shared | True/False | False | Build shared library |
fPIC | True/False | True | Position independent code |
enable_testing | True/False | False | Enable test suite |
enable_sample | True/False | False | Build sample program |
Example Usage
#include <fimdlp/CPPFImdlp.h>
#include <fimdlp/Metrics.h>
int main() {
// Create MDLP discretizer
CPPFImdlp discretizer;
// Calculate entropy
Metrics metrics;
std::vector<int> labels = {0, 1, 0, 1, 1};
double entropy = metrics.entropy(labels);
return 0;
}
Testing
The package includes comprehensive tests that can be enabled with:
conan create . -o enable_testing=True
Requirements
- C++17 compatible compiler
- CMake 3.20 or later
- Conan 2.0 or later