Skip to content

Commit c3c2171

Browse files
howard0supiiswrong
authored andcommitted
Enable warning as error (apache#4451)
* Engineering system enhencement Enable warning as error Enable Profiler code into build Speed up build a bit * Fix warning in scala package
1 parent 342b2d9 commit c3c2171

File tree

4 files changed

+14
-15
lines changed

4 files changed

+14
-15
lines changed

Makefile

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,7 @@ endif
200200

201201
build/src/%.o: src/%.cc
202202
@mkdir -p $(@D)
203-
$(CXX) -std=c++11 $(CFLAGS) -MM -MT build/src/$*.o $< >build/src/$*.d
204-
$(CXX) -std=c++11 -c $(CFLAGS) -c $< -o $@
203+
$(CXX) -std=c++11 -c $(CFLAGS) -MMD -c $< -o $@
205204

206205
build/src/%_gpu.o: src/%.cu
207206
@mkdir -p $(@D)
@@ -217,8 +216,7 @@ build/plugin/%_gpu.o: plugin/%.cu
217216

218217
build/plugin/%.o: plugin/%.cc
219218
@mkdir -p $(@D)
220-
$(CXX) -std=c++11 $(CFLAGS) -MM -MT build/plugin/$*.o $< >build/plugin/$*.d
221-
$(CXX) -std=c++11 -c $(CFLAGS) -c $< -o $@
219+
$(CXX) -std=c++11 -c $(CFLAGS) -MMD -c $< -o $@
222220

223221
%_gpu.o: %.cu
224222
@mkdir -p $(@D)
@@ -227,8 +225,7 @@ build/plugin/%.o: plugin/%.cc
227225

228226
%.o: %.cc
229227
@mkdir -p $(@D)
230-
$(CXX) -std=c++11 $(CFLAGS) -Isrc/operator -MM -MT $*.o $< >$*.d
231-
$(CXX) -std=c++11 -c $(CFLAGS) -Isrc/operator -c $< -o $@
228+
$(CXX) -std=c++11 -c $(CFLAGS) -MMD -Isrc/operator -c $< -o $@
232229

233230
# NOTE: to statically link libmxnet.a we need the option
234231
# --Wl,--whole-archive -lmxnet --Wl,--no-whole-archive

appveyor.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@ before_build:
5252
5353
set OpenCV_DIR=%APPVEYOR_BUILD_FOLDER%/%MXNET_OPENCV_DIR%/build
5454
55-
cmake .. -DOPENCV_DIR=%OpenCV_DIR% -DUSE_CUDA=0 -DUSE_CUDNN=0 -DUSE_NVRTC=0 -DUSE_OPENCV=1 -DUSE_OPENMP=1 -DUSE_BLAS=open -DUSE_DIST_KVSTORE=0 -G "Visual Studio 12 2013 Win64"
55+
cmake .. -DOPENCV_DIR=%OpenCV_DIR% -DUSE_PROFILER=1 -DUSE_CUDA=0 -DUSE_CUDNN=0 -DUSE_NVRTC=0 -DUSE_OPENCV=1 -DUSE_OPENMP=1 -DUSE_BLAS=open -DUSE_DIST_KVSTORE=0 -G "Visual Studio 12 2013 Win64"
5656
5757
build_script:
5858
- cmd: >-
59-
msbuild mxnet.sln /t:Rebuild /p:Configuration=Release;Platform=x64
59+
msbuild mxnet.sln /t:Rebuild /p:Configuration=Release;Platform=x64 /m
6060
6161
test_script:
6262
- cmd: >-

scala-package/native/src/main/native/ml_dmlc_mxnet_native_c_api.cc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ JNIEXPORT jint JNICALL Java_ml_dmlc_mxnet_LibInfo_mxImperativeInvoke
223223
jclass listClass = env->FindClass("scala/collection/mutable/ArrayBuffer");
224224
jmethodID listAppend = env->GetMethodID(listClass, "$plus$eq",
225225
"(Ljava/lang/Object;)Lscala/collection/mutable/ArrayBuffer;");
226-
for (size_t i = 0; i < numOutputs; ++i) {
226+
for (int i = 0; i < numOutputs; ++i) {
227227
env->CallObjectMethod(outputs, listAppend,
228228
env->NewObject(longCls, longConst,
229229
reinterpret_cast<uint64_t>(cOutputs[i])));
@@ -1328,7 +1328,7 @@ JNIEXPORT jint JNICALL Java_ml_dmlc_mxnet_LibInfo_mxSymbolInferType
13281328

13291329
// release allocated memory
13301330
if (jkeys != NULL) {
1331-
for (size_t i = 0; i < numArgs; i++) {
1331+
for (int i = 0; i < numArgs; i++) {
13321332
jstring jkey = reinterpret_cast<jstring>(env->GetObjectArrayElement(jkeys, i));
13331333
env->ReleaseStringUTFChars(jkey, keys[i]);
13341334
env->DeleteLocalRef(jkey);
@@ -1397,7 +1397,7 @@ JNIEXPORT jint JNICALL Java_ml_dmlc_mxnet_LibInfo_mxSymbolInferShape
13971397
const char **keys = NULL;
13981398
if (jkeys != NULL) {
13991399
keys = new const char *[jnumArgs];
1400-
for (size_t i = 0; i < jnumArgs; i++) {
1400+
for (int i = 0; i < jnumArgs; i++) {
14011401
jstring jkey = (jstring) env->GetObjectArrayElement(jkeys, i);
14021402
const char *key = env->GetStringUTFChars(jkey, 0);
14031403
keys[i] = key;
@@ -1667,15 +1667,15 @@ JNIEXPORT jint JNICALL Java_ml_dmlc_mxnet_LibInfo_mxRtcCreate
16671667
char *name = const_cast<char *>(env->GetStringUTFChars(jname, 0));
16681668
int num_input = env->GetArrayLength(jinputNames);
16691669
char **inputNames = new char *[num_input];
1670-
for (size_t i = 0; i < num_input; i++) {
1670+
for (int i = 0; i < num_input; i++) {
16711671
jstring jinname = reinterpret_cast<jstring>(env->GetObjectArrayElement(jinputNames, i));
16721672
char *inname = const_cast<char *>(env->GetStringUTFChars(jinname, 0));
16731673
inputNames[i] = inname;
16741674
env->DeleteLocalRef(jinname);
16751675
}
16761676
int num_output = env->GetArrayLength(joutputNames);
16771677
char **outputNames = new char *[num_output];
1678-
for (size_t i = 0; i < num_output; i++) {
1678+
for (int i = 0; i < num_output; i++) {
16791679
jstring joutname = reinterpret_cast<jstring>(env->GetObjectArrayElement(joutputNames, i));
16801680
char *outname = const_cast<char *>(env->GetStringUTFChars(joutname, 0));
16811681
outputNames[i] = outname;
@@ -1700,13 +1700,13 @@ JNIEXPORT jint JNICALL Java_ml_dmlc_mxnet_LibInfo_mxRtcCreate
17001700
env->ReleaseStringUTFChars(jkernel, kernel);
17011701
env->ReleaseLongArrayElements(jinputs, inputs, 0);
17021702
env->ReleaseLongArrayElements(joutputs, outputs, 0);
1703-
for (size_t i = 0; i < num_input; i++) {
1703+
for (int i = 0; i < num_input; i++) {
17041704
jstring jinname = reinterpret_cast<jstring>(env->GetObjectArrayElement(jinputNames, i));
17051705
env->ReleaseStringUTFChars(jinname, inputNames[i]);
17061706
env->DeleteLocalRef(jinname);
17071707
}
17081708
delete[] inputNames;
1709-
for (size_t i = 0; i < num_output; i++) {
1709+
for (int i = 0; i < num_output; i++) {
17101710
jstring joutname = reinterpret_cast<jstring>(env->GetObjectArrayElement(joutputNames, i));
17111711
env->ReleaseStringUTFChars(joutname, outputNames[i]);
17121712
env->DeleteLocalRef(joutname);

tests/jenkins/run_test.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ cp make/config.mk .
33
echo "USE_CUDA=1" >> config.mk
44
echo "USE_CUDA_PATH=/usr/local/cuda" >> config.mk
55
echo "USE_CUDNN=1" >> config.mk
6+
echo "USE_PROFILER=1" >> config.mk
7+
echo "DEV=1" >> config.mk
68
make -j$(nproc) || exit -1
79

810
echo "BUILD lint"

0 commit comments

Comments
 (0)