Skip to content

Commit

Permalink
Updates from ArrayFire's 3.6 Release
Browse files Browse the repository at this point in the history
* Bump up crate version to 3.6.0
* Update crate dependencies
* Update build.rs to reflect 3.6 release
* Update the submodule arrayfire to 3.6 branch
* Update crate with new fns from 3.6 release
* Improve build config format
* Add get_last_error utility helper
* Update README for 3.6 and fix style
  • Loading branch information
9prady9 committed Jun 14, 2018
1 parent 2bca4dc commit efc2699
Show file tree
Hide file tree
Showing 12 changed files with 438 additions and 300 deletions.
16 changes: 8 additions & 8 deletions Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "arrayfire"
description = "ArrayFire is a high performance software library for parallel computing with an easy-to-use API. Its array based function set makes parallel programming simple. ArrayFire's multiple backends (CUDA, OpenCL and native CPU) make it platform independent and highly portable. A few lines of code in ArrayFire can replace dozens of lines of parallel computing code, saving you valuable time and lowering development costs. This crate provides Rust bindings for ArrayFire library."
version = "3.5.0"
version = "3.6.0"
documentation = "http://arrayfire.github.io/arrayfire-rust/arrayfire/index.html"
homepage = "https://github.com/arrayfire/arrayfire"
repository = "https://github.com/arrayfire/arrayfire-rust"
Expand Down Expand Up @@ -33,15 +33,15 @@ default = ["algorithm", "arithmetic", "blas", "data", "indexing", "graphics", "i
"macros", "random", "signal", "sparse", "statistics", "vision"]

[dependencies]
libc = "0.2.11"
num = "0.1.32"
lazy_static = "0.2.1"
libc = "0.2"
num = "0.1"
lazy_static = "1.0"

[build-dependencies]
serde_json = "1.0.0"
serde_derive = "1.0.1"
serde = "1.0.1"
rustc_version = "0.1.7"
serde_json = "1.0"
serde_derive = "1.0"
serde = "1.0"
rustc_version = "0.2"

