Skip to content

Commit 7d28a45

Browse files
committed
Updating README to reflect the use of cmake files
1 parent 369c7ab commit 7d28a45

File tree

1 file changed

+26
-23
lines changed

1 file changed

+26
-23
lines changed

README.md

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,12 @@ max of x
4545

4646
TODO
4747

48-
## Supported platforms
48+
## Getting Started
4949

50-
Currently, tested only Windows with [Lua 5.1](http://www.lua.org/ftp/lua-5.1.5.tar.gz).
50+
### Requirements
5151

52-
- Progress being made on Linux and OSX with Lua 5.2 and 5.3
53-
54-
## Installing the dependencies
52+
- `cmake`
53+
- `Visual Studio` on Windows, `clang` / `gcc` on Linux / OSX.
5554

5655
### Get ArrayFire libraries
5756

@@ -64,33 +63,37 @@ You can install ArrayFire using one of the following two ways.
6463

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

67-
### Get Lua libraries and header files
68-
69-
If you do not have the pre-installed library, use the source in `arrayfire-lua/lua` folder for building the libraries.
70-
71-
The following pre-processors need to be set when building lua.
72-
73-
- LUA_BUILD_AS_DLL
74-
- CRT_SECURE_NO_WARNINGS
66+
### Building the Lua module
7567

76-
## Building the arrayfire module
68+
**Windows**
7769

78-
### Windows
70+
1. Launch `cmake-gui`. Set source and build directories.
71+
2. Press configure.
72+
3. Select `generator` as `Visual Studio 12 2013 Win64`.
73+
- You can choose a different generator as long as it is Win64.
74+
4. Set `CMAKE_INSTALL_PREFIX` to a location of choice.
75+
5. Press generate. The generated visual studio solution file will be present in the build directory.
76+
6. Open the VS solution file and build the `INSTALL` project.
7977

80-
Use the visual studio project file present in `src/Lua/arrayfire` to build the library.
78+
**Linux / OSX**
8179

82-
### Linux / OSX
80+
1. Make sure the environment variable `ArrayFire_DIR` is set to `/path/to/arrayfire/share/ArrayFire/cmake`.
81+
2. Create a build directory and `cd` into it.
82+
3. Run `cmake /path/to/arrayfire-lua/ -DCMAKE_INSTALL_PREFIX=package`.
83+
4. Run `make`
8384

84-
Use the `cmake` file in `src/Lua/arrayfire` to build the library.
85+
### Setting up the
8586

86-
- Ensure `ArrayFire_DIR` points to `/path/to/arrayfire/share/ArrayFire/cmake`
87+
**Windows**
8788

88-
## Setting up the environment
89+
> SET LUA_PATH=C:\path\to\install\location\arrayfire\?.lua;;
90+
> SET LUA_CPATH=C:\path\to\install\location\?.dll;;
91+
> lua.exe helloworld/helloworld.lua
8992

90-
### Linux / OSX
93+
**Linux**
9194

92-
$ export LUA_PATH="/path/to/arrayfire-lua/lib/?.lua;;"
93-
$ export LUA_CPATH="/path/to/arrayfire-lua/src/Lua/arrayfire/build/?.so;;"
95+
$ export LUA_PATH="/path/to/install/location/arrayfire/?.lua;;"
96+
$ export LUA_CPATH="/path/to/install/location/?.so;;"
9497
$ lua helloworld/helloworld.lua
9598

9699
## Issues

0 commit comments

Comments
 (0)