snapkitty
agents
python
automated-operator / build.rs
SNAPKITTYWEST's picture
push from SNAPKITTYWEST/automated-operator
0a93d9c verified
Raw History Blame Contribute Delete
1.51 kB
// 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");
}
}