2013-07-01 1 views
-1

나는 화성 4.2.9 (화성에서 사용 된 많은 헤더 파일을 제거한 cuda 4.2.9)를 컴파일하려고합니다. 5.0 이하의 버전은이 괴물 같은 메이크 파일 인 common.mk를 사용하는 것으로 보이며 작동하도록 코드를 구성하는 데 어려움을 겪고 있습니다. 객체 파일은 정상적으로 컴파일되지만 다음 오류가 발생합니다.CUDA collect2 ld가 1 개의 종료 상태를 반환했습니다.

/usr/lib64/gcc/x86_64-suse-linux/4.6/../../../../x86_64-suse-linux/bin/ld: cannot find -lcutil_x86_64 
/usr/lib64/gcc/x86_64-suse-linux/4.6/../../../../x86_64-suse-linux/bin/ld: cannot find -lshrutil_x86_64 
collect2: ld returned 1 exit status 
make: *** [/home/ian/code/cuda-4.2.9/C/bin/linux/release/MatrixMul] Error 1 

왜 이런 일이 발생합니까? 어떻게 해결할 수 있습니까?

# Basic directory setup for SDK 
# (override directories only if they are not already defined) 
SRCDIR  ?= 
ROOTDIR ?= /home/ian/code/cuda-4.2.9 
ROOTBINDIR ?= $(ROOTDIR)/C/bin 
BINDIR  ?= $(ROOTBINDIR)/$(OSLOWER) 
ROOTOBJDIR ?= obj 
LIBDIR  := $(ROOTDIR)/C/lib 
COMMONDIR := $(ROOTDIR)/C/common 
SHAREDDIR := $(ROOTDIR)/shared/ 

원래 값 :

# Basic directory setup for SDK 
# (override directories only if they are not already defined) 
SRCDIR  ?= 
ROOTDIR ?= .. 
ROOTBINDIR ?= $(ROOTDIR)/../bin 
BINDIR  ?= $(ROOTBINDIR)/$(OSLOWER) 
ROOTOBJDIR ?= obj 
LIBDIR  := $(ROOTDIR)/../lib 
COMMONDIR := $(ROOTDIR)/../common 
SHAREDDIR := $(ROOTDIR)/../shared/ 

그리고 전체 공통 내가 편집 common.mk의

################################################################################ 
# 
# Build script for project 
# 
################################################################################ 

# Add source files here 
EXECUTABLE  := MatrixMul 
# Cuda source files (compiled with cudacc) 
CUFILES   := main.cu MarsLib.cu MarsScan.cu MarsSort.cu 
# C/C++ source files (compiled with gcc/c++) 
CCFILES   := MarsUtils.cpp 


################################################################################ 
# Rules and targets 

include ../cuda-4.2.9/C/common/common.mk 

의 선 : 여기

는 MatrixMul의 메이크입니다. mk :

################################################################################ 
# 
# Common build script for CUDA source projects for Linux and Mac platforms 
# 
################################################################################ 

.SUFFIXES : .cu .cu_dbg.o .c_dbg.o .cpp_dbg.o .cu_rel.o .c_rel.o .cpp_rel.o .cubin .ptx 

# Add new SM Versions here as devices with new Compute Capability are released 
SM_VERSIONS := 10 11 12 13 20 21 30 

CUDA_INSTALL_PATH ?= /home/ian/code/cuda-4.2.9/cuda/ 

ifdef cuda-install 
     CUDA_INSTALL_PATH := $(cuda-install) 
endif 

# detect OS 
OSUPPER = $(shell uname -s 2>/dev/null | tr [:lower:] [:upper:]) 
OSLOWER = $(shell uname -s 2>/dev/null | tr [:upper:] [:lower:]) 

# 'linux' is output for Linux system, 'darwin' for OS X 
DARWIN = $(strip $(findstring DARWIN, $(OSUPPER))) 
ifneq ($(DARWIN),) 
    SNOWLEOPARD = $(strip $(findstring 10.6, $(shell egrep "<string>10\.6" /System/Library/CoreServices/SystemVersion.plist))) 
    LION  = $(strip $(findstring 10.7, $(shell egrep "<string>10\.7" /System/Library/CoreServices/SystemVersion.plist))) 
endif 

# detect 32-bit or 64-bit platform 
HP_64 = $(shell uname -m | grep 64) 
OSARCH= $(shell uname -m) 

# Basic directory setup for SDK 
# (override directories only if they are not already defined) 
SRCDIR  ?= 
ROOTDIR ?= /home/ian/code/cuda-4.2.9/cuda/C 
ROOTBINDIR ?= $(ROOTDIR)/bin 
BINDIR  ?= $(ROOTBINDIR)/$(OSLOWER) 
ROOTOBJDIR ?= obj 
LIBDIR  := $(ROOTDIR)/lib 
COMMONDIR := $(ROOTDIR)/common 
SHAREDDIR := $(ROOTDIR)/../shared/ 

# Compilers 
NVCC  := $(CUDA_INSTALL_PATH)/bin/nvcc 
CXX  := g++ -fPIC 
CC   := gcc -fPIC 
LINK  := g++ -fPIC 
# Includes 
INCLUDES += -I. -I$(CUDA_INSTALL_PATH)/include -I$(COMMONDIR)/inc -I$(SHAREDDIR)/inc 

# Warning flags 
CXXWARN_FLAGS := \ 
     -W -Wall \ 
     -Wimplicit \ 
     -Wswitch \ 
     -Wformat \ 
     -Wchar-subscripts \ 
     -Wparentheses \ 
     -Wmultichar \ 
     -Wtrigraphs \ 
     -Wpointer-arith \ 
     -Wcast-align \ 
     -Wreturn-type \ 
     -Wno-unused-function \ 
     $(SPACE) 

CWARN_FLAGS := $(CXXWARN_FLAGS) \ 
     -Wstrict-prototypes \ 
     -Wmissing-prototypes \ 
     -Wmissing-declarations \ 
     -Wnested-externs \ 
     -Wmain \ 

# architecture flag for nvcc and gcc compilers build 
CUBIN_ARCH_FLAG := 
CXX_ARCH_FLAGS := 
NVCCFLAGS  := 
LIB_ARCH  := $(OSARCH) 

# Determining the necessary Cross-Compilation Flags 
# 32-bit OS, but we target 64-bit cross compilation 
ifeq ($(x86_64),1) 
    NVCCFLAGS  += -m64 
    LIB_ARCH   = x86_64 
    ifneq ($(DARWIN),) 
     CXX_ARCH_FLAGS += -arch x86_64 
    else 
     CXX_ARCH_FLAGS += -m64 
    endif 
else 
# 64-bit OS, and we target 32-bit cross compilation 
    ifeq ($(i386),1) 
     NVCCFLAGS  += -m32 
     LIB_ARCH   = i386 
     ifneq ($(DARWIN),) 
      CXX_ARCH_FLAGS += -arch i386 
     else 
      CXX_ARCH_FLAGS += -m32 
     endif 
    else 
     ifeq "$(strip $(HP_64))" "" 
      LIB_ARCH  = i386 
      NVCCFLAGS  += -m32 
      ifneq ($(DARWIN),) 
       CXX_ARCH_FLAGS += -arch i386 
     else 
      CXX_ARCH_FLAGS += -m32 
     endif 
    else 
     ifeq "$(strip $(HP_64))" "" 
      LIB_ARCH  = i386 
      NVCCFLAGS  += -m32 
      ifneq ($(DARWIN),) 
       CXX_ARCH_FLAGS += -arch i386 
      else 
       CXX_ARCH_FLAGS += -m32 
      endif 
     else 
      LIB_ARCH  = x86_64 
      NVCCFLAGS  += -m64 
      ifneq ($(DARWIN),) 
       CXX_ARCH_FLAGS += -arch x86_64 
      else 
       CXX_ARCH_FLAGS += -m64 
      endif 
     endif 
    endif 
endif 

# Compiler-specific flags (by default, we always use sm_10, sm_20, and sm_30), unless we use the SMVERSION template 
GENCODE_SM10 := -gencode=arch=compute_10,code=\"sm_10,compute_10\" 
GENCODE_SM20 := -gencode=arch=compute_20,code=\"sm_20,compute_20\" 
GENCODE_SM30 := -gencode=arch=compute_30,code=\"sm_30,compute_30\" 

CXXFLAGS += $(CXXWARN_FLAGS) $(CXX_ARCH_FLAGS) 
CFLAGS += $(CWARN_FLAGS) $(CXX_ARCH_FLAGS) 
LINKFLAGS += 
LINK  += $(LINKFLAGS) $(CXX_ARCH_FLAGS) 

# This option for Mac allows CUDA applications to work without requiring to set DYLD_LIBRARY_PATH 
ifneq ($(DARWIN),) 
    LINK += -Xlinker -rpath $(CUDA_INSTALL_PATH)/lib 
endif 

# Common flags 
COMMONFLAGS += $(INCLUDES) -DUNIX 

# If we are enabling GPU based debugging, then we want to use -G, warning that this 
# May have a significant impact on GPU device code, since optimizations are turned off 
ifeq ($(gpudbg),1) 
    NVCCFLAGS += -G 
     dbg = $(gpudbg) 
endif 

# Debug/release configuration 
ifeq ($(dbg),1) 
     COMMONFLAGS += -g 
    NVCCFLAGS += -D_DEBUG 
     CXXFLAGS += -D_DEBUG 
     CFLAGS  += -D_DEBUG 
     BINSUBDIR := debug 
     LIBSUFFIX := D 
else 
     COMMONFLAGS += -O2 
     BINSUBDIR := release 
     LIBSUFFIX := 
     NVCCFLAGS += --compiler-options -fno-strict-aliasing 
     CXXFLAGS += -fno-strict-aliasing 
     CFLAGS  += -fno-strict-aliasing 
endif 

# architecture flag for cubin build 
CUBIN_ARCH_FLAG := 

# OpenGL is used or not (if it is used, then it is necessary to include GLEW) 
ifeq ($(USEGLLIB),1) 
    ifneq ($(DARWIN),) 
     OPENGLLIB := -L/System/Library/Frameworks/OpenGL.framework/Libraries 
     OPENGLLIB += -lGL -lGLU $(COMMONDIR)/lib/$(OSLOWER)/libGLEW.a 
    else 
# this case for linux platforms 
     OPENGLLIB := -lGL -lGLU -lX11 -lXi -lXmu 
# check if x86_64 flag has been set, otherwise, check HP_64 is i386/x86_64 
     ifeq ($(x86_64),1) 
       OPENGLLIB += -lGLEW_x86_64 -L/usr/X11R6/lib64 
     else 
      ifeq ($(i386),) 
       ifeq "$(strip $(HP_64))" "" 
        OPENGLLIB += -lGLEW -L/usr/X11R6/lib 
       else 
        OPENGLLIB += -lGLEW_x86_64 -L/usr/X11R6/lib64 
       endif 
      endif 
     endif 
# check if i386 flag has been set, otehrwise check HP_64 is i386/x86_64 
     ifeq ($(i386),1) 
       OPENGLLIB += -lGLEW -L/usr/X11R6/lib 
     else 
      ifeq ($(x86_64),) 
       ifeq "$(strip $(HP_64))" "" 
        OPENGLLIB += -lGLEW -L/usr/X11R6/lib 
       else 
        OPENGLLIB += -lGLEW_x86_64 -L/usr/X11R6/lib64 
       endif 
      endif 
     endif 
    endif 
endif 
ifeq ($(USEGLUT),1) 
    ifneq ($(DARWIN),) 
     OPENGLLIB += -framework GLUT 
    else 
     ifeq ($(x86_64),1) 
      OPENGLLIB += -lglut -L/usr/lib64 
     endif 
     ifeq ($(i386),1) 
      OPENGLLIB += -lglut -L/usr/lib 
     endif 

     ifeq ($(x86_64),) 
      ifeq ($(i386),) 
       OPENGLLIB += -lglut 
      endif 
     endif 
    endif 
