qt creator 配置 cuda8.0 出错 5C

错误内容:
NMAKE:-1: warning: U4004: 目标“cuda\composer_cuda.obj”的规则太多
NMAKE:-1: error: U1073: 不知道如何生成“main.cpp”
NMAKE:-1: error: U1077: “"D:\software\Visual Studio 2015\VC\BIN\amd64\nmake.exe"”: 返回代码“0x2”

pro文件内容:

QT += core gui

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = test_cuda
TEMPLATE = app

SOURCES += main.cpp\
dialog.cpp \

HEADERS += dialog.h \
gutil.h \
composer_gpu.h \

FORMS += dialog.ui

OTHER_FILES += composer.cu

CUDA_OBJECTS_DIR= OBJECTS_DIR/../cuda
CUDA_SOURCES += composer.cu
CUDA_DIR = "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v8.0"
CUDA_SDK = "C:/ProgramData/NVIDIA Corporation/CUDA Samples/v8.0"
INCLUDEPATH += $$CUDA_DIR/include
INCLUDEPATH += $$CUDA_SDK/common/inc

QMAKE_LIBDIR += $$CUDA_DIR/lib/x64
QMAKE_LIBDIR += $$CUDA_SDK/common/lib/x64

SYSTEM_TYPE = 64 # '32' or '64', depending on your system

LIBS += -lcuda -lcudart -lcublas

CUDA_ARCH = sm_30

NVCC_OPTIONS = --use_fast_math

CUDA_INC = $$join(INCLUDEPATH,'" -I"','-I"','"')

MSVCRT_LINK_FLAG_DEBUG = "/MDd"

MSVCRT_LINK_FLAG_RELEASE = "/MD"

QMAKE_EXTRA_COMPILERS += cuda

CONFIG(debug, debug|release) {

# Debug mode
cuda_d.input = CUDA_SOURCES
cuda_d.output = $$CUDA_OBJECTS_DIR/${QMAKE_FILE_BASE}_cuda.obj
cuda_d.commands = $$CUDA_DIR/bin/nvcc.exe -D_DEBUG $$NVCC_OPTIONS $$CUDA_INC $$LIBS --machine $$SYSTEM_TYPE \
                 -arch=$$CUDA_ARCH -c -o ${QMAKE_FILE_OUT} ${QMAKE_FILE_NAME} -Xcompiler $$MSVCRT_LINK_FLAG_DEBUG
cuda_d.dependency_type = TYPE_C
QMAKE_EXTRA_COMPILERS += cuda_d

}
else {
# Release mode
cuda.input = CUDA_SOURCES
cuda.output = $$CUDA_OBJECTS_DIR/${QMAKE_FILE_BASE}_cuda.obj
cuda.commands = $$CUDA_DIR/bin/nvcc.exe $$NVCC_OPTIONS $$CUDA_INC $$LIBS --machine $$SYSTEM_TYPE \
-arch=$$CUDA_ARCH -c -o ${QMAKE_FILE_OUT} ${QMAKE_FILE_NAME} -Xcompiler $$MSVCRT_LINK_FLAG_RELEASE
cuda.dependency_type = TYPE_C
QMAKE_EXTRA_COMPILERS += cuda

}

1个回答

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问