[lib]
name = "arrayfire"
Expand Down
68 changes: 42 additions & 26 deletions README.md
@@ -1,20 +1,25 @@
# Arrayfire Rust Bindings
| Linux | Windows | OSX |
|:-------:|:-------:|:---:|
| [![Build Status](http://ci.arrayfire.org/buildStatus/icon?job=arrayfire-wrappers/rust-linux)](http://ci.arrayfire.org/view/All/job/arrayfire-wrappers/job/rust-linux/) | [![Build Status](http://ci.arrayfire.org/buildStatus/icon?job=arrayfire-wrappers/rust-windows)](http://ci.arrayfire.org/view/All/job/arrayfire-wrappers/job/rust-windows/) | [![Build Status](http://ci.arrayfire.org/buildStatus/icon?job=arrayfire-wrappers/rust-osx)](http://ci.arrayfire.org/view/All/job/arrayfire-wrappers/job/rust-osx/) |

[ArrayFire](https://github.com/arrayfire/arrayfire) is a high performance library for parallel computing with an easy-to-use API. It enables users to write scientific computing code that is portable across CUDA, OpenCL and CPU devices. This project provides Rust bindings for the ArrayFire library. Given below table shows the rust bindings compatability with ArrayFire. If you find any bugs, please report them [here](https://github.com/arrayfire/arrayfire-rust/issues).
[ArrayFire](https://github.com/arrayfire/arrayfire) is a high performance
library for parallel computing with an easy-to-use API. It enables users
to write scientific computing code that is portable across CUDA, OpenCL
and CPU devices. This project provides Rust bindings for the ArrayFire
library. Given below table shows the rust bindings compatability with
ArrayFire. If you find any bugs, please report them
[here](https://github.com/arrayfire/arrayfire-rust/issues).

| ArrayFire Upstream | Rust Crate |
|:------------------:|:---------------:|
| 3.3.x | 3.3.x |
| 3.4.x | 3.4.x |
| arrayfire-rust | ArrayFire |
|:--------------:|:---------:|
| M.m.p1 | M.m.p2 |

Only, Major & Minor version numbers need to match.
Only, Major(M) & Minor(m) version numbers need to match. *p1* and *p2*
are patch/fix updates for `arrayfire-rust` & `ArrayFire` respectively,
and they don't need to match.

## Documentation

You can find the most recent updated documentation [here](http://arrayfire.github.io/arrayfire-rust/arrayfire/index.html).
You can find the most recent updated documentation
[here](http://arrayfire.github.io/arrayfire-rust/arrayfire/index.html).

## Communication

Expand All @@ -27,37 +32,47 @@ Linux, Windows and OSX. Rust 1.15.1 or higher is required.

## Use from Crates.io [![](http://meritbadge.herokuapp.com/arrayfire)](https://crates.io/crates/arrayfire)

To use the rust bindings for ArrayFire from crates.io, the following requirements are to be met
first.
To use the rust bindings for ArrayFire from crates.io, the following
requirements are to be met first.

1. [Download and install ArrayFire binaries](https://arrayfire.com/download) based on your operating
system.
2. Set the evironment variable `AF_PATH` to point to ArrayFire installation root folder.
3. Make sure you add the path to library files to your path environment variables.
1. [Download and install ArrayFire binaries](https://arrayfire.com/download)
based on your operating system.
2. Set the evironment variable `AF_PATH` to point to ArrayFire installation
root folder.
3. Make sure to add the path to lib files to your path environment variables.
- On Linux & OSX: do `export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$AF_PATH/lib`
- On Windows: Add `%AF_PATH%\lib` to your PATH environment variable.
4. Add `arrayfire = "3.5.0"` to the dependencies section of your project's Cargo.toml file - 3.5.0
is the latest version of crate.
4. Add `arrayfire = "3.6"` to the dependencies section of your project's
Cargo.toml file. Make sure to change the version to latest available.

Once step (4) is over, you should be able to use ArrayFire in your Rust project. If you find any bugs, please report them [here](https://github.com/arrayfire/arrayfire-rust/issues).
Once step (4) is over, you should be able to use ArrayFire in your Rust
project. If you find any bugs, please report them
[here](https://github.com/arrayfire/arrayfire-rust/issues).

## Build from Source

Edit [build.conf](build.conf) to modify the build flags. The structure is a simple JSON blob. Currently Rust does not allow key:value pairs to be passed from the CLI. To use an existing ArrayFire installation modify the first three JSON values. You can install ArrayFire using one of the following two ways.
Edit [build.conf](build.conf) to modify the build flags. The structure is a
simple JSON blob. Currently Rust does not allow key:value pairs to be passed
from the CLI. To use an existing ArrayFire installation modify the first three
JSON values. You can install ArrayFire using one of the following two ways.

- [Download and install binaries](https://arrayfire.com/download)
- [Build and install from source](https://github.com/arrayfire/arrayfire)

To build arrayfire submodule available in the rust wrapper, you have to do the following.
To build arrayfire submodule available in the rust wrapper, you have to do
the following.

```bash
git submodule update --init --recursive
cargo build
```
This is recommended way to build Rust wrapper since the submodule points to the most compatible version of ArrayFire the Rust wrapper has been tested with. You can find the ArrayFire dependencies below.
This is recommended way to build Rust wrapper since the submodule points to
the most compatible version of ArrayFire the Rust wrapper has been tested with.
You can find the ArrayFire dependencies below.

- [Linux dependencies](http://www.arrayfire.com/docs/using_on_linux.htm)
- [OSX dependencies](http://www.arrayfire.com/docs/using_on_osx.htm)
- [Linux](https://github.com/arrayfire/arrayfire/wiki/Build-Instructions-for-Linux)
- [OSX](https://github.com/arrayfire/arrayfire/wiki/Build-Instructions-for-OSX)
- [Windows](https://github.com/arrayfire/arrayfire/wiki/Build-Instructions-for-Windows)

## Example

Expand Down Expand Up @@ -86,8 +101,9 @@ Create a 5-by-3 matrix of random floats on the GPU

## Acknowledgements

The ArrayFire library is written by developers at [ArrayFire](http://arrayfire.com) LLC
with [contributions from several individuals](https://github.com/arrayfire/arrayfire_rust/graphs/contributors).
The ArrayFire library is written by developers at
[ArrayFire](http://arrayfire.com) LLC with
[contributions from several individuals](https://github.com/arrayfire/arrayfire_rust/graphs/contributors).

The developers at ArrayFire LLC have received partial financial support
from several grants and institutions. Those that wish to receive public
Expand Down
2 changes: 1 addition & 1 deletion arrayfire
Submodule arrayfire updated 779 files
41 changes: 21 additions & 20 deletions build.conf
@@ -1,27 +1,28 @@
{
"use_lib": true,

"build_type": "Release",
"build_threads": "4",
"build_examples": "OFF",
"build_test": "OFF",
"build_graphics": "ON",
"build_type" : "Release",
"build_threads" : 3,
"build_cpu" : "ON",
"build_cuda" : "ON",
"build_opencl" : "ON",
"build_nonfree" : "ON",
"build_examples" : "OFF",
"build_test" : "OFF",

"glew_static": "OFF",
"freeimage_type": "DYNAMIC",
"cpu_fft_type": "FFTW",
"cpu_blas_type": "LAPACKE",
"cpu_lapack_type": "LAPACKE",
"with_intelmkl" : "OFF",
"with_imageio" : "ON",
"with_graphics" : "ON",
"with_opencl_blas_lib" : "clblast",

"freeimage_dir": "E:\\Libraries\\FreeImage\\Dist",
"fftw_dir": "E:\\Libraries\\fftw-3.3.4",
"acml_dir": "",
"mkl_dir": "",
"lapacke_dir": "E:\\Libraries\\lapack",
"glew_dir": "E:\\Libraries\\GLEW",
"glfw_dir": "E:\\Libraries\\glfw3",
"boost_dir": "E:\\Libraries\\boost_1_56_0",
"vcpkg_toolchain_file" : "C:/vcpkg/scripts/buildsystems/vcpkg.cmake",

"cuda_sdk": "/usr/local/cuda",
"opencl_sdk": "/usr"
"lnx_cuda_sdk": "/opt/cuda",
"lnx_opencl_sdk": "/usr",
"lnx_cuda_host_compiler": "/usr/bin/gcc-6",

"win_cuda_sdk": "C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v9.2",
"win_opencl_sdk": "C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v9.2",
"win_cmake_generator": "Visual Studio 15 2017 Win64",
"win_vs_toolset": "v140"
}

0 comments on commit efc2699

Please sign in to comment.