Skip to content
This repository was archived by the owner on Nov 17, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion 3rdparty/mshadow/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,16 @@ target_include_directories(mshadow INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}")
target_sources(mshadow INTERFACE ${MSHADOWSOURCE})
if(UNIX)
target_compile_options(mshadow INTERFACE
"$<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CXX_COMPILER_ID:Clang>>:-Wno-braced-scalar-init>"
"$<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CXX_COMPILER_ID:Clang>>:-Wno-pass-failed>"
# TODO Replace Wno-unused-lambda-capture with [[maybe_unused]] annotation once requiring C++17
"$<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CXX_COMPILER_ID:Clang>>:-Wno-unused-lambda-capture>"
# TODO Fixing the warning leads to compile error on 4.8; fix once 4.8 support is dropped
"$<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CXX_COMPILER_ID:Clang>>:-Wno-undefined-var-template>"
"$<$<COMPILE_LANGUAGE:CXX>:-Wno-unused-parameter>"
"$<$<COMPILE_LANGUAGE:CXX>:-Wno-unknown-pragmas>"
"$<$<COMPILE_LANGUAGE:CXX>:-Wno-unused-local-typedefs>")
"$<$<COMPILE_LANGUAGE:CXX>:-Wno-unused-local-typedefs>"
"$<$<COMPILE_LANGUAGE:CUDA>:--expt-relaxed-constexpr>")
endif()

if(USE_CUDA)
Expand Down
5 changes: 1 addition & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,7 @@ else()
endif()
check_cxx_compiler_flag("-std=c++11" SUPPORT_CXX11)
check_cxx_compiler_flag("-std=c++0x" SUPPORT_CXX0X)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wno-unknown-pragmas -Wno-sign-compare")
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES ".*Clang$")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-braced-scalar-init")
endif()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wno-sign-compare")
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0 -g")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_GLIBCXX_ASSERTIONS")
Expand Down
3 changes: 3 additions & 0 deletions ci/docker/Dockerfile.build.ubuntu_gpu_cu100
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ ENV CUDNN_VERSION=7.6.5.32
COPY install/ubuntu_cudnn.sh /work/
RUN /work/ubuntu_cudnn.sh

COPY install/ubuntu_binutils.sh /work/
RUN /work/ubuntu_binutils.sh

# Always last
ARG USER_ID=0
ARG GROUP_ID=0
Expand Down
3 changes: 3 additions & 0 deletions ci/docker/Dockerfile.build.ubuntu_gpu_cu101
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ ENV CUDNN_VERSION=7.6.5.32
COPY install/ubuntu_cudnn.sh /work/
RUN /work/ubuntu_cudnn.sh

COPY install/ubuntu_binutils.sh /work/
RUN /work/ubuntu_binutils.sh

# Always last
ARG USER_ID=0
ARG GROUP_ID=0
Expand Down
3 changes: 3 additions & 0 deletions ci/docker/Dockerfile.build.ubuntu_gpu_cu102
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ ENV CUDNN_VERSION=7.6.5.32
COPY install/ubuntu_cudnn.sh /work/
RUN /work/ubuntu_cudnn.sh

COPY install/ubuntu_binutils.sh /work/
RUN /work/ubuntu_binutils.sh

# Always last
ARG USER_ID=0
ARG GROUP_ID=0
Expand Down
3 changes: 3 additions & 0 deletions ci/docker/Dockerfile.build.ubuntu_gpu_cu80
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ RUN /work/ubuntu_docs.sh
COPY install/ubuntu_tutorials.sh /work/
RUN /work/ubuntu_tutorials.sh

COPY install/ubuntu_binutils.sh /work/
RUN /work/ubuntu_binutils.sh

ARG USER_ID=0
ARG GROUP_ID=0
COPY install/ubuntu_adduser.sh /work/
Expand Down
3 changes: 3 additions & 0 deletions ci/docker/Dockerfile.build.ubuntu_gpu_cu90
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ ENV CUDNN_VERSION=7.6.5.32
COPY install/ubuntu_cudnn.sh /work/
RUN /work/ubuntu_cudnn.sh

COPY install/ubuntu_binutils.sh /work/
RUN /work/ubuntu_binutils.sh

# Always last
ARG USER_ID=0
ARG GROUP_ID=0
Expand Down
3 changes: 3 additions & 0 deletions ci/docker/Dockerfile.build.ubuntu_gpu_cu92
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ ENV CUDNN_VERSION=7.6.5.32
COPY install/ubuntu_cudnn.sh /work/
RUN /work/ubuntu_cudnn.sh