endif 

ifeq ($(USEPARAMGL),1) 
     PARAMGLLIB := -lparamgl_$(LIB_ARCH)$(LIBSUFFIX) 
endif 

ifeq ($(USERENDERCHECKGL),1) 
     RENDERCHECKGLLIB := -lrendercheckgl_$(LIB_ARCH)$(LIBSUFFIX) 
endif 

ifeq ($(USENVCUVID), 1) 
    ifneq ($(DARWIN),) 
     NVCUVIDLIB := -L../../common/lib/darwin -lnvcuvid 
    endif 
endif 

# Libs 
ifneq ($(DARWIN),) 
    LIB  := -L$(CUDA_INSTALL_PATH)/lib -L$(LIBDIR) -L$(COMMONDIR)/lib/$(OSLOWER) -L$(SHAREDDIR)/lib $(NVCUVIDLIB) 
else 
    ifeq "$(strip $(HP_64))" "" 
    ifeq ($(x86_64),1) 
     LIB  := -L$(CUDA_INSTALL_PATH)/lib64 -L$(LIBDIR) -L$(COMMONDIR)/lib/$(OSLOWER) -L$(SHAREDDIR)/lib 
    else 
     LIB  := -L$(CUDA_INSTALL_PATH)/lib -L$(LIBDIR) -L$(COMMONDIR)/lib/$(OSLOWER) -L$(SHAREDDIR)/lib 
    endif 
    else 
    ifeq ($(i386),1) 
     LIB  := -L$(CUDA_INSTALL_PATH)/lib -L$(LIBDIR) -L$(COMMONDIR)/lib/$(OSLOWER) -L$(SHAREDDIR)/lib 
    else 
     LIB  := -L$(CUDA_INSTALL_PATH)/lib64 -L$(LIBDIR) -L$(COMMONDIR)/lib/$(OSLOWER) -L$(SHAREDDIR)/lib 
    endif 
    endif 
endif 
# If dynamically linking to CUDA and CUDART, we exclude the libraries from the LIB 
ifeq ($(USECUDADYNLIB),1) 
    LIB += ${OPENGLLIB} $(PARAMGLLIB) $(RENDERCHECKGLLIB) ${LIB} -ldl -rdynamic 
else 
# static linking, we will statically link against CUDA and CUDART 
    ifeq ($(USEDRVAPI),1) 
    LIB += -lcuda ${OPENGLLIB} $(PARAMGLLIB) $(RENDERCHECKGLLIB) ${LIB} 
    else 
    ifeq ($(emu),1) 
     LIB += -lcudartemu 
    else 
     LIB += -lcudart 
    endif 
    LIB += ${OPENGLLIB} $(PARAMGLLIB) $(RENDERCHECKGLLIB) ${LIB} 
    endif 
endif 

ifeq ($(USECUFFT),1) 
    ifeq ($(emu),1) 
    LIB += -lcufftemu 
    else 
    LIB += -lcufft 
    endif 
endif 

ifeq ($(USECUBLAS),1) 
    ifeq ($(emu),1) 
    LIB += -lcublasemu 
    else 
    LIB += -lcublas 
    endif 
endif 

ifeq ($(USECURAND),1) 
    LIB += -lcurand 
endif 

ifeq ($(USECUSPARSE),1) 
    LIB += -lcusparse 
endif 

# Lib/exe configuration 
# Lib/exe configuration 
# Lib/exe configuration 
ifneq ($(STATIC_LIB),) 
     TARGETDIR := $(LIBDIR) 
     TARGET := $(subst .a,_$(LIB_ARCH)$(LIBSUFFIX).a,$(LIBDIR)/$(STATIC_LIB)) 
     LINKLINE = ar rucv $(TARGET) $(OBJS) 
else 
     ifneq ($(OMIT_CUTIL_LIB),1) 
       LIB += -lcutil_$(LIB_ARCH)$(LIBSUFFIX) 
     endif 
     ifneq ($(OMIT_SHRUTIL_LIB),1) 
       LIB += -lshrutil_$(LIB_ARCH)$(LIBSUFFIX) 
     endif 

     # Device emulation configuration 
     ifeq ($(emu), 1) 
       NVCCFLAGS += -deviceemu 
       CUDACCFLAGS += 
       BINSUBDIR := emu$(BINSUBDIR) 
       # consistency, makes developing easier 
       CXXFLAGS    += -D__DEVICE_EMULATION__ 
       CFLAGS     += -D__DEVICE_EMULATION__ 
     endif 
     TARGETDIR := $(BINDIR)/$(BINSUBDIR) 
     TARGET := $(TARGETDIR)/$(EXECUTABLE) 
     LINKLINE = $(LINK) -o $(TARGET) $(OBJS) $(LIB) 
endif 

# check if verbose 
ifeq ($(verbose), 1) 
     VERBOSE := 
else 
     VERBOSE := @ 
endif 

################################################################################ 
# Check for input flags and set compiler flags appropriately 
################################################################################ 
ifeq ($(fastmath), 1) 
     NVCCFLAGS += -use_fast_math 
endif 

ifeq ($(keep), 1) 
     NVCCFLAGS += -keep 
     NVCC_KEEP_CLEAN := *.i* *.cubin *.cu.c *.cudafe* *.fatbin.c *.ptx 
endif 

ifdef maxregisters 
     NVCCFLAGS += -maxrregcount $(maxregisters) 
endif 

ifeq ($(ptxas), 1) 
     NVCCFLAGS += --ptxas-options=-v 
endif 
# Add cudacc flags 
NVCCFLAGS += $(CUDACCFLAGS) 

# Add common flags 
NVCCFLAGS += $(COMMONFLAGS) 
CXXFLAGS += $(COMMONFLAGS) 
CFLAGS += $(COMMONFLAGS) 

ifeq ($(nvcc_warn_verbose),1) 
     NVCCFLAGS += $(addprefix --compiler-options ,$(CXXWARN_FLAGS)) 
     NVCCFLAGS += --compiler-options -fno-strict-aliasing 
endif 

################################################################################ 
# Set up object files 
################################################################################ 
OBJDIR := $(ROOTOBJDIR)/$(LIB_ARCH)/$(BINSUBDIR) 
OBJS += $(patsubst %.cpp,$(OBJDIR)/%.cpp.o,$(notdir $(CCFILES))) 
OBJS += $(patsubst %.c,$(OBJDIR)/%.c.o,$(notdir $(CFILES))) 
OBJS += $(patsubst %.cu,$(OBJDIR)/%.cu.o,$(notdir $(CUFILES))) 

################################################################################ 
# Set up cubin output files 
################################################################################ 
CUBINDIR := $(SRCDIR)data 
CUBINS += $(patsubst %.cu,$(CUBINDIR)/%.cubin,$(notdir $(CUBINFILES))) 

################################################################################ 
# Set up PTX output files 
################################################################################ 
PTXDIR := $(SRCDIR)data 
PTXBINS += $(patsubst %.cu,$(PTXDIR)/%.ptx,$(notdir $(PTXFILES))) 

################################################################################ 
# Rules 
################################################################################ 
$(OBJDIR)/%.c.o : $(SRCDIR)%.c $(C_DEPS) 
     $(VERBOSE)$(CC) $(CFLAGS) -o [email protected] -c $< 

$(OBJDIR)/%.cpp.o : $(SRCDIR)%.cpp $(C_DEPS) 
     $(VERBOSE)$(CXX) $(CXXFLAGS) -o [email protected] -c $< 

# Default arch includes gencode for sm_10, sm_20, sm_30, and other archs from GENCODE_ARCH declared in the makefile 
$(OBJDIR)/%.cu.o : $(SRCDIR)%.cu $(CU_DEPS) 
     $(VERBOSE)$(NVCC) $(GENCODE_SM10) $(GENCODE_ARCH) $(GENCODE_SM20) $(GENCODE_SM30) $(NVCCFLAGS) $(SMVERSIONFLAGS) -o [email protected] -c $< 

# Default arch includes gencode for sm_10, sm_20, sm_30, and other archs from GENCODE_ARCH declared in the makefile 
$(CUBINDIR)/%.cubin : $(SRCDIR)%.cu cubindirectory 
     $(VERBOSE)$(NVCC) $(GENCODE_SM10) $(GENCODE_ARCH) $(GENCODE_SM20) $(GENCODE_SM30) $(CUBIN_ARCH_FLAG) $(NVCCFLAGS) $(SMVERSIONFLAGS) -o [email protected] -cubin $< 

$(PTXDIR)/%.ptx : $(SRCDIR)%.cu ptxdirectory 
     $(VERBOSE)$(NVCC) $(CUBIN_ARCH_FLAG) $(NVCCFLAGS) $(SMVERSIONFLAGS) -o [email protected] -ptx $< 
# The following definition is a template that gets instantiated for each SM 
# version (sm_10, sm_13, etc.) stored in SMVERSIONS. It does 2 things: 
# 1. It adds to OBJS a .cu_sm_XX.o for each .cu file it finds in CUFILES_sm_XX. 
# 2. It generates a rule for building .cu_sm_XX.o files from the corresponding 
# .cu file. 
# 
# The intended use for this is to allow Makefiles that use common.mk to compile 
# files to different Compute Capability targets (aka SM arch version). To do 
# so, in the Makefile, list files for each SM arch separately, like so: 
# This will be used over the default rule abov 
# 
# CUFILES_sm_10 := mycudakernel_sm10.cu app.cu 
# CUFILES_sm_12 := anothercudakernel_sm12.cu 
# 
define SMVERSION_template 
#OBJS += $(patsubst %.cu,$(OBJDIR)/%.cu_$(1).o,$(notdir $(CUFILES_$(1)))) 
OBJS += $(patsubst %.cu,$(OBJDIR)/%.cu_$(1).o,$(notdir $(CUFILES_sm_$(1)))) 
$(OBJDIR)/%.cu_$(1).o : $(SRCDIR)%.cu $(CU_DEPS) 
#  $(VERBOSE)$(NVCC) -o [email protected] -c $$< $(NVCCFLAGS) $(1) 
     $(VERBOSE)$(NVCC) -gencode=arch=compute_$(1),code=\"sm_$(1),compute_$(1)\" $(GENCODE_SM20) $(GENCODE_SM30) -o [email protected] -c $$< $(NVCCFLAGS) 
endef 

# This line invokes the above template for each arch version stored in 
# SM_VERSIONS. The call function invokes the template, and the eval 
# function interprets it as make commands. 
$(foreach smver,$(SM_VERSIONS),$(eval $(call SMVERSION_template,$(smver)))) 

$(TARGET): makedirectories $(OBJS) $(CUBINS) $(PTXBINS) Makefile 
     $(VERBOSE)$(LINKLINE) 

cubindirectory: 
     $(VERBOSE)mkdir -p $(CUBINDIR) 

ptxdirectory: 
     $(VERBOSE)mkdir -p $(PTXDIR) 

makedirectories: 
     $(VERBOSE)mkdir -p $(LIBDIR) 
     $(VERBOSE)mkdir -p $(OBJDIR) 
     $(VERBOSE)mkdir -p $(TARGETDIR) 


tidy : 
     $(VERBOSE)find . | egrep "#" | xargs rm -f 
     $(VERBOSE)find . | egrep "\~" | xargs rm -f 
