diff --git a/ci/docker/runtime_functions.sh b/ci/docker/runtime_functions.sh index 3701597fe974..8752856177ea 100755 --- a/ci/docker/runtime_functions.sh +++ b/ci/docker/runtime_functions.sh @@ -58,58 +58,6 @@ EOF fi } -build_ccache_wrappers() { - set -ex - - if [ -z ${CC+x} ]; then - echo "No \$CC set, defaulting to gcc"; - export CC=gcc - fi - if [ -z ${CXX+x} ]; then - echo "No \$CXX set, defaulting to g++"; - export CXX=g++ - fi - - # Recommended by CCache: https://ccache.samba.org/manual.html#_run_modes - # Add to the beginning of path to ensure this redirection is picked up instead - # of the original ones. Especially CUDA/NVCC appends itself to the beginning of the - # path and thus this redirect is ignored. This change fixes this problem - # This hacky approach with symbolic links is required because underlying build - # systems of our submodules ignore our CMake settings. If they use Makefile, - # we can't influence them at all in general and NVCC also prefers to hardcode their - # compiler instead of respecting the settings. Thus, we take this brutal approach - # and just redirect everything of this installer has been called. - # In future, we could do these links during image build time of the container. - # But in the beginning, we'll make this opt-in. In future, loads of processes like - # the scala make step or numpy compilation and other pip package generations - # could be heavily sped up by using ccache as well. - mkdir -p /tmp/ccache-redirects - export PATH=/tmp/ccache-redirects:$PATH - CCACHE=`which ccache` - ln -sf $CCACHE /tmp/ccache-redirects/gcc - ln -sf $CCACHE /tmp/ccache-redirects/gcc-8 - ln -sf $CCACHE /tmp/ccache-redirects/g++ - ln -sf $CCACHE /tmp/ccache-redirects/g++-8 - ln -sf $CCACHE /tmp/ccache-redirects/clang++-3.9 - ln -sf $CCACHE /tmp/ccache-redirects/clang-3.9 - ln -sf $CCACHE /tmp/ccache-redirects/clang++-5.0 - ln -sf $CCACHE /tmp/ccache-redirects/clang-5.0 - ln -sf $CCACHE /tmp/ccache-redirects/clang++-6.0 - ln -sf $CCACHE /tmp/ccache-redirects/clang-6.0 - ln -sf $CCACHE /tmp/ccache-redirects/clang++-10 - ln -sf $CCACHE /tmp/ccache-redirects/clang-10 - #Doesn't work: https://github.com/ccache/ccache/issues/373 - # ln -sf $CCACHE /tmp/ccache-redirects/nvcc - # ln -sf $CCACHE /tmp/ccache-redirects/nvcc - # export NVCC="/tmp/ccache-redirects/nvcc" - - # Uncomment if you would like to debug CCache hit rates. - # You can monitor using tail -f ccache-log - #export CCACHE_LOGFILE=/work/mxnet/ccache-log - #export CCACHE_LOGFILE=/tmp/ccache-log - #export CCACHE_DEBUG=1 -} - build_wheel() { set -ex @@ -787,9 +735,24 @@ build_ubuntu_blc() { # Testing sanity_check() { + set -ex + sanity_license + sanity_python + sanity_cpp +} + +sanity_license() { set -ex tools/license_header.py check +} + +sanity_python() { + set -ex 3rdparty/dmlc-core/scripts/lint.py mxnet cpp include src plugin tests --exclude_path src/operator/contrib/ctc_include include/mkldnn +} + +sanity_cpp() { + set -ex python3 -m pylint --rcfile=ci/other/pylintrc --ignore-patterns=".*\.so$$,.*\.dll$$,.*\.dylib$$" python/mxnet OMP_NUM_THREADS=$(expr $(nproc) / 4) pytest -n 4 tests/tutorials/test_sanity_tutorials.py }