forked from apache/mxnet
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master' into dmlc-sparse-squash
- Loading branch information
Showing
9 changed files
with
107 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
tests/nightly/compilation_warnings/compilation_warnings.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
|
||
runme() { | ||
cmd=$* | ||
echo "$cmd" | ||
$cmd | ||
ret=$? | ||
if [[ ${ret} != 0 ]]; then | ||
echo " " | ||
echo "ERROR: Return value non-zero for: $cmd" | ||
echo " " | ||
exit 1 | ||
fi | ||
} | ||
|
||
sudo add-apt-repository ppa:ubuntu-toolchain-r/test | ||
sudo apt-get update | ||
sudo apt-get -y install time g++-5 | ||
runme make clean >/dev/null | ||
runme mkdir build | ||
echo "Starting make" | ||
cp make/config.mk . | ||
sed -i -e 's/gcc/gcc-5/g' config.mk | ||
sed -i -e 's/g++/g++-5/g' config.mk | ||
runme /usr/bin/time -f "%e" make -j$(nproc) &> build/compile_output.txt | ||
cat build/compile_output.txt | ||
echo "Finished make. Now processing output" | ||
python tests/nightly/compilation_warnings/process_output.py build/compile_output.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import re | ||
import sys | ||
import operator | ||
|
||
def process_output(command_output): | ||
warnings = {} | ||
regex = r"(.*):\swarning:\s(.*)" | ||
lines = command_output.split("\n") | ||
for line in lines[:-2]: | ||
matches = re.finditer(regex, line) | ||
for matchNum, match in enumerate(matches): | ||
try: | ||
warnings[match.group()] +=1 | ||
except KeyError: | ||
warnings[match.group()] =1 | ||
time = lines[-2] | ||
return time, warnings | ||
|
||
def generate_stats(warnings): | ||
total_count = sum(warnings.values()) | ||
sorted_warnings = sorted(warnings.items(), key=operator.itemgetter(1), reverse=True) | ||
return sorted_warnings, total_count | ||
|
||
def print_summary(time, warnings): | ||
sorted_warnings, total_count = generate_stats(warnings) | ||
print "START - Compilation warnings count" | ||
print total_count | ||
print "END - Compilation warnings count" | ||
print 'START - Compilation warnings summary' | ||
print 'Time taken to compile:', time, 's' | ||
print 'Total number of warnings:', total_count, '\n' | ||
print 'Below is the list of unique warnings and the number of occurrences of that warning' | ||
for warning, count in sorted_warnings: | ||
print count, ': ', warning | ||
print 'END - Compilation warnings summary' | ||
|
||
c_output = open(sys.argv[1],'r') | ||
time, warnings = process_output(c_output.read()) | ||
print_summary(time, warnings) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters