diff --git a/GenerationDevice.h b/GenerationDevice.h index d1b9a61..e6369b1 100644 --- a/GenerationDevice.h +++ b/GenerationDevice.h @@ -13,7 +13,12 @@ #include #include #include + +#if defined(__APPLE__) || defined(__MACOSX) +#include +#else #include +#endif #include "constants.h" #include "DeviceConfig.h" diff --git a/Makefile b/Makefile index 239269e..c82a4b1 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,11 @@ OPENCL_LIB = ../_opencl/lib/win/x86 CC = g++ CC_FLAGS = -W -Wall -std=c++11 -O3 -I$(OPENCL_INCLUDE) -m$(PLATFORM) LD = g++ +ifeq ($(shell uname),Darwin) +LD_FLAGS = -fPIC -L$(OPENCL_LIB) -framework OpenCL -m$(PLATFORM) +else LD_FLAGS = -fPIC -L$(OPENCL_LIB) -lOpenCL -m$(PLATFORM) +endif ECHO = echo MKDIR = mkdir diff --git a/OpenclDevice.h b/OpenclDevice.h index 5554ce8..cbeb1e5 100644 --- a/OpenclDevice.h +++ b/OpenclDevice.h @@ -14,7 +14,12 @@ #include #include #include + +#if defined(__APPLE__) || defined(__MACOSX) +#include +#else #include +#endif #include "OpenclPlatform.h" diff --git a/OpenclError.h b/OpenclError.h index f04c181..7934988 100644 --- a/OpenclError.h +++ b/OpenclError.h @@ -12,7 +12,12 @@ #include #include + +#if defined(__APPLE__) || defined(__MACOSX) +#include +#else #include +#endif namespace cryo { namespace gpuPlotGenerator { diff --git a/OpenclPlatform.h b/OpenclPlatform.h index c281a6e..f27a170 100644 --- a/OpenclPlatform.h +++ b/OpenclPlatform.h @@ -14,7 +14,12 @@ #include #include #include + +#if defined(__APPLE__) || defined(__MACOSX) +#include +#else #include +#endif namespace cryo { namespace gpuPlotGenerator { diff --git a/README.md b/README.md index 1a6d834..b03af2c 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,22 @@ Run the following commands : The [dist] folder contains all the necessary files to launch the GPU plotter. +### OS X + +Modify the [PLATFORM] variable to [64]. +Modify the [OPENCL_INCLUDE] and [OPENCL_LIB] variables of the Makefile to the correct path. +Example: + +OPENCL_INCLUDE = /System/Library/Frameworks/OpenCL.framework/Versions/A/lib/clang/3.2/include +OPENCL_LIB = /System/Library/Frameworks/OpenCL.framework + +Run the following commands : + +cd +make dist + +The [dist] folder contains all the necessary files to launch the GPU plotter. + ## Setup The GPU plot generator needs a configured [devices.txt] file in order to work properly. The devices listed diff --git a/constants.h b/constants.h index b0b8d2f..32377ee 100644 --- a/constants.h +++ b/constants.h @@ -1,6 +1,8 @@ #ifndef CRYO_GPU_PLOT_GENERATOR_CONSTANTS_H #define CRYO_GPU_PLOT_GENERATOR_CONSTANTS_H +#include + namespace cryo { namespace gpuPlotGenerator {