[問題] makefile 與CUDA的問題

看板C_and_CPP作者 (墨穩定為)時間8年前 (2017/08/15 15:26), 編輯推噓1(104)
留言5則, 3人參與, 最新討論串1/1
我打算在TK1的板子上執行CUDA和NEON的聯合程式 以下是我的makefile main_file = Source.c execute_file = SoC_lab processor = cortex-a15 floating = neon-vfpv4 ABI = hard neno_envir = -mcpu=$(processor) -mfpu=$(floating) -mfloat-abi=$(ABI) CC = arm-linux-gnueabihf-gcc AR = arm-linux-gnueabihf-ar NVCC=nvcc LIBDIRS+= -L /usr/local/cuda-6.5/lib -lcuda -lcudart -lcublas -lcurand -lpthread INCDIRS+= -I /usr/local/cuda-6.5/include all: $(NVCC) -O3 -c cuda.cu $(CC) -O3 $(neno_envir) -ffast-math -c video_initial.c $(AR) rcs libcam.a video_initial.o $(CC) -static -O3 $(neno_envir) -ffast-math $(main_file) \ -finline-functions -D_FILE_OFFSET_BITS=64 -lpthread -L. -lcam -c $(NVCC) -O3 -o $(execute_file) Source.o cuda.o video_initial.o $(LIBDIRS) $(INCDIRS) clean: rm -rv $(execute_file) *.o 我將CUDA與NEON程式分開,分開編譯,在做連結 在ubuntu上執行,但都出現以下錯誤 cuda_runtime.h: no such file or directory ubuntu 路徑檢查過了,但就是無法引入標頭檔 還是CUDA 無法與NEON連用? -- Sent from my Windows -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 140.125.35.138 ※ 文章網址: https://www.ptt.cc/bbs/C_and_CPP/M.1502781975.A.144.html

08/16 10:30, , 1F
你的INCDIRS有用到嗎?make的時候應該會顯示下的指令,
08/16 10:30, 1F

08/16 10:30, , 2F
你確定上面有include你想要的路徑?
08/16 10:30, 2F

08/16 12:16, , 3F
感覺路徑錯了 cuda library可能沒裝好
08/16 12:16, 3F

08/16 12:17, , 4F
你要不要寫個簡單的cuda 看看有沒有辦法編譯
08/16 12:17, 4F

08/16 19:32, , 5F
先用 locate cuda_runtime.h 找看看
08/16 19:32, 5F
文章代碼(AID): #1Pag8N54 (C_and_CPP)