4
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Makefile CUDA用(OpenCL)x

Last updated at Posted at 2014-06-14

OpenCL入門をUbuntu14.04(CUDA6.0)でMakeするためのMakefile
(cudaのインストールディレクトリが変わった)

all: nvidia

is_64=$(shell s=`uname -m`; if (echo $$s | grep x86_64 > /dev/null); then echo 1; fi)

CFLAGS=-Wall -W -O2

EXE=""


ifeq ($(is_64), 1)
PATH_TO_NVIDIA_SDK:=/usr/local/cuda
PATH_TO_NVIDIA_INC:=$(PATH_TO_NVIDIA_SDK)/include
PATH_TO_NVIDIA_LIB:=$(PATH_TO_NVIDIA_SDK)/lib64

else
PATH_TO_NVIDIA_SDK:=/usr/local/cuda
PATH_TO_NVIDIA_INC:=$(PATH_TO_NVIDIA_SDK)/include
PATH_TO_NVIDIA_LIB:=$(PATH_TO_NVIDIA_SDK)/lib64

endif


EXE_NAME=$(patsubst %.cpp,%,$(wildcard *.cpp))

nvidia: $(patsubst %,%.nvidia,$(EXE_NAME))$(EXE)

%.nvidia$(EXE):%.cpp
	g++ $(CFLAGS) -I$(PATH_TO_NVIDIA_INC) -L$(PATH_TO_NVIDIA_LIB) -o $@ $< -lOpenCL


clean:
	rm -f *.nvidia$(EXE) 



φ(..)メモメモ

4
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?