47
47
48
48
# setup opencv
49
49
ifeq ($(USE_OPENCV ) , 1)
50
- CFLAGS += -DMXNET_USE_OPENCV=1 ` pkg-config --cflags opencv`
51
- LDFLAGS += ` pkg-config --libs opencv`
50
+ CFLAGS += -DMXNET_USE_OPENCV=1 $(shell pkg-config --cflags opencv)
51
+ LDFLAGS += $(shell pkg-config --libs opencv)
52
52
BIN += bin/im2rec
53
53
else
54
54
CFLAGS+= -DMXNET_USE_OPENCV=0
@@ -183,15 +183,15 @@ build/src/%.o: src/%.cc
183
183
184
184
build/src/% _gpu.o : src/% .cu
185
185
@mkdir -p $(@D )
186
- $(NVCC ) $(NVCCFLAGS ) -Xcompiler " $( CFLAGS) " -M -MT build/src/$* _gpu.o $< > build/src/$* _gpu.d
187
- $(NVCC ) -c -o $@ $(NVCCFLAGS ) -Xcompiler " $( CFLAGS) " $<
186
+ $(NVCC ) $(NVCCFLAGS ) $( CUDA_ARCH ) -Xcompiler " $( CFLAGS) " -M -MT build/src/$* _gpu.o $< > build/src/$* _gpu.d
187
+ $(NVCC ) -c -o $@ $(NVCCFLAGS ) $( CUDA_ARCH ) -Xcompiler " $( CFLAGS) " $<
188
188
189
189
# A nvcc bug cause it to generate "generic/xxx.h" dependencies from torch headers.
190
190
# Use CXX to generate dependency instead.
191
191
build/plugin/% _gpu.o : plugin/% .cu
192
192
@mkdir -p $(@D )
193
193
$(CXX ) -std=c++11 $(CFLAGS ) -MM -MT build/plugin/$* _gpu.o $< > build/plugin/$* _gpu.d
194
- $(NVCC ) -c -o $@ $(NVCCFLAGS ) -Xcompiler " $( CFLAGS) " $<
194
+ $(NVCC ) -c -o $@ $(NVCCFLAGS ) $( CUDA_ARCH ) -Xcompiler " $( CFLAGS) " $<
195
195
196
196
build/plugin/% .o : plugin/% .cc
197
197
@mkdir -p $(@D )
@@ -200,8 +200,8 @@ build/plugin/%.o: plugin/%.cc
200
200
201
201
% _gpu.o : % .cu
202
202
@mkdir -p $(@D )
203
- $(NVCC ) $(NVCCFLAGS ) -Xcompiler " $( CFLAGS) -Isrc/operator" -M -MT $* _gpu.o $< > $* _gpu.d
204
- $(NVCC ) -c -o $@ $(NVCCFLAGS ) -Xcompiler " $( CFLAGS) -Isrc/operator" $<
203
+ $(NVCC ) $(NVCCFLAGS ) $( CUDA_ARCH ) -Xcompiler " $( CFLAGS) -Isrc/operator" -M -MT $* _gpu.o $< > $* _gpu.d
204
+ $(NVCC ) -c -o $@ $(NVCCFLAGS ) $( CUDA_ARCH ) -Xcompiler " $( CFLAGS) -Isrc/operator" $<
205
205
206
206
% .o : % .cc
207
207
@mkdir -p $(@D )
0 commit comments