2017-11-24 4 views
0

次のmakefileには非常に奇妙な問題があります。ファイルの一部がスキップされ、残りはすべてファイルになります。たとえば、Matrixd.oを作成することはできますが、Matrixf.oはスキップします。単純にcv_utils.oを作成しますが、Common.cu、compDT.cu、constructDIntegrals.cu、およびconstructDirectionImage.cuはスキップします。残りのファイルはすべてコンパイルされ、オブジェクトファイルが正しく作成されます。エラーや警告はありません。これらのファイルをスキップするだけです。CudaプロジェクトのMakefileがいくつかのファイルをスキップします

ここで問題になる可能性のあることは誰でも指摘できますか?

添付ファイルは以下のとおりです。

################################################################################ 
# 
# Copyright 1993-2013 NVIDIA Corporation. All rights reserved. 
# 
# NOTICE TO USER: 
# 
# This source code is subject to NVIDIA ownership rights under U.S. and 
# international Copyright laws. 
# 
# NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOURCE 
# CODE FOR ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR 
# IMPLIED WARRANTY OF ANY KIND. NVIDIA DISCLAIMS ALL WARRANTIES WITH 
# REGARD TO THIS SOURCE CODE, INCLUDING ALL IMPLIED WARRANTIES OF 
# MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE. 
# IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL, 
# OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS 
# OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE 
# OR PERFORMANCE OF THIS SOURCE CODE. 
# 
# U.S. Government End Users. This source code is a "commercial item" as 
# that term is defined at 48 C.F.R. 2.101 (OCT 1995), consisting of 
# "commercial computer software" and "commercial computer software 
# documentation" as such terms are used in 48 C.F.R. 12.212 (SEPT 1995) 
# and is provided to the U.S. Government only as a commercial end item. 
# Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through 
# 227.7202-4 (JUNE 1995), all U.S. Government End Users acquire the 
# source code with only those rights set forth herein. 
# 
################################################################################ 
# 
# Makefile project only supported on Mac OS X and Linux Platforms) 
# 
################################################################################ 

# Location of the CUDA Toolkit 
CUDA_PATH  ?= /usr/local/cuda-6.5 

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

OS_SIZE = $(shell uname -m | sed -e "s/x86_64/64/" -e "s/armv7l/32/" -e "s/aarch64/64/") 
OS_ARCH = $(shell uname -m) 
ARCH_FLAGS = 

DARWIN = $(strip $(findstring DARWIN, $(OSUPPER))) 
ifneq ($(DARWIN),) 
    XCODE_GE_5 = $(shell expr `xcodebuild -version | grep -i xcode | awk '{print $$2}' | cut -d'.' -f1` \>= 5) 
endif 

# Take command line flags that override any of these settings 
ifeq ($(x86_64),1) 
    OS_SIZE = 64 
    OS_ARCH = x86_64 
endif 
ifeq ($(ARMv7),1) 
    OS_SIZE = 32 
    OS_ARCH = armv7l 
    ARCH_FLAGS = -target-cpu-arch ARM 
endif 
ifeq ($(aarch64),1) 
    OS_SIZE = 64 
    OS_ARCH = aarch64 
    ARCH_FLAGS = -target-cpu-arch ARM 
endif 

# Common binaries 
ifneq ($(DARWIN),) 
ifeq ($(XCODE_GE_5),1) 
    GCC ?= clang 
else 
    GCC ?= g++ 
endif 
else 
ifeq ($(ARMv7),1) 
    GCC ?= arm-linux-gnueabihf-g++ 
else 
    GCC ?= g++ 
endif 
endif 
NVCC := $(CUDA_PATH)/bin/nvcc -ccbin $(GCC) 

# internal flags 
NVCCFLAGS := -m${OS_SIZE} ${ARCH_FLAGS} 
CCFLAGS  := 
LDFLAGS  := 

# Extra user flags 
EXTRA_NVCCFLAGS ?= 
EXTRA_LDFLAGS  ?= 
EXTRA_CCFLAGS  ?= 

# OS-specific build flags 
ifneq ($(DARWIN),) 
    LDFLAGS += -rpath $(CUDA_PATH)/lib 
    CCFLAGS += -arch $(OS_ARCH) 
else 
    ifeq ($(OS_ARCH),armv7l) 
    ifeq ($(abi),androideabi) 
     NVCCFLAGS += -target-os-variant Android 
    else 
     ifeq ($(abi),gnueabi) 
     CCFLAGS += -mfloat-abi=softfp 
     else 
     # default to gnueabihf 
     override abi := gnueabihf 
     LDFLAGS += --dynamic-linker=/lib/ld-linux-armhf.so.3 
     CCFLAGS += -mfloat-abi=hard 
     endif 
    endif 
    endif 
endif 

ifeq ($(ARMv7),1) 
ifneq ($(TARGET_FS),) 
GCCVERSIONLTEQ46 := $(shell expr `$(GCC) -dumpversion` \<= 4.6) 
ifeq ($(GCCVERSIONLTEQ46),1) 
CCFLAGS += --sysroot=$(TARGET_FS) 
endif 
LDFLAGS += --sysroot=$(TARGET_FS) 
LDFLAGS += -rpath-link=$(TARGET_FS)/lib 
LDFLAGS += -rpath-link=$(TARGET_FS)/usr/lib 
LDFLAGS += -rpath-link=$(TARGET_FS)/usr/lib/arm-linux-$(abi) 
endif 
endif 

# Debug build flags 
ifeq ($(dbg),1) 
     NVCCFLAGS += -g -G 
     TARGET := debug 
else 
     TARGET := release 
endif 

ALL_CCFLAGS := 
ALL_CCFLAGS += $(NVCCFLAGS) 
ALL_CCFLAGS += $(EXTRA_NVCCFLAGS) 
ALL_CCFLAGS += $(addprefix -Xcompiler ,$(CCFLAGS)) 
ALL_CCFLAGS += $(addprefix -Xcompiler ,$(EXTRA_CCFLAGS)) 

ALL_LDFLAGS := 
ALL_LDFLAGS += $(ALL_CCFLAGS) 
ALL_LDFLAGS += $(addprefix -Xlinker ,$(LDFLAGS)) 
ALL_LDFLAGS += $(addprefix -Xlinker ,$(EXTRA_LDFLAGS)) 

# Common includes and paths for CUDA 
INCLUDES := -I../../common/inc 
LIBRARIES := 

################################################################################ 

SAMPLE_ENABLED := 1 

# Gencode arguments 
ifeq ($(OS_ARCH),armv7l) 
SMS ?= 20 30 32 35 37 50 52 
else 
SMS ?= 11 20 30 35 37 50 52 
endif 

ifeq ($(SMS),) 
$(info >>> WARNING - no SM architectures have been specified - waiving sample <<<) 
SAMPLE_ENABLED := 0 
endif 

ifeq ($(GENCODE_FLAGS),) 
# Generate SASS code for each SM architecture listed in $(SMS) 
$(foreach sm,$(SMS),$(eval GENCODE_FLAGS += -gencode arch=compute_$(sm),code=sm_$(sm))) 

# Generate PTX code from the highest SM architecture in $(SMS) to guarantee forward-compatibility 
HIGHEST_SM := $(lastword $(sort $(SMS))) 
ifneq ($(HIGHEST_SM),) 
GENCODE_FLAGS += -gencode arch=compute_$(HIGHEST_SM),code=compute_$(HIGHEST_SM) 
endif 
endif 

ifeq ($(SAMPLE_ENABLED),0) 
EXEC ?= @echo "[@]" 
endif 

################################################################################ 

# Target rules 
all: build 

build: gpuFDCM 

check.deps: 
ifeq ($(SAMPLE_ENABLED),0) 
    @echo "Sample will be waived due to the above missing dependencies" 
else 
    @echo "Sample is ready - all dependencies have been met" 
endif 

ConvertBase64.o:../src/vfcore/ConvertBase64.cpp 
    $(EXEC) $(NVCC) $(INCLUDES) -I../include -I../gpuFDCM -I../gpuFDCM/include $(ALL_CCFLAGS) $(GENCODE_FLAGS) -o [email protected] -c $< 

FileNameUtils.o:../src/vfcore/FileNameUtils.cpp 
    $(EXEC) $(NVCC) $(INCLUDES) -I../include -I../gpuFDCM -I../gpuFDCM/include $(ALL_CCFLAGS) $(GENCODE_FLAGS) -o [email protected] -c $< 

FileUtils.o:../src/vfcore/FileUtils.cpp 
    $(EXEC) $(NVCC) $(INCLUDES) -I../include -I../gpuFDCM -I../gpuFDCM/include $(ALL_CCFLAGS) $(GENCODE_FLAGS) -o [email protected] -c $< 

