Skip to content

Commit

Permalink
OpenMP flag not supported for Xcode 5
Browse files Browse the repository at this point in the history
This is a fix for bug report HandsOnOpenCL#43, which involves removing the -fopenmp
flag when compiling on Mac OS X (not needed anyway).
  • Loading branch information
simonmcs committed Oct 24, 2013
1 parent d2cc5fd commit 5426e0e
Show file tree
Hide file tree
Showing 15 changed files with 28 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Exercises/Exercise02/C/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ endif
# and set up the right compiler flags and libraries
PLATFORM = $(shell uname -s)
ifeq ($(PLATFORM), Darwin)
LIBS = -framework OpenCL -fopenmp
LIBS = -framework OpenCL
endif

CCFLAGS += -D DEVICE=$(DEVICE)
Expand Down
2 changes: 1 addition & 1 deletion Exercises/Exercise04/C/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ endif
# and set up the right compiler flags and libraries
PLATFORM = $(shell uname -s)
ifeq ($(PLATFORM), Darwin)
LIBS = -framework OpenCL -fopenmp
LIBS = -framework OpenCL
endif

CCFLAGS += -D DEVICE=$(DEVICE)
Expand Down
2 changes: 1 addition & 1 deletion Exercises/Exercise05/C/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ endif
# and set up the right compiler flags and libraries
PLATFORM = $(shell uname -s)
ifeq ($(PLATFORM), Darwin)
LIBS = -framework OpenCL -fopenmp
LIBS = -framework OpenCL
endif

CCFLAGS += -D DEVICE=$(DEVICE)
Expand Down
2 changes: 1 addition & 1 deletion Exercises/Exercise06/C/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ CCFLAGS += -D DEVICE=$(DEVICE)
# and set up the right compiler flags and libraries
PLATFORM = $(shell uname -s)
ifeq ($(PLATFORM), Darwin)
LIBS = -lm -framework OpenCL -fopenmp
LIBS = -lm -framework OpenCL
endif

all: $(EXEC)
Expand Down
7 changes: 7 additions & 0 deletions Exercises/Exercise09/C/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ LIBS = -fopenmp

COMMON_DIR = ../../C_common

# Check our platform and make sure we define the APPLE variable
# and set up the right compiler flags and libraries
PLATFORM = $(shell uname -s)
ifeq ($(PLATFORM), Darwin)
LIBS =
endif

pi: pi.c $(COMMON_DIR)/wtime.c
$(CC) $^ $(CCFLAGS) -o $@

Expand Down
7 changes: 7 additions & 0 deletions Exercises/Exercise13/C/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ CCFLAGS = -O3 -std=c99

LIBS = -fopenmp

# Check our platform and make sure we define the APPLE variable
# and set up the right compiler flags and libraries
PLATFORM = $(shell uname -s)
ifeq ($(PLATFORM), Darwin)
LIBS =
endif

gameoflife: gameoflife.c
$(CC) $^ $(CCFLAGS) $(LIBS) -o $@

Expand Down
2 changes: 1 addition & 1 deletion Solutions/Exercise04/C/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ endif
# and set up the right compiler flags and libraries
PLATFORM = $(shell uname -s)
ifeq ($(PLATFORM), Darwin)
LIBS = -framework OpenCL -fopenmp
LIBS = -framework OpenCL
endif

CCFLAGS += -D DEVICE=$(DEVICE)
Expand Down
2 changes: 1 addition & 1 deletion Solutions/Exercise05/C/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ endif
# and set up the right compiler flags and libraries
PLATFORM = $(shell uname -s)
ifeq ($(PLATFORM), Darwin)
LIBS = -framework OpenCL -fopenmp
LIBS = -framework OpenCL
endif

CCFLAGS += -D DEVICE=$(DEVICE)
Expand Down
2 changes: 1 addition & 1 deletion Solutions/Exercise06/C/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ endif
# and set up the right compiler flags and libraries
PLATFORM = $(shell uname -s)
ifeq ($(PLATFORM), Darwin)
LIBS = -lm -framework OpenCL -fopenmp
LIBS = -lm -framework OpenCL
endif

CCFLAGS += -D DEVICE=$(DEVICE)
Expand Down
2 changes: 1 addition & 1 deletion Solutions/Exercise06/Cpp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ endif

CCFLAGS=-O3 -std=c++11 -ffast-math

LIBS = -lm -lOpenCL -fopenmp
LIBS = -lm -lOpenCL -fopenmp

COMMON_DIR = ../../Cpp_common

Expand Down
4 changes: 2 additions & 2 deletions Solutions/Exercise07/C/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ifndef CC
CC = gcc
endif

CCFLAGS=-O3 -std=c99 -ffast-math
CCFLAGS=-O0 -std=c99 -g

LIBS = -lm -lOpenCL -fopenmp

Expand All @@ -30,7 +30,7 @@ endif
# and set up the right compiler flags and libraries
PLATFORM = $(shell uname -s)
ifeq ($(PLATFORM), Darwin)
LIBS = -lm -framework OpenCL -fopenmp
LIBS = -lm -framework OpenCL
endif

CCFLAGS += -D DEVICE=$(DEVICE)
Expand Down
2 changes: 1 addition & 1 deletion Solutions/Exercise07/Cpp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ifndef CPPC
CPPC=g++
endif

CCFLAGS=-O3 -std=c++11 -ffast-math
CCFLAGS = -std=c++11 -ffast-math -g -O0

LIBS = -lm -lOpenCL -fopenmp

Expand Down
2 changes: 1 addition & 1 deletion Solutions/Exercise08/C/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ endif
# and set up the right compiler flags and libraries
PLATFORM = $(shell uname -s)
ifeq ($(PLATFORM), Darwin)
LIBS = -lm -framework OpenCL -fopenmp
LIBS = -lm -framework OpenCL
endif

CCFLAGS += -D DEVICE=$(DEVICE)
Expand Down
2 changes: 1 addition & 1 deletion Solutions/Exercise09/C/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ endif
# and set up the right compiler flags and libraries
PLATFORM = $(shell uname -s)
ifeq ($(PLATFORM), Darwin)
LIBS = -framework OpenCL -fopenmp -lm
LIBS = -framework OpenCL -lm
endif

CCFLAGS += -D DEVICE=$(DEVICE)
Expand Down
2 changes: 1 addition & 1 deletion Solutions/ExerciseA/C/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ endif
# and set up the right compiler flags and libraries
PLATFORM = $(shell uname -s)
ifeq ($(PLATFORM), Darwin)
LIBS = -framework OpenCL -fopenmp -lm
LIBS = -framework OpenCL -lm
endif

CCFLAGS += -D DEVICE=$(DEVICE)
Expand Down

0 comments on commit 5426e0e

Please sign in to comment.