COPY install/ubuntu_binutils.sh /work/
RUN /work/ubuntu_binutils.sh

ARG USER_ID=0
ARG GROUP_ID=0
COPY install/ubuntu_adduser.sh /work/
Expand Down
12 changes: 4 additions & 8 deletions ci/docker/install/ubuntu_binutils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,13 @@

set -ex

wget https://mirror.clarkson.edu/gnu/binutils/binutils-2.27.tar.gz

export DEBIAN_FRONTEND=noninteractive
apt-get update || true
apt-get update && \
apt-get install -y \
wget

mkdir /opt/binutils_install && mkdir /opt/binutils_install && mkdir /opt/binutils && cd /opt/binutils
cd /usr/local/src
wget -nv https://mirror.clarkson.edu/gnu/binutils/binutils-2.27.tar.gz
tar -xvf binutils-2.27.tar.gz && cd binutils-2.27
./configure --prefix=/opt/binutils_other --exec-prefix=/opt/binutils_install
tar -xvf binutils-2.27.tar.gz && rm binutils-2.27.tar.gz && cd binutils-2.27
./configure --prefix=/usr/local
make -j$(nproc)
make install
ls /opt/binutils_install/bin/ | xargs -I{} ln -s /opt/binutils_install/bin/{} /usr/local/bin/{}
10 changes: 6 additions & 4 deletions ci/docker/install/ubuntu_clang.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,18 @@

set -ex

apt-get update || true
# Install clang 3.9 (the same version as in XCode 8.*) and 6.0 (latest major release)
# Install clang 3.9 (the same version as in XCode 8.*) and 10 (latest major release)
wget -qO - http://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - && \
apt-add-repository "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-3.9 main" && \
apt-add-repository "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-6.0 main" && \
apt-add-repository "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-10 main" && \
apt-get update && \
apt-get install -y clang-3.9 clang-6.0 clang-tidy-6.0 && \
apt-get install -y clang-3.9 clang-6.0 clang-10 clang-tidy-6.0 && \
clang-3.9 --version && \
clang-6.0 --version
clang-6.0 --version && \
clang-10 --version