fstream.o:../src/vfcore/fstream.cpp 
    $(EXEC) $(NVCC) $(INCLUDES) -I../include -I../gpuFDCM -I../gpuFDCM/include $(ALL_CCFLAGS) $(GENCODE_FLAGS) -o [email protected] -c $< 

Matrixd.o:../src/vfcore/Matrixd.cpp 
    $(EXEC) $(NVCC) $(INCLUDES) -I../include -I../gpuFDCM -I../gpuFDCM/include $(ALL_CCFLAGS) $(GENCODE_FLAGS) -o [email protected] -c $< 

Matrixf.o:../src/vfcore/Matrixf.cpp 
    $(EXEC) $(NVCC) $(INCLUDES) -I../include -I../gpuFDCM -I../gpuFDCM/include $(ALL_CCFLAGS) $(GENCODE_FLAGS) -o [email protected] -c $< 

Quat.o:../src/vfcore/Quat.cpp 
    $(EXEC) $(NVCC) $(INCLUDES) -I../include -I../gpuFDCM -I../gpuFDCM/include $(ALL_CCFLAGS) $(GENCODE_FLAGS) -o [email protected] -c $< 

RefCounted.o:../src/vfcore/RefCounted.cpp 
    $(EXEC) $(NVCC) $(INCLUDES) -I../include -I../gpuFDCM -I../gpuFDCM/include $(ALL_CCFLAGS) $(GENCODE_FLAGS) -o [email protected] -c $< 

Timer.o:../src/vfcore/Timer.cpp 
    $(EXEC) $(NVCC) $(INCLUDES) -I../include -I../gpuFDCM -I../gpuFDCM/include $(ALL_CCFLAGS) $(GENCODE_FLAGS) -o [email protected] -c $< 

tinystr.o:../src/vfcore/tinystr.cpp 
    $(EXEC) $(NVCC) $(INCLUDES) -I../include -I../gpuFDCM -I../gpuFDCM/include $(ALL_CCFLAGS) $(GENCODE_FLAGS) -o [email protected] -c $< 

tinyxml.o:../src/vfcore/tinyxml.cpp 
    $(EXEC) $(NVCC) $(INCLUDES) -I../include -I../gpuFDCM -I../gpuFDCM/include $(ALL_CCFLAGS) $(GENCODE_FLAGS) -o [email protected] -c $< 

tinyxmlerror.o:../src/vfcore/tinyxmlerror.cpp 
    $(EXEC) $(NVCC) $(INCLUDES) -I../include -I../gpuFDCM -I../gpuFDCM/include $(ALL_CCFLAGS) $(GENCODE_FLAGS) -o [email protected] -c $< 

tinyxmlparser.o:../src/vfcore/tinyxmlparser.cpp 
    $(EXEC) $(NVCC) $(INCLUDES) -I../include -I../gpuFDCM -I../gpuFDCM/include $(ALL_CCFLAGS) $(GENCODE_FLAGS) -o [email protected] -c $< 

main.o:../gpuFDCM/main.cu 
    $(EXEC) $(NVCC) $(INCLUDES) -DUSE_CUDA -I../include -I../gpuFDCM -I../gpuFDCM/include -I../gpuFDCM/FitLine $(ALL_CCFLAGS) $(GENCODE_FLAGS) -o [email protected] -c $< 

Fdcm_Matcher.o:../gpuFDCM/Fdcm_Matcher.cu 
    $(EXEC) $(NVCC) $(INCLUDES) -DUSE_CUDA -I../include -I../gpuFDCM -I../gpuFDCM/include -I../gpuFDCM/FitLine $(ALL_CCFLAGS) $(GENCODE_FLAGS) -o [email protected] -c $< 

cv_utils.o:../gpuFDCM/cv_utils.cu 
    $(EXEC) $(NVCC) $(INCLUDES) -DUSE_CUDA -I../include -I../gpuFDCM -I../gpuFDCM/include -I../gpuFDCM/FitLine $(ALL_CCFLAGS) $(GENCODE_FLAGS) -o [email protected] -c $< 

Common.o:../gpuFDCM/src/Common.cu 
    $(EXEC) $(NVCC) $(INCLUDES) -DUSE_CUDA -I../include -I../gpuFDCM -I../gpuFDCM/include -I../gpuFDCM/FitLine $(ALL_CCFLAGS) $(GENCODE_FLAGS) -o [email protected] -c $< 

compDT.o:../gpuFDCM/src/compDT.cu 
    $(EXEC) $(NVCC) $(INCLUDES) -DUSE_CUDA -I../include -I../gpuFDCM -I../gpuFDCM/include -I../gpuFDCM/FitLine $(ALL_CCFLAGS) $(GENCODE_FLAGS) -o [email protected] -c $< 

constructDIntegrals.o:../gpuFDCM/src/constructDIntegrals.cu 
    $(EXEC) $(NVCC) $(INCLUDES) -DUSE_CUDA -I../include -I../gpuFDCM -I../gpuFDCM/include -I../gpuFDCM/FitLine $(ALL_CCFLAGS) $(GENCODE_FLAGS) -o [email protected] -c $< 

constructDirectionImage.o:../gpuFDCM/src/constructDirectionImage.cu 
    $(EXEC) $(NVCC) $(INCLUDES) -DUSE_CUDA -I../include -I../gpuFDCM -I../gpuFDCM/include -I../gpuFDCM/FitLine $(ALL_CCFLAGS) $(GENCODE_FLAGS) -o [email protected] -c $< 

detectBruteForce.o:../gpuFDCM/src/detectBruteForce.cu 
    $(EXEC) $(NVCC) $(INCLUDES) -DUSE_CUDA -I../include -I../gpuFDCM -I../gpuFDCM/include -I../gpuFDCM/FitLine $(ALL_CCFLAGS) $(GENCODE_FLAGS) -o [email protected] -c $< 

Line.o:../gpuFDCM/src/Line.cu 
    $(EXEC) $(NVCC) $(INCLUDES) -DUSE_CUDA -I../include -I../gpuFDCM -I../gpuFDCM/include -I../gpuFDCM/FitLine $(ALL_CCFLAGS) $(GENCODE_FLAGS) -o [email protected] -c $< 

LineMatcherParams.o:../gpuFDCM/src/LineMatcherParams.cu 
    $(EXEC) $(NVCC) $(INCLUDES) -DUSE_CUDA -I../include -I../gpuFDCM -I../gpuFDCM/include -I../gpuFDCM/FitLine $(ALL_CCFLAGS) $(GENCODE_FLAGS) -o [email protected] -c $< 

LMNonMaximumSuppression.o:../gpuFDCM/src/LMNonMaximumSuppression.cu 
    $(EXEC) $(NVCC) $(INCLUDES) -DUSE_CUDA -I../include -I../gpuFDCM -I../gpuFDCM/include -I../gpuFDCM/FitLine $(ALL_CCFLAGS) $(GENCODE_FLAGS) -o [email protected] -c $< 

SingleShapeDetectionWithVaryingQuerySize.o:../gpuFDCM/src/SingleShapeDetectionWithVaryingQuerySize.cu 
    $(EXEC) $(NVCC) $(INCLUDES) -DUSE_CUDA -I../include -I../gpuFDCM -I../gpuFDCM/include -I../gpuFDCM/FitLine $(ALL_CCFLAGS) $(GENCODE_FLAGS) -o [email protected] -c $< 

updateCosts.o:../gpuFDCM/src/updateCosts.cu 
    $(EXEC) $(NVCC) $(INCLUDES) -DUSE_CUDA -I../include -I../gpuFDCM -I../gpuFDCM/include -I../gpuFDCM/FitLine $(ALL_CCFLAGS) $(GENCODE_FLAGS) -o [email protected] -c $< 

LFLineFitter.o:../gpuFDCM/FitLine/LFLineFitter.cu 
    $(EXEC) $(NVCC) $(INCLUDES) -DUSE_CUDA -I../include -I../gpuFDCM -I../gpuFDCM/include -I../gpuFDCM/FitLine $(ALL_CCFLAGS) $(GENCODE_FLAGS) -o [email protected] -c $< 

#cppIntegration_gold.o:cppIntegration_gold.cpp 
# $(EXEC) $(NVCC) $(INCLUDES) $(ALL_CCFLAGS) $(GENCODE_FLAGS) -o [email protected] -c $< 
# 
#main.o:main.cpp 
# $(EXEC) $(NVCC) $(INCLUDES) $(ALL_CCFLAGS) $(GENCODE_FLAGS) -o [email protected] -c $< 

