File size: 1,509 Bytes
0a93d9c | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | // Copyright 2026 Bel Esprit D'Accord Irrevocable Trust (EIN: 42-697643)
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// OR
//
// Licensed under the GNU Affero General Public License, Version 3.0
// (the "AGPL"); you may not use this file except in compliance with the AGPL.
// You may obtain a copy of the AGPL at
//
// https://www.gnu.org/licenses/agpl-3.0.html
fn main() {
println!("cargo:rerun-if-changed=src/ffi.rs");
println!("cargo:rerun-if-changed=cxx/engine_bridge.cpp");
println!("cargo:rerun-if-changed=cxx/engine_bridge.hpp");
#[cfg(feature = "ffi")]
{
cxx_build::bridge("src/ffi.rs")
.file("cxx/engine_bridge.cpp")
// In production: add circom generated witness calculator
// .file("circom_output/ALGORITHM_ENGINE.cpp")
.flag_if_supported("-std=c++17")
.flag_if_supported("-O3")
// Link against Rapidsnark and CUDA for GPU acceleration
.include("/usr/local/cuda/include")
.compile("algorithm_engine_ffi");
println!("cargo:rustc-link-search=native=/usr/local/cuda/lib64");
println!("cargo:rustc-link-lib=cudart");
println!("cargo:rustc-link-lib=gmp");
println!("cargo:rustc-link-lib=rapidsnark");
}
} |