2 개의 파일이 있습니다. 1) simple1.cu 2) test.cpp. 컴파일 및 WAF를 사용하여 이러한 파일을 연결하려고합니다. wscript 파일은 아래와 같습니다.WAF 링커 오류 문제
def options(opt):
opt.load('compiler_cxx')
def configure(cnf):
cnf.load('compiler_cxx')
def build(bld):
bld(
name='b1',
features='cxx',
rule='/usr/local/cuda/bin/nvcc -arch=sm_35 -dc ${SRC}',
source='simple1.cu',
target='simple1.o')
bld(
name='r1',
features='cxx',
rule='/usr/local/cuda/bin/nvcc -arch=sm_35 -dlink ${SRC} -o ${TGT} -lcudadevrt',
includes=['build'],
source='simple1.o',
target='link.o',
after='b1')
bld(
name='abc',
features='cxx',
rule='g++ -c ${SRC}',
source='test.cpp',
includes=['build'],
after='r1')
나는 cuda 별도 컴파일 옵션을 사용하고 있습니다. 지금은 3 개 객체를 생성 할 수 있어요 위의 파일로 link.o simple1.o과 test.o
을 파일하지만 난 .. 다음과 같이
bld(
features='cxxprogram',
rule='g++ ${SRC} -o ${TGT} -L/usr/local/cuda/lib64/ -lcudart',
includes=['build'],
source=['simple1.o','link.o','test.o'],
target='somex')
그들을 링크 할 때 다음과 같은 얻을 오류
소스를 찾을 수 없습니다 'test.o'를 BLD (기능 = 'cxxprogram', IDX = 4 _name = 'somex'meths가 = 'create_task_macapp', 'create_task_macplist', 'process_rule'에 , 'process_source'], prec = defaultdict (, {}), include = [ 'build'], 소스 = [ 'simple1.o', 'link.o', 'test.o']
내가 그것을 잘 작동 터미널에서 명령 다음 명령을 사용하여 수동 함께 파일을 연결하면3210g++ build/link.o build/simple1.o build/test.o -o simple -L/usr/local/cuda/lib64/ -lcudart
도와주세요 (내가 실행 파일을 생성하고 실행 할 수 있습니다).