Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
ispc-rs
A small library meant to be used as a build dependency with Cargo for easily integrating ISPC code into Rust projects.
Documentation
Rust doc can be found here
Using ispc-rs
You'll want to add a build script to your crate (build.rs
), tell Cargo about it and add this crate
as a build dependency.
# Cargo.toml
[]
# ...
= "build.rs"
[]
= "0.1.0"
Now you can use ispc
to compile your code into a static library:
extern crate ispc;
Running cargo build
should now build your ISPC files into a library and link your Rust
application with it. For extra convenience the ispc_module
macro is provided to import
bindings to the library generated with rust-bindgen
into a module of the same name. Note that all the functions imported will be unsafe as they're
the raw C bindings to your lib.
extern crate ispc;
// Functions exported from simple will be callable under simple::*
ispc_module!;
// Alternatively if the module should be public:
//ispc_module!(pub simple);
Some more complete examples can be found in the examples/ folder.
Compile-time Requirements
Both the ISPC compiler and libclang (for rust-bindgen) must be available in your path.
Windows Users
You'll need Visual Studio and will have to use the MSVC ABI version of Rust since ISPC
and Clang link with MSVC on Windows. For bindgen to find libclang you'll need to copy
libclang.lib
to clang.lib
and place it in your path.
I've also had issues with multiple definition link errors coming up when compiling multiple ISPC files into a library on MSVC, I haven't figured out the cause yet. On Linux the repeated symbols are defined in each object as well but the linker doesn't seem to mind.