ipp_sys/
lib.rs

1/*! # What is this crate?
2
3This crate provides wrappers of the Intel Integrated Performance Primitives
4(Intel IPP) library made with rust-bindgen.
5
6# Version support
7
8Use the `2017`, `2018`, or `2019` cargo feature to use IPP 2017, 2018, or
92019 respectively.
10
11# Download IPP
12
13Get IPP from https://software.intel.com/en-us/intel-ipp
14
15# Usage
16
17Compile IPP statically into your app by setting environment variable
18`IPP_STATIC=1`.
19
20You must set the `IPPROOT` environment variable at compilation time. This is
21used by the `build.rs` files to find your IPP installation. Typically, this is
22set using a tool provided by Intel with IPP and run as follows.
23
24On Linux:
25
26```text
27source /opt/intel/compilers_and_libraries_2019/linux/ipp/bin/ippvars.sh -arch intel64 -platform linux
28```
29
30On Mac:
31
32```text
33source /opt/intel/compilers_and_libraries_2019/mac/bin/compilervars.sh -arch intel64 -platform mac
34```
35
36On Windows:
37
38```text
39"C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019\windows\ipp\bin\ippvars.bat" intel64
40```
41
42In `Cargo.toml`, include `ipp-sys` as a dependency with a feature to select
43the IPP version used:
44
45```text
46[dependencies]
47ipp-sys = { version = "0.4", features=["2019"] }
48```
49
50Now, you can use `ipp_sys` in your crate. You might like to check that you
51compiled the correct version by doing something like:
52
53```
54// Get the version from IPP at runtime.
55let linked_version_major = unsafe{ (*ipp_sys::ippGetLibVersion()).major };
56let linked_version_minor = unsafe{ (*ipp_sys::ippGetLibVersion()).minor };
57
58// Compare the runtime major version with the compile-time major version.
59assert_eq!( linked_version_major as i32, ipp_sys::IPP_VERSION_MAJOR as i32);
60// And compare the minor version, too.
61assert_eq!( linked_version_minor as i32, ipp_sys::IPP_VERSION_MINOR as i32);
62
63```
64
65# API documentation
66
67See the [ipp-headers-sys page on docs.rs](http://docs.rs/ipp-headers-sys).
68
69*/
70
71// The link* creates are used to link the library.
72#![allow(unused_extern_crates)]
73
74#[cfg(feature = "do-linking")]
75extern crate link_ippcore;
76#[cfg(feature = "do-linking")]
77extern crate link_ippcv;
78#[cfg(feature = "do-linking")]
79extern crate link_ippi;
80#[cfg(feature = "do-linking")]
81extern crate link_ipps;
82#[cfg(feature = "do-linking")]
83extern crate link_ippvm;
84
85pub use ipp_headers_sys::*;