Skip to content

Commit

Permalink
Cleaning up README and adding Steven Johnson to the license
Browse files Browse the repository at this point in the history
  • Loading branch information
pavanky committed Dec 23, 2015
1 parent b309d27 commit 70dc89c
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 32 deletions.
1 change: 1 addition & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Copyright (c) 2015, ArrayFire
Copyright (c) 2015, Steven Johnson aka ggcrunchy ([email protected])
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
Expand Down
64 changes: 32 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,67 +1,67 @@
(Pilfered from [Rust's README](https://github.com/arrayfire/arrayfire-rust), adapting...)

# Arrayfire Lua Bindings

[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 Lua bindings for the ArrayFire library. The wrapper is currently compliant with ArrayFire 3.2 API (and lower). If you find any bugs, please report them [here](https://github.com/arrayfire/arrayfire-lua/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 Lua bindings for the ArrayFire library. The wrapper is currently compliant with ArrayFire 3.2 API (and higher). If you find any bugs, please report them [here](https://github.com/arrayfire/arrayfire-lua/issues).

## Documentation

You can find the most recent updated documentation TODO.
TODO

## Supported platforms

Currently, only Windows. So far, compiles with [Lua 5.1](http://www.lua.org/ftp/lua-5.1.5.tar.gz).
Currently, tested only Windows with [Lua 5.1](http://www.lua.org/ftp/lua-5.1.5.tar.gz).

- Progress being made on Linux and OSX with Lua 5.2 and 5.3

## Installing the dependencies

## Build from Source
### Get ArrayFire libraries

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)

- Build Lua, e.g. from above source
- arrayfire depends on Lua (TODO: probably should add -lua suffix...)
- (Windows) client depends on both of these
- In these latter two, linkage required for appropriate ArrayFire library
**Post Installation Instructions**

- Please read [the wiki page](https://github.com/arrayfire/arrayfire-lua/wiki) for setting up the proper environment variables.

### Get Lua libraries and header files

TODO: [5.2](http://www.lua.org/ftp/lua-5.2.4.tar.gz), [5.3](http://www.lua.org/ftp/lua-5.3.2.tar.gz)... [LuaJIT source](http://luajit.org/download.html).
Alternatives such as [Ravi](https://github.com/dibyendumajumdar/ravi) and [Terra](https://github.com/zdevito/terra)?
If you do not have the pre-installed library, use the source in `arrayfire-lua/lua` folder for building the libraries.

Preprocessor stuff:
The following pre-processors need to be set when building lua.

For Lua: LUA_BUILD_AS_DLL; Windows-specific: _CRT_SECURE_NO_WARNINGS
For arrayfire: AFDLL
- LUA_BUILD_AS_DLL
- CRT_SECURE_NO_WARNINGS

Not implemented: WANT_CUDA, WANT_OPENCL to include interface bindings (are there already alternatives?)
## Building the arrayfire module

Setup:
### Windows

Configuring package.path, package.cpath (ArrayFireWrapper/ArrayFireWrapper.cpp doing this, for Windows anyhow)
LuaJIT FFI looking for some variables (TODO: explain)

## Example
Use the visual studio project file present in `src/Lua/arrayfire` to build the library.

### Linux / OSX

Use the `cmake` file in `src/Lua/arrayfire` to build the library.

### Sample output
- Ensure `ArrayFire_DIR` points to `/path/to/arrayfire/share/ArrayFire/cmake`

## Running the example

### Linux / OSX

$ export LUA_PATH="/path/to/arrayfire-lua/lib/?.lua;;"
$ export LUA_CPATH="/path/to/arrayfire-lua/src/Lua/arrayfire/build/?.so;;"
$ lua helloworld/helloworld.lua

## Issues

Currently segfaults on Linux. Untested on OSX.

## Note

This is a work in progress and is not intended for production use.

## Acknowledgements

The ArrayFire library is written by developers at [ArrayFire](http://arrayfire.com) LLC
with (TODO: contributions)?

The developers at ArrayFire LLC have received partial financial support
from several grants and institutions. Those that wish to receive public
acknowledgement are listed below:

### Grants

(Not sure if this was for Rust or ArrayFire... if the latter, add back in)
This project began with significant contributions from [Steven Johnson](https://github.com/ggcrunchy). It is currently being maintained by `@arrayfire/lua-devel` team.

0 comments on commit 70dc89c

Please sign in to comment.