# TODO(leezu) switch to clang-tidy 10
# Use llvm's master version of run-clang-tidy.py. This version has mostly minor updates, but
# importantly will properly return a non-zero exit code when an error is reported in clang-tidy.
# Please remove the below if we install a clang version higher than 6.0.
Expand Down
66 changes: 55 additions & 11 deletions ci/docker/runtime_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ build_ccache_wrappers() {
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
Expand Down Expand Up @@ -506,9 +508,7 @@ build_ubuntu_cpu_cmake_asan() {
build_ubuntu_cpu_gcc8_werror() {
set -ex
cd /work/build
export CXX=g++-8
export CC=gcc-8
cmake \
CXX=g++-8 CC=gcc-8 cmake \
-DUSE_CUDA=OFF \
-DCMAKE_BUILD_TYPE="RelWithDebInfo" \
-DUSE_CPP_PACKAGE=ON \
Expand All @@ -517,6 +517,36 @@ build_ubuntu_cpu_gcc8_werror() {
ninja
}

build_ubuntu_cpu_clang10_werror() {
set -ex
cd /work/build
CXX=clang++-10 CC=clang-10 cmake \
-DUSE_CUDA=OFF \
-DCMAKE_BUILD_TYPE="RelWithDebInfo" \
-DUSE_CPP_PACKAGE=ON \
-DMXNET_USE_CPU=ON \
-GNinja /work/mxnet
ninja
}

build_ubuntu_gpu_clang10_werror() {
set -ex
cd /work/build
# Disable cpp package as OpWrapperGenerator.py dlopens libmxnet.so,
# requiring presence of cuda driver libraries that are missing on CI host
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/cuda-10.1/targets/x86_64-linux/lib/stubs
# Set CMAKE_AR and CMAKE_RANLIB due to Ubuntu 16.04 default binutils 4GB limitation
CXX=clang++-10 CC=clang-10 cmake \
-DCMAKE_AR=/usr/local/bin/ar \
-DCMAKE_RANLIB=/usr/local/bin/ranlib \
-DUSE_CUDA=ON \
-DMXNET_CUDA_ARCH="$CI_CMAKE_CUDA_ARCH" \
-DCMAKE_BUILD_TYPE="RelWithDebInfo" \
-DUSE_CPP_PACKAGE=OFF \
-GNinja /work/mxnet
ninja
}

build_ubuntu_cpu_clang39() {
set -ex
cd /work/build
Expand All @@ -531,10 +561,10 @@ build_ubuntu_cpu_clang39() {
ninja
}

build_ubuntu_cpu_clang60() {
build_ubuntu_cpu_clang100() {
set -ex
cd /work/build
CXX=clang++-6.0 CC=clang-6.0 cmake \
CXX=clang++-10 CC=clang-10 cmake \
-DUSE_MKL_IF_AVAILABLE=OFF \
-DUSE_MKLDNN=OFF \
-DUSE_CUDA=OFF \
Expand All @@ -549,10 +579,12 @@ build_ubuntu_cpu_clang_tidy() {
set -ex
cd /work/build
export CLANG_TIDY=/usr/lib/llvm-6.0/share/clang/run-clang-tidy.py
# TODO(leezu) USE_OPENMP=OFF 3rdparty/dmlc-core/CMakeLists.txt:79 broken?
CXX=clang++-6.0 CC=clang-6.0 cmake \
-DUSE_MKL_IF_AVAILABLE=OFF \
-DUSE_MKLDNN=OFF \
-DUSE_CUDA=OFF \
-DUSE_OPENMP=OFF \
-DCMAKE_BUILD_TYPE=Debug \
-DUSE_DIST_KVSTORE=ON \
-DUSE_CPP_PACKAGE=ON \
Expand All @@ -576,10 +608,10 @@ build_ubuntu_cpu_clang39_mkldnn() {
ninja
}

build_ubuntu_cpu_clang60_mkldnn() {
build_ubuntu_cpu_clang100_mkldnn() {
set -ex
cd /work/build
CXX=clang++-6.0 CC=clang-6.0 cmake \
CXX=clang++-10 CC=clang-10 cmake \
-DUSE_MKL_IF_AVAILABLE=OFF \
-DUSE_MKLDNN=ON \
-DUSE_CUDA=OFF \
Expand Down Expand Up @@ -688,8 +720,11 @@ build_ubuntu_gpu_tensorrt() {
build_ubuntu_gpu_mkldnn() {
set -ex
cd /work/build
# Set CMAKE_AR and CMAKE_RANLIB due to Ubuntu 16.04 default binutils 4GB limitation
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_AR=/usr/local/bin/ar \
-DCMAKE_RANLIB=/usr/local/bin/ranlib \
-DCMAKE_BUILD_TYPE="RelWithDebInfo" \
-DUSE_MKL_IF_AVAILABLE=OFF \
-DUSE_TVM_OP=ON \
-DUSE_CUDA=ON \
Expand All @@ -702,8 +737,11 @@ build_ubuntu_gpu_mkldnn() {
build_ubuntu_gpu_mkldnn_nocudnn() {
set -ex
cd /work/build
# Set CMAKE_AR and CMAKE_RANLIB due to Ubuntu 16.04 default binutils 4GB limitation
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_AR=/usr/local/bin/ar \
-DCMAKE_RANLIB=/usr/local/bin/ranlib \
-DCMAKE_BUILD_TYPE="RelWithDebInfo" \
-DUSE_MKL_IF_AVAILABLE=OFF \
-DUSE_TVM_OP=ON \
-DUSE_CUDA=ON \
Expand All @@ -717,8 +755,11 @@ build_ubuntu_gpu_mkldnn_nocudnn() {
build_ubuntu_gpu_cuda101_cudnn7() {
set -ex
cd /work/build
# Set CMAKE_AR and CMAKE_RANLIB due to Ubuntu 16.04 default binutils 4GB limitation
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_AR=/usr/local/bin/ar \
-DCMAKE_RANLIB=/usr/local/bin/ranlib \
-DCMAKE_BUILD_TYPE="RelWithDebInfo" \
-DUSE_MKL_IF_AVAILABLE=OFF \
-DUSE_TVM_OP=ON \
-DUSE_CUDA=ON \
Expand Down Expand Up @@ -773,8 +814,11 @@ build_ubuntu_gpu_cuda101_cudnn7_mkldnn_cpp_test() {
build_ubuntu_gpu_cuda101_cudnn7_no_tvm_op() {
set -ex
cd /work/build
# Set CMAKE_AR and CMAKE_RANLIB due to Ubuntu 16.04 default binutils 4GB limitation
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_AR=/usr/local/bin/ar \
-DCMAKE_RANLIB=/usr/local/bin/ranlib \
-DCMAKE_BUILD_TYPE="RelWithDebInfo" \
-DUSE_MKL_IF_AVAILABLE=OFF \
-DUSE_TVM_OP=OFF \
-DUSE_CUDA=ON \
Expand Down
48 changes: 38 additions & 10 deletions ci/jenkins/Jenkins_steps.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -437,13 +437,14 @@ def compile_unix_clang_3_9_cpu() {
}]
}

def compile_unix_clang_6_cpu() {
return ['CPU: Clang 6': {
// TODO(leezu) delete once DUSE_DIST_KVSTORE=ON builds in -WError build
def compile_unix_clang_10_cpu() {
return ['CPU: Clang 10': {
node(NODE_LINUX_CPU) {
ws('workspace/build-cpu-clang60') {
ws('workspace/build-cpu-clang100') {
timeout(time: max_time, unit: 'MINUTES') {
utils.init_git()
utils.docker_run('ubuntu_cpu', 'build_ubuntu_cpu_clang60', false)
utils.docker_run('ubuntu_cpu', 'build_ubuntu_cpu_clang100', false)
}
}
}
Expand All @@ -470,21 +471,20 @@ def compile_unix_clang_3_9_mkldnn_cpu() {
timeout(time: max_time, unit: 'MINUTES') {
utils.init_git()
utils.docker_run('ubuntu_cpu', 'build_ubuntu_cpu_clang39_mkldnn', false)
utils.pack_lib('mkldnn_cpu_clang3', mx_mkldnn_lib)
}
}
}
}]
}

def compile_unix_clang_6_mkldnn_cpu() {
return ['CPU: Clang 6 MKLDNN': {
// TODO(leezu) delete once DUSE_DIST_KVSTORE=ON builds in -WError build
def compile_unix_clang_10_mkldnn_cpu() {
return ['CPU: Clang 10 MKLDNN': {
node(NODE_LINUX_CPU) {
ws('workspace/build-cpu-mkldnn-clang60') {
ws('workspace/build-cpu-mkldnn-clang100') {
timeout(time: max_time, unit: 'MINUTES') {
utils.init_git()
utils.docker_run('ubuntu_cpu', 'build_ubuntu_cpu_clang60_mkldnn', false)
utils.pack_lib('mkldnn_cpu_clang6', mx_mkldnn_lib)
utils.docker_run('ubuntu_cpu', 'build_ubuntu_cpu_clang100_mkldnn', false)
}
}
}
Expand Down Expand Up @@ -598,6 +598,34 @@ def compile_unix_gcc8_werror() {
}]
}

def compile_unix_clang10_werror() {
return ['CPU: Clang10 -WError': {
node(NODE_LINUX_CPU) {
ws('workspace/build-cpu-clang10') {
timeout(time: max_time, unit: 'MINUTES') {
utils.init_git()
utils.docker_run('ubuntu_cpu', 'build_ubuntu_cpu_clang10_werror', false)
utils.pack_lib('cpu_clang10', mx_lib)
}
}
}
}]
}

def compile_unix_clang10_cuda_werror() {
return ['GPU: Clang10 -WError': {
node(NODE_LINUX_CPU) {
ws('workspace/build-cpu-clang10') {
timeout(time: max_time, unit: 'MINUTES') {
utils.init_git()
utils.docker_run('ubuntu_gpu_cu101', 'build_ubuntu_gpu_clang10_werror', false)
utils.pack_lib('gpu_clang10', mx_lib)
}
}
}
}]
}

def compile_unix_amalgamation_min() {
return ['Amalgamation MIN': {
node(NODE_LINUX_CPU) {
Expand Down
4 changes: 2 additions & 2 deletions ci/jenkins/Jenkinsfile_clang
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ utils.main_wrapper(
core_logic: {
utils.parallel_stage('Build', [
custom_steps.compile_unix_clang_3_9_cpu(),
custom_steps.compile_unix_clang_6_cpu(),
custom_steps.compile_unix_clang_10_cpu(),
custom_steps.compile_unix_clang_tidy_cpu(),
custom_steps.compile_unix_clang_3_9_mkldnn_cpu(),
custom_steps.compile_unix_clang_6_mkldnn_cpu()
custom_steps.compile_unix_clang_10_mkldnn_cpu()
])
}
,
Expand Down
2 changes: 2 additions & 0 deletions ci/jenkins/Jenkinsfile_miscellaneous
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ core_logic: {
utils.parallel_stage('Build', [
custom_steps.compile_unix_asan_cpu(),
custom_steps.compile_unix_gcc8_werror(),
custom_steps.compile_unix_clang10_werror(),
custom_steps.compile_unix_clang10_cuda_werror(),
custom_steps.compile_unix_amalgamation_min(),
custom_steps.compile_unix_amalgamation()
])
Expand Down
Loading