gpuFDCM: ConvertBase64.o cv_utils.o detectBruteForce.o Fdcm_Matcher.o FileNameUtils.o FileUtils.o fstream.o LFLineFitter.o LineMatcherParams.o Line.o LMNonMaximumSuppression.o main.o Matrixd.o Quat.o RefCounted.o SingleShapeDetectionWithVaryingQuerySize.o Timer.o tinystr.o tinyxmlerror.o tinyxml.o tinyxmlparser.o updateCosts.o -lopencv_core -lpthread 
    $(EXEC) $(NVCC) $(ALL_LDFLAGS) $(GENCODE_FLAGS) -o [email protected] $+ $(LIBRARIES) 
    $(EXEC) mkdir -p ../../bin/$(OS_ARCH)/$(OSLOWER)/$(TARGET)$(if $(abi),/$(abi)) 
    $(EXEC) cp [email protected] ../../bin/$(OS_ARCH)/$(OSLOWER)/$(TARGET)$(if $(abi),/$(abi)) 

run: build 
    $(EXEC) ./gpuFDCM 

clean: 
    rm -f gpuFDCM ConvertBase64.o cv_utils.o detectBruteForce.o Fdcm_Matcher.o FileNameUtils.o FileUtils.o fstream.o LFLineFitter.o LineMatcherParams.o Line.o LMNonMaximumSuppression.o main.o Matrixd.o Quat.o RefCounted.o SingleShapeDetectionWithVaryingQuerySize.o Timer.o tinystr.o tinyxmlerror.o tinyxml.o tinyxmlparser.o updateCosts.o 
    rm -rf ../../bin/$(OS_ARCH)/$(OSLOWER)/$(TARGET)$(if $(abi),/$(abi))/gpuFDCM 

clobber: clean 

答えて

1

allのための標的はbuild用ターゲットはgpuFDCMで、buildあります。ターゲットgpuFDCMは、Matrixf.oCommon.oまたはcompDT.oのビルドには言及していません。

スニペット:

Matrixf.o:../src/vfcore/Matrixf.cpp 
    $(EXEC) $(NVCC) $(INCLUDES) -I../include -I../gpuFDCM -I../gpuFDCM/include $(ALL_CCFLAGS) $(GENCODE_FLAGS) -o [email protected] -c $< 

Common.o:../gpuFDCM/src/Common.cu 
    $(EXEC) $(NVCC) $(INCLUDES) -DUSE_CUDA -I../include -I../gpuFDCM -I../gpuFDCM/include -I../gpuFDCM/FitLine $(ALL_CCFLAGS) $(GENCODE_FLAGS) -o [email protected] -c $< 

compDT.o:../gpuFDCM/src/compDT.cu 
    $(EXEC) $(NVCC) $(INCLUDES) -DUSE_CUDA -I../include -I../gpuFDCM -I../gpuFDCM/include -I../gpuFDCM/FitLine $(ALL_CCFLAGS) $(GENCODE_FLAGS) -o [email protected] -c $< 

それともgpuFDCMにターゲットを追加します:

あなたはこのファイルを構築したい場合、あなたは彼らが自分の目標を持っているように、明示的にそれらを指定する必要が

all: build 
build: gpuFDCM 
# no Matrixf.o, Common.o, compDT.o in here.... 
gpuFDCM: ConvertBase64.o cv_utils.o detectBruteForce.o Fdcm_Matcher.o FileNameUtils.o FileUtils.o fstream.o LFLineFitter.o LineMatcherParams.o Line.o LMNonMaximumSuppression.o main.o Matrixd.o Quat.o RefCounted.o SingleShapeDetectionWithVaryingQuerySize.o Timer.o tinystr.o tinyxmlerror.o tinyxml.o tinyxmlparser.o updateCosts.o -lopencv_core -lpthread 
    $(EXEC) $(NVCC) $(ALL_LDFLAGS) $(GENCODE_FLAGS) -o [email protected] $+ $(LIBRARIES) 
    $(EXEC) mkdir -p ../../bin/$(OS_ARCH)/$(OSLOWER)/$(TARGET)$(if $(abi),/$(abi)) 
    $(EXEC) cp [email protected] ../../bin/$(OS_ARCH)/$(OSLOWER)/$(TARGET)$(if $(abi),/$(abi)) 

gpuFDCM: Matrixf.o Common.o compDT.o ConvertBase64.o .... 
#  ^^^^^^^^^ ^^^^^^^^ ^^^^^^^^ 

(サイドノート:私はあなたが年齢が高いのを除いてMatrixfを使用することはお勧めしませんardware。 Matrixfはフロート用、Matrixdはダブル用です。最近では浮動行列を使う理由はあまりありません...)

+0

それです。それを逃したのは私の愚かなことでした。それを指摘してくれてありがとう。Matrixfに関しては、はい、あなたは正しいです。私はそれを取り除くでしょう。 – sha

関連する問題