「Nsight Eclipse Edition」で作成されたプロジェクトがあります。Nsight エディタからデバッグを実行すると、うまく動作します。つまり、選択した少数のファイルのみが変更されている場合、Nsight は「プロジェクトの構成デバッグのインクリメンタル ビルド」を実行します。しかし、コマンド "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」を実行することです。誰でも私を助けることができますか?コマンドラインからでもインクリメンタル ビルドを取得するには、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 ' '