-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First attempt at building the arrayfire package on linux
- Loading branch information
Showing
10 changed files
with
112 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
cmake_minimum_required(VERSION 2.8) | ||
SET(AF_LUA_VERSION_MAJOR 0) | ||
SET(AF_LUA_VERSION 0) | ||
|
||
SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS ON) | ||
FIND_PACKAGE(ArrayFire REQUIRED) | ||
FIND_PACKAGE(Lua REQUIRED) | ||
|
||
FILE(GLOB src | ||
"*.hpp" | ||
"*.h" | ||
"*.cpp" | ||
) | ||
|
||
FILE(GLOB funcs_src | ||
"funcs/*.cpp" | ||
) | ||
|
||
SOURCE_GROUP(funcs FILES ${funcs_src}) | ||
|
||
FILE(GLOB graphics_src | ||
"graphics/*.cpp" | ||
) | ||
|
||
SOURCE_GROUP(graphics FILES ${graphics_src}) | ||
|
||
FILE(GLOB methods_src | ||
"methods/*.cpp" | ||
) | ||
|
||
SOURCE_GROUP(methods FILES ${methods_src}) | ||
|
||
FILE(GLOB template_src | ||
"template/*.cpp") | ||
|
||
SOURCE_GROUP(template FILES ${template_src}) | ||
|
||
# OS Definitions | ||
IF(UNIX) | ||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -pthread -Wno-comment") | ||
ADD_DEFINITIONS(-Wall -std=c++11 -fvisibility=hidden) | ||
ELSE(${UNIX}) #Windows | ||
ADD_DEFINITIONS(-DAFDLL) | ||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") | ||
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /bigobj") | ||
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /bigobj") | ||
ENDIF() | ||
|
||
INCLUDE_DIRECTORIES(${ArrayFire_INCLUDE_DIRS}) | ||
INCLUDE_DIRECTORIES(${LUA_INCLUDE_DIR}) | ||
|
||
ADD_LIBRARY(arrayfire SHARED | ||
${src} | ||
${funcs_src} | ||
${graphics_src} | ||
${methods_src}) | ||
|
||
TARGET_LINK_LIBRARIES(arrayfire | ||
${ArrayFire_Unified_LIBRARIES} | ||
${LUA_LIBRARIES} | ||
) | ||
|
||
SET_TARGET_PROPERTIES(arrayfire PROPERTIES | ||
PREFIX "") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#if defined(_WIN32) || defined(_MSC_VER) | ||
#define __EXPORT__ extern "C" __declspec(dllimport) | ||
#else | ||
#define __EXPORT__ extern "C" __attribute__((visibility("default"))) | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
extern "C" { | ||
#include <lua.h> | ||
#include <lauxlib.h> | ||
} | ||
|
||
#if LUA_VERSION_NUM > 501 | ||
|
||
#define lua_objlen(L,i) lua_rawlen(L, (i)) | ||
|
||
#define luaL_register(L, n, l) do { \ | ||
lua_getglobal(L, n); \ | ||
if (lua_isnil(L, -1)) { \ | ||
lua_pop(L, 1); \ | ||
lua_newtable(L); \ | ||
} \ | ||
luaL_setfuncs(L, l, 0); \ | ||
lua_setglobal(L, n); \ | ||
}while(0) | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters