Crates.io | xaynet-mobile |
lib.rs | xaynet-mobile |
version | 0.1.0 |
source | src |
created_at | 2021-01-18 11:15:18.735181 |
updated_at | 2021-01-18 11:15:18.735181 |
description | The Xayn Network project is building a privacy layer for machine learning so that AI projects can meet compliance such as GDPR and CCPA. The approach relies on Federated Learning as enabling technology that allows production AI applications to be fully privacy compliant. |
homepage | https://xaynet.dev/ |
repository | https://github.com/xaynetwork/xaynet/ |
max_upload_size | |
id | 343466 |
size | 104,855 |
ffi-support
provides some helpful macros to reduce boilerplate code.
However the feature (--pretty=expanded
) to expand these macros
during the generation of the C-header file is still
unstable. Therefore we need to use the rust nightly.
To generate the header files, install cbindgen
and run:
cargo build
RUSTUP_TOOLCHAIN=nightly cbindgen \
--config cbindgen.toml \
--crate xaynet-mobile \
--output xaynet_ffi.h
cc -o tests/ffi_test.o -Wl,-dead_strip -I. tests/ffi_test.c ../target/debug/libxaynet_mobile.a -framework Security -framework Foundation
./tests/ffi_test.o
gcc \
tests/ffi_test.c
-Wall \
-I. \
-lpthread -lm -ldl \
../target/debug/libxaynet_mobile.a \
-o tests/ffi_test.o
./tests/ffi_test.o
To check for memory leaks, you can use Valgrind:
valgrind --tool=memcheck --leak-check=full --show-leak-kinds=all -s ./tests/ffi_test.o