Add option to use clew to manually open the OpenCL dynamic library
fix Linux build of App_Bullet3_OpenCL_Demos. Unfortunately the simulation doesn't work properly, need to fix it (and add unit tests)
This commit is contained in:
@@ -24,7 +24,7 @@ function createProject(vendor)
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
createProject("clew")
|
||||
createProject("Apple")
|
||||
createProject("AMD")
|
||||
createProject("Intel")
|
||||
|
||||
@@ -30,6 +30,7 @@ function createProject(vendor)
|
||||
end
|
||||
end
|
||||
|
||||
createProject("clew")
|
||||
createProject("Apple")
|
||||
createProject("AMD")
|
||||
createProject("Intel")
|
||||
|
||||
@@ -35,7 +35,8 @@ function createProject(vendor)
|
||||
end
|
||||
end
|
||||
|
||||
createProject("clew")
|
||||
createProject("AMD")
|
||||
createProject("Intel")
|
||||
createProject("NVIDIA")
|
||||
createProject("Apple")
|
||||
createProject("Apple")
|
||||
|
||||
@@ -34,7 +34,8 @@ function createProject(vendor)
|
||||
end
|
||||
end
|
||||
|
||||
createProject("clew")
|
||||
createProject("AMD")
|
||||
createProject("Intel")
|
||||
createProject("NVIDIA")
|
||||
createProject("Apple")
|
||||
createProject("Apple")
|
||||
|
||||
41
test/clew/clewTest.cpp
Normal file
41
test/clew/clewTest.cpp
Normal file
@@ -0,0 +1,41 @@
|
||||
// clewTest.cpp : Defines the entry point for the console application.
|
||||
//
|
||||
|
||||
#include "clew.h"
|
||||
#include <stdio.h>
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
int result = -1;
|
||||
|
||||
#ifdef _WIN32
|
||||
const char* cl = "OpenCL.dll";
|
||||
#elif defined __APPLE__
|
||||
const char* cl = "/System/Library/Frameworks/OpenCL.framework/Versions/Current/OpenCL";
|
||||
#else//presumable Linux?
|
||||
//linux (tested on Ubuntu 12.10 with Catalyst 13.4 beta drivers, not that there is no symbolic link from libOpenCL.so
|
||||
const char* cl = "libOpenCL.so.1";
|
||||
result = clewInit(cl);
|
||||
if (result != CLEW_SUCCESS)
|
||||
{
|
||||
cl = "libOpenCL.so";
|
||||
} else
|
||||
{
|
||||
clewExit();
|
||||
}
|
||||
#endif
|
||||
result = clewInit(cl);
|
||||
if (result!=CLEW_SUCCESS)
|
||||
printf("clewInit failed with error code %d\n",result);
|
||||
else
|
||||
{
|
||||
printf("clewInit succesfull using %s\n",cl);
|
||||
|
||||
//some test and then
|
||||
clewExit();
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
27
test/clew/premake4.lua
Normal file
27
test/clew/premake4.lua
Normal file
@@ -0,0 +1,27 @@
|
||||
|
||||
|
||||
project ("Test_clew")
|
||||
|
||||
language "C++"
|
||||
|
||||
kind "ConsoleApp"
|
||||
targetdir "../../bin"
|
||||
includedirs {"../../src/clew"}
|
||||
|
||||
if os.is("Windows") then
|
||||
defines { "WIN32" }
|
||||
links {"Ws2_32","Winmm"}
|
||||
end
|
||||
if os.is("Linux") then
|
||||
links {"dl"}
|
||||
end
|
||||
if os.is("MacOSX") then
|
||||
end
|
||||
|
||||
|
||||
files {
|
||||
"clewTest.cpp",
|
||||
"../../src/clew/clew.c",
|
||||
"../../src/clew/clew.h"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user