我在" Nsight Eclipse Edition"中创建了一个项目。当我从Nsight编辑器运行Debug时,它工作得很好,即如果只选择了几个文件被修改,则Nsight执行 - " Incremental Build of configuration Debug for project"。 但是如果我使用命令" make"从./Debug文件夹中的commandLine运行相同的项目 - 它总是返回相同的输出
〜/ cuda-workspace / MyProject / Debug $ make make:`src / core_system / math / Gimplex / simplex.o'是最新的。
- 如果我从文件夹中删除文件simplex.o并执行" make"然后,Nsight只构建了simplex.cu文件,尽管MyProject中还有其他修改过的文件。
我当前效率低下的解决方案是我做一个" make clean"然后" make"。 有谁能够帮我?即使从commandLine,我应该怎么做才能转换我的makefile以获得增量构建? ---下面附上我的makefile和.mk文件
my file-- "makefile" ################################################################################
# Automatically-generated file. Do not edit!
################################################################################
-include ../makefile.init
RM := rm -rf
# All of the sources participating in the build are defined here
-include sources.mk
-include subdir.mk
-include src/core_system/symbolic_states/subdir.mk
-include src/core_system/math/subdir.mk
-include src/core_system/math/Gimplex/subdir.mk
-include src/application/subdir.mk
--- missing include code -----
-include objects.mk
ifneq ($(MAKECMDGOALS),clean)
ifneq ($(strip $(CU_DEPS)),)
-include $(CU_DEPS)
endif
ifneq ($(strip $(C++_DEPS)),)
-include $(C++_DEPS)
endif
ifneq ($(strip $(C_DEPS)),)
-include $(C_DEPS)
endif
ifneq ($(strip $(CC_DEPS)),)
-include $(CC_DEPS)
endif
ifneq ($(strip $(CPP_DEPS)),)
-include $(CPP_DEPS)
endif
ifneq ($(strip $(CXX_DEPS)),)
-include $(CXX_DEPS)
endif
ifneq ($(strip $(C_UPPER_DEPS)),)
-include $(C_UPPER_DEPS)
endif
endif
-include ../makefile.defs
# Add inputs and outputs from these tool invocations to the build variables
# All Target
all: MyProject
# Tool invocations
MyProject: $(OBJS) $(USER_OBJS)
@echo 'Building target: $@'
@echo 'Invoking: NVCC Linker'
/usr/local/cuda-6.5/bin/nvcc --cudart static -L/usr/local/lib --relocatable-device-code=false -gencode arch=compute_11,code=compute_11 -gencode arch=compute_12,code=compute_12 -gencode arch=compute_11,code=sm_11 -gencode arch=compute_12,code=sm_12 -link -o "MyProject" $(OBJS) $(USER_OBJS) $(LIBS)
@echo 'Finished building target: $@'
@echo ' '
# Other Targets
clean:
-$(RM) $(CU_DEPS)$(OBJS)$(C++_DEPS)$(C_DEPS)$(CC_DEPS)$(CPP_DEPS)$(EXECUTABLES)$(CXX_DEPS)$(C_UPPER_DEPS) MyProject
-@echo ' '
.PHONY: all clean dependents
.SECONDARY:
-include ../makefile.targets
my file-- "sources.mk"
################################################################################
# Automatically-generated file. Do not edit!
################################################################################
O_SRCS :=
CPP_SRCS :=
C_UPPER_SRCS :=
C_SRCS :=
S_UPPER_SRCS :=
OBJ_SRCS :=
CU_SRCS :=
ASM_SRCS :=
CXX_SRCS :=
C++_SRCS :=
CC_SRCS :=
CU_DEPS :=
OBJS :=
C++_DEPS :=
C_DEPS :=
CC_DEPS :=
CPP_DEPS :=
EXECUTABLES :=
CXX_DEPS :=
C_UPPER_DEPS :=
# Every subdirectory with source files must be described here
SUBDIRS := \
src/core_system/symbolic_states \
src/core_system/math \
src/core_system/math/Gimplex \
--some more missing lines ----
Appending for sample two subdir.mk file from different folder
1) my file --"Debug/src/core_system/symbolic_states/subdir.mk"
################################################################################
# Automatically-generated file. Do not edit!
################################################################################
# Add inputs and outputs from these tool invocations to the build variables
CPP_SRCS += \
../src/core_system/symbolic_states/symbolic_states.cpp
OBJS += \
./src/core_system/symbolic_states/symbolic_states.o
CPP_DEPS += \
./src/core_system/symbolic_states/symbolic_states.d
# Each subdirectory must supply rules for building sources it contributes
src/core_system/symbolic_states/%.o: ../src/core_system/symbolic_states/%.cpp
@echo 'Building file: $<'
@echo 'Invoking: NVCC Compiler'
/usr/local/cuda-6.5/bin/nvcc -I"/home/amit/cuda-workspace/MyProject/src" -I/usr/local/include -G -g -O3 -Xcompiler -fopenmp -gencode arch=compute_11,code=sm_11 -gencode arch=compute_12,code=sm_12 -odir "src/core_system/symbolic_states" -M -o "$(@:%.o=%.d)" "$<"
/usr/local/cuda-6.5/bin/nvcc -I"/home/amit/cuda-workspace/MyProject/src" -I/usr/local/include -G -g -O3 -Xcompiler -fopenmp --compile -x c++ -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '
2) my file --"Debug/src/core_system/math/Gimplex/subdir.mk"
################################################################################
# Automatically-generated file. Do not edit!
################################################################################
# Add inputs and outputs from these tool invocations to the build variables
CU_SRCS += \
../src/core_system/math/Gimplex/simplex.cu
CU_DEPS += \
./src/core_system/math/Gimplex/simplex.d
OBJS += \
./src/core_system/math/Gimplex/simplex.o
# Each subdirectory must supply rules for building sources it contributes
src/core_system/math/Gimplex/%.o: ../src/core_system/math/Gimplex/%.cu
@echo 'Building file: $<'
@echo 'Invoking: NVCC Compiler'
/usr/local/cuda-6.5/bin/nvcc -I"/home/amit/cuda-workspace/MyProject/src" -I/opt/gurobi600/linux64/include -I/usr/local/include -G -g -O3 -Xcompiler -fopenmp -gencode arch=compute_11,code=sm_11 -gencode arch=compute_12,code=sm_12 -odir "src/core_system/math/Gimplex" -M -o "$(@:%.o=%.d)" "$<"
/usr/local/cuda-6.5/bin/nvcc -I"/home/amit/cuda-workspace/MyProject/src" -I/opt/gurobi600/linux64/include -I/usr/local/include -G -g -O3 -Xcompiler -fopenmp --compile --relocatable-device-code=false -gencode arch=compute_11,code=compute_11 -gencode arch=compute_12,code=compute_12 -gencode arch=compute_11,code=sm_11 -gencode arch=compute_12,code=sm_12 -x cu -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '