Skip to content

Commit 82f53b7

Browse files
howard0supiiswrong
authored andcommitted
Introduce a developer mode option in Makefile (apache#4364)
this option will enable two addtionals for now: 1. Create symbol even for optimized build 2. Enforce warning as error while I am here, clean up all warnings so that I can get a clean build in developer mode.
1 parent 6f95b74 commit 82f53b7

File tree

6 files changed

+13
-3
lines changed

6 files changed

+13
-3
lines changed

Makefile

+4
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ include $(DMLC_CORE)/make/dmlc.mk
3131
WARNFLAGS= -Wall
3232
CFLAGS = -DMSHADOW_FORCE_STREAM $(WARNFLAGS)
3333

34+
ifeq ($(DEV), 1)
35+
CFLAGS += -g -Werror
36+
endif
37+
3438
# CFLAGS for debug
3539
ifeq ($(DEBUG), 1)
3640
CFLAGS += -g -O0 -DDMLC_LOG_FATAL_THROW=0

make/config.mk

+3
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ export CC = gcc
2424
export CXX = g++
2525
export NVCC = nvcc
2626

27+
# whether compile with options for MXNet developer
28+
DEV = 0
29+
2730
# whether compile with debug
2831
DEBUG = 0
2932

make/osx.mk

+3
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ export CC = gcc
2424
export CXX = g++
2525
export NVCC = nvcc
2626

27+
# whether compile with options for MXNet developer
28+
DEV = 0
29+
2730
# whether compile with debug
2831
DEBUG = 0
2932

src/operator/pad-inl.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ class PadProp : public OperatorProperty {
163163
const TShape &dshape = (*in_shape)[pad_enum::kData];
164164
if (dshape.ndim() == 0) return false;
165165
TShape oshape = dshape;
166-
for (int i = 0; i < dshape.ndim(); ++i) {
166+
for (size_t i = 0; i < dshape.ndim(); ++i) {
167167
oshape[i] =
168168
param_.pad_width[2 * i] + param_.pad_width[2 * i + 1] + dshape[i];
169169
}

src/operator/tensor/elemwise_sum.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ std::vector<nnvm::NodeEntry> ElementWiseSumGrad(
2727
CHECK_EQ(ograds.size(), 1);
2828
std::vector<nnvm::NodeEntry> ret;
2929
nnvm::NodeEntry n_out{n, 0, 0};
30-
for (auto& h : n->inputs) {
30+
for (size_t i = 0; i < n->inputs.size(); i++) {
3131
nnvm::NodePtr id_node = nnvm::Node::Create();
3232
id_node->attrs.op = copy_op;
3333
id_node->inputs = {ograds[0]};

src/operator/tensor/matrix_op-inl.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ inline bool ReshapeShape(const nnvm::NodeAttrs& attrs,
7474
dshape_vec.push_back(dshape[i]);
7575
}
7676
std::vector<int> tmp;
77-
int src_idx = 0;
77+
size_t src_idx = 0;
7878
int inf_idx = -1;
7979
size_t new_size = dshape.Size();
8080
if (param_.reverse) {

0 commit comments

Comments
 (0)