How should a very simple Makefile look like for Cuda compiling under linux

前端 未结 4 1931
天命终不由人
天命终不由人 2021-02-04 12:38

I want to compile a very basic hello world level Cuda program under Linux. I have three files:

  • the kernel: helloWorld.cu
  • main method: helloWorld.cpp
4条回答
  •  感情败类
    2021-02-04 13:14

    Here is an example what my current project looks like. As you can see there is a few OpenGL libraries

    ce : cudaExample.c cudaExample.h
        cp cudaExample.c cudaExample.cu
        /usr/local/cuda/bin/nvcc -arch=sm_20 -o ce -lglut -lGL -lGLU -lXext -lXmu -lX11 -lm  cudaExample.cu
    

    then run make ce and ./ce

提交回复
热议问题