From 1b6cdab444677e4e1a12b194c8dc061aacbc2cb9 Mon Sep 17 00:00:00 2001 From: efposadac Date: Thu, 20 Mar 2014 09:13:25 +0100 Subject: [PATCH 1/3] Change some variables to make the program compilable on mac system. --- include/OpenCL_utils.h | 2 +- makefile | 6 +++--- src/OpenCL_utils.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/OpenCL_utils.h b/include/OpenCL_utils.h index dda5188..00e0bab 100644 --- a/include/OpenCL_utils.h +++ b/include/OpenCL_utils.h @@ -3,7 +3,7 @@ #include #include -#include "CL/cl.h" +#include "OpenCL/opencl.h" #include #include #include diff --git a/makefile b/makefile index a017f2f..442951b 100644 --- a/makefile +++ b/makefile @@ -27,9 +27,9 @@ OBJECTS =$(patsubst %,$(OBJ_DIR)/%,$(CODE_FILES:.c=.o)) INCLUDES=$(patsubst %,$(INC_DIR)/%,$(HEADER_FILES)) #Compilation Flags -OPENCL_PATH=/opt/intel/opencl-1.2-3.0.56860 -OPENCL_LIBS=-L$(OPENCL_PATH)/lib64 -lOpenCL -INCLUDE_PATH= -I$(INC_DIR) -I/usr/include/x86_64-linux-gnu/ -I$(OPENCL_PATH)/include -D__PROFILING +#OPENCL_PATH=/opt/intel/opencl-1.2-3.0.56860 +OPENCL_LIBS=-framework opencl +INCLUDE_PATH= -I $(INC_DIR) -D__PROFILING -D__DEBUG -D_USE_FLOAT OPENMP=-openmp OPT= -O3 $(OPENMP) -Wall -D__DEBUG -D_USE_FLOAT diff --git a/src/OpenCL_utils.c b/src/OpenCL_utils.c index ae266a4..c2bc4d4 100644 --- a/src/OpenCL_utils.c +++ b/src/OpenCL_utils.c @@ -255,7 +255,7 @@ cl_int InitOpenCLEnvironment( char * device_type, cl_device_id ** devices, cl_co free(platforms_list); #ifdef __DEBUG - PrintPlatform( (* platform) ); + PrintPlatform( (platform) ); #endif /* Initialize the Devices */ @@ -265,7 +265,7 @@ cl_int InitOpenCLEnvironment( char * device_type, cl_device_id ** devices, cl_co } #ifdef __DEBUG - fprintf( stdout, "platform[%p]: Found a device.\n", (* platform) ); + fprintf( stdout, "platform[%p]: Found a device.\n", (platform) ); #endif //allocate memory for devices, contexts and command queues From 72e5017e6b10ba7221d0ee2e70456fdda61a9dca Mon Sep 17 00:00:00 2001 From: efposadac Date: Thu, 20 Mar 2014 09:24:25 +0100 Subject: [PATCH 2/3] Change makefile to use icc compiler instead gcc. --- makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makefile b/makefile index 2fdd434..a096b18 100644 --- a/makefile +++ b/makefile @@ -14,7 +14,7 @@ OS_ARCH = $(shell uname -m | sed -e "s/i386/i686/") # Flags to detect either a Linux system (linux) or Mac OSX (darwin) DARWIN = $(strip $(findstring DARWIN, $(OSUPPER))) -CC=gcc +CC=icc LIB=-lm ifeq ($(CC),icc) From 3c611184e01180d9cd136ef56c2952124ccf4338 Mon Sep 17 00:00:00 2001 From: efposadac Date: Thu, 20 Mar 2014 09:47:55 +0100 Subject: [PATCH 3/3] Back to the gcc compiler --- makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/makefile b/makefile index a096b18..be4c9b2 100644 --- a/makefile +++ b/makefile @@ -14,7 +14,7 @@ OS_ARCH = $(shell uname -m | sed -e "s/i386/i686/") # Flags to detect either a Linux system (linux) or Mac OSX (darwin) DARWIN = $(strip $(findstring DARWIN, $(OSUPPER))) -CC=icc +CC=gcc LIB=-lm ifeq ($(CC),icc) @@ -48,7 +48,7 @@ OPENCL_PATH=/opt/AMDAPP/SDK # OS-specific build flags ifneq ($(DARWIN),) OPENCL_LIBS= -framework OpenCL - INCLUDE_PATH= -I$(INC_DIR) -I/Developer/NVIDIA/CUDA-5.5/include -D__PROFILING + INCLUDE_PATH= -I$(INC_DIR) -I/Developer/NVIDIA/CUDA-5.5/include -D__PROFILING -D_USE_FLOAT else ifeq ($(OS_SIZE),32) CCFLAGS := -m32