clean : tidy 
     $(VERBOSE)rm -f *.stub.c *.gpu *.cu.cpp *.i *.ii 
     $(VERBOSE)rm -f *.cubin *.ptx *.fatbin.c *.hash 
     $(VERBOSE)rm -f *.cudafe1.c *.cudafe2.c *.cudafe1.cpp *.cudafe2.cpp 
     $(VERBOSE)rm -f $(OBJS) 
     $(VERBOSE)rm -f $(CUBINS) 
     $(VERBOSE)rm -f $(PTXBINS) 
     $(VERBOSE)rm -f $(TARGET) 
     $(VERBOSE)rm -f $(NVCC_KEEP_CLEAN) 
     $(VERBOSE)rm -f $(ROOTBINDIR)/$(OSLOWER)/$(BINSUBDIR)/*.ppm 
     $(VERBOSE)rm -f $(ROOTBINDIR)/$(OSLOWER)/$(BINSUBDIR)/*.pgm 
     $(VERBOSE)rm -f $(ROOTBINDIR)/$(OSLOWER)/$(BINSUBDIR)/*.bin 
     $(VERBOSE)rm -f $(ROOTBINDIR)/$(OSLOWER)/$(BINSUBDIR)/*.bmp 
     $(VERBOSE)rm -f $(ROOTBINDIR)/$(OSLOWER)/$(BINSUBDIR)/*.txt 
     $(VERBOSE)rm -f $(CUBINDIR)/*.cubin $(PTXDIR)/*.ptx 
     $(VERBOSE)rm -rf $(ROOTOBJDIR) 
     $(VERBOSE)rm -rf $(LIBDIR) 
     $(VERBOSE)rm -rf $(OBJDIR) 
     $(VERBOSE)rm -rf $(TARGETDIR) 

clobber : clean 
     $(VERBOSE)rm -rf $(COMMONDIR)/lib/*.a 
     $(VERBOSE)rm -rf $(SHAREDDIR)/lib/*.a 
     $(VERBOSE)rm -rf $(COMMONDIR)/obj 
     $(VERBOSE)rm -rf $(SHAREDDIR)/obj 

답변

1

Why is this happening?

libcutil_x86_64.liblibshrutil_x86_64.lib는 CUDA SDK를 설치 한 후 적절한 make 작업이 완료되었을 때 (이전 CUDA 4.2 CUDA SDK라는 등) CUDA 샘플에 의해 내장되어 있습니다 라이브러리입니다. 링커에서 이러한 라이브러리를 찾을 수 없으므로 이러한 오류가 발생합니다.

How can I remedy it?

  1. 는 CUDA 4.2 SDK가 제대로 설치되어 있는지 확인하고 필요한 make 작업은 샘플 때문에 필요한 라이브러리를 구축하기 위해 수행되었습니다. CUDA SDK를 설치하거나 샘플 코드를 만드는 방법을 잘 모르는 경우 /home/ian/code/cuda-4.2.9/CUDA_SDK_Release_Notes.txt 파일 (특히 Linux 설치 지침)을 검토하십시오. 해당 디렉토리에있는 GPU_COMPUTING_SDK_Description.rtf 파일과 .../doc/release 하위 디렉토리에도 관심이있을 수 있습니다. 샘플을 제대로 작성하지 않으면 라이브러리를 사용할 수 없으며 자신 만의 matrixMul-MARS 프로젝트를 연결하는 데 별 도움이되지 않습니다. CUDA SDK를 설치할 디렉토리 경로를 지정할 수 있습니다. 여기에서 경로상의 ...이 SDK 설치 경로 (/home/ian/code/cuda-4.2.9/NVIDIA_GPU_Computing_SDK 또는 유사 할 수 있음)를 나타냈다 고 가정 해 봅시다. 이미 가지고있는 것들이 혼란 스러울 경우 설치 프로그램을 정리하고 다시 실행할 수 있습니다.
  2. matrixMul-MARS 프로젝트의 새 프로젝트 디렉토리를 다른 C 소스 프로젝트 디렉토리와 동일한 수준 (예 : .../C/src/myMARS 또는 이와 비슷한)으로 만듭니다.
  3. .../C/src/matrixMul 디렉토리의 모든 파일을 새로운 .../C/src/myMARS 디렉토리에 복사하십시오.
  4. 빌드 할 추가 파일을 포함하여 여기에 표시된 것과 일치하는 새 프로젝트 디렉토리 (전용)의 Makefile에 필요한 변경을하십시오. common.mk를 변경할 필요가 없습니다 .
  5. 이제 새 프로젝트 디렉토리에서 make을 실행하십시오.
+0

자세한 내용은 모든 것이 훌륭하게 작동합니다. – user1743798

관련 문제