Skip to content
This repository was archived by the owner on Nov 17, 2023. It is now read-only.

Commit adbc17b

Browse files
authored
Switch to GCC 8 for distribution build (#19034)
1 parent 0b638fe commit adbc17b

File tree

7 files changed

+27
-17
lines changed

7 files changed

+27
-17
lines changed

cd/mxnet_lib/static/Jenkins_pipeline.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ libmxnet = 'lib/libmxnet.so'
3232
licenses = 'licenses/*'
3333

3434
// libmxnet dependencies
35-
mx_native_deps = 'lib/libgfortran.so.4, lib/libopenblas.so.0'
36-
mx_deps = 'lib/libgfortran.so.4, lib/libopenblas.so.0, include/mkldnn/dnnl_version.h, include/mkldnn/dnnl_config.h'
35+
mx_native_deps = 'lib/libgfortran.so.*, lib/libopenblas.so.0'
36+
mx_deps = 'lib/libgfortran.so.*, lib/libopenblas.so.0, include/mkldnn/dnnl_version.h, include/mkldnn/dnnl_config.h'
3737

3838
// library type
3939
// either static or dynamic - depending on how it links to its dependencies

ci/docker/Dockerfile.build.centos7

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ RUN yum -y check-update || true && \
5353
protobuf-devel \
5454
# CentOS Software Collections https://www.softwarecollections.org
5555
devtoolset-7 \
56+
devtoolset-8 \
5657
rh-python36 \
5758
rh-maven35 \
5859
# Libraries
@@ -69,8 +70,8 @@ RUN yum -y check-update || true && \
6970
libzstd-devel && \
7071
yum clean all
7172

72-
# Make GCC7, Python 3.5 and Maven 3.3 Software Collections available by default
73-
# during build and runtime of this container
73+
# Make Python 3.6 and Maven 3.3 Software Collections available by default during
74+
# the following build steps in this Dockerfile
7475
SHELL [ "/usr/bin/scl", "enable", "devtoolset-7", "rh-python36", "rh-maven35" ]
7576

7677
# Install minimum required cmake version

ci/docker/runtime_functions.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ build_dynamic_libmxnet() {
111111
gather_licenses
112112

113113
cd /work/build
114-
source /opt/rh/devtoolset-7/enable
114+
source /opt/rh/devtoolset-8/enable
115115
if [[ ${mxnet_variant} = "cpu" ]]; then
116116
cmake -DUSE_MKL_IF_AVAILABLE=OFF \
117117
-DUSE_MKLDNN=ON \
@@ -1229,7 +1229,7 @@ checkout() {
12291229
build_static_libmxnet() {
12301230
set -ex
12311231
pushd .
1232-
source /opt/rh/devtoolset-7/enable
1232+
source /opt/rh/devtoolset-8/enable
12331233
source /opt/rh/rh-python36/enable
12341234
local mxnet_variant=${1:?"This function requires a python command as the first argument"}
12351235
source tools/staticbuild/build.sh ${mxnet_variant}
@@ -1294,17 +1294,17 @@ build_static_python_cpu() {
12941294
set -ex
12951295
pushd .
12961296
export mxnet_variant=cpu
1297-
source /opt/rh/devtoolset-7/enable
1297+
source /opt/rh/devtoolset-8/enable
12981298
source /opt/rh/rh-python36/enable
12991299
./ci/publish/python/build.sh
13001300
popd
13011301
}
13021302

1303-
build_static_python_cu92() {
1303+
build_static_python_cu102() {
13041304
set -ex
13051305
pushd .
1306-
export mxnet_variant=cu92
1307-
source /opt/rh/devtoolset-7/enable
1306+
export mxnet_variant=cu102
1307+
source /opt/rh/devtoolset-8/enable
13081308
source /opt/rh/rh-python36/enable
13091309
./ci/publish/python/build.sh
13101310
popd

ci/jenkins/Jenkins_steps.groovy

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ mx_tensorrt_lib = 'build/libmxnet.so, build/3rdparty/tvm/libtvm_runtime.so, buil
3737
mx_lib_cpp_examples = 'build/libmxnet.so, build/3rdparty/tvm/libtvm_runtime.so, build/libtvmop.so, build/tvmop.conf, build/3rdparty/openmp/runtime/src/libomp.so, build/libcustomop_lib.so, build/libcustomop_gpu_lib.so, build/libsubgraph_lib.so, python/mxnet/_cy3/*.so, python/mxnet/_ffi/_cy3/*.so'
3838
mx_lib_cpp_examples_no_tvm_op = 'build/libmxnet.so, build/libcustomop_lib.so, build/libcustomop_gpu_lib.so, build/libsubgraph_lib.so, build/3rdparty/openmp/runtime/src/libomp.so, python/mxnet/_cy3/*.so, python/mxnet/_ffi/_cy3/*.so'
3939
mx_lib_cpp_examples_cpu = 'build/libmxnet.so, build/3rdparty/tvm/libtvm_runtime.so, build/libtvmop.so, build/tvmop.conf, build/3rdparty/openmp/runtime/src/libomp.so'
40-
mx_cd_lib = 'lib/libmxnet.so, licenses/*, lib/libgfortran.so.4, lib/libopenblas.so.0, include/mkldnn/dnnl_version.h, include/mkldnn/dnnl_config.h'
40+
mx_cd_lib = 'lib/libmxnet.so, licenses/*, lib/libgfortran.so.*, lib/libopenblas.so.0, include/mkldnn/dnnl_version.h, include/mkldnn/dnnl_config.h'
41+
4142

4243
// Python unittest for CPU
4344
// Python 3
@@ -634,7 +635,7 @@ def compile_static_python_gpu() {
634635
ws('workspace/ut-publish-python-gpu') {
635636
timeout(time: max_time, unit: 'MINUTES') {
636637
utils.init_git()
637-
utils.docker_run('centos7_gpu_cu92', 'build_static_python_cu92')
638+
utils.docker_run('centos7_gpu_cu102', 'build_static_python_cu102')
638639
}
639640
}
640641
}

docs/static_site/src/pages/get_started/build_from_source.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,13 @@ sudo apt-get install -y build-essential git ninja-build ccache libopenblas-dev l
7474
sudo yum install epel-release centos-release-scl
7575
sudo yum install git make ninja-build automake autoconf libtool protobuf-compiler protobuf-devel \
7676
atlas-devel openblas-devel lapack-devel opencv-devel openssl-devel zeromq-devel python3 \
77-
devtoolset-7
77+
devtoolset-8
7878
source /opt/rh/devtoolset-7/enable
7979
```
80-
Here `devtoolset-7` refers to the [Developer Toolset
81-
7](https://www.softwarecollections.org/en/scls/rhscl/devtoolset-7/) created by
80+
Here `devtoolset-8` refers to the [Developer Toolset
81+
8](https://www.softwarecollections.org/en/scls/rhscl/devtoolset-8/) created by
8282
Red Hat for developers working on CentOS or Red Hat Enterprise Linux platform
83-
and providing the GNU Compiler Collection 7.
83+
and providing the GNU Compiler Collection 9.
8484

8585
### macOS
8686
```bash

tools/dependencies/protobuf.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@
2020
# This script builds the static library of protobuf along with protoc, that can be used as dependency of mxnet.
2121
set -ex
2222
PROTOBUF_VERSION=3.5.1
23+
if [[ $PLATFORM == 'darwin' ]]; then
24+
DY_EXT="dylib"
25+
else
26+
DY_EXT="so"
27+
fi
2328

2429
LIBPROTOBUF="$DEPS_PATH/lib/libprotobuf.$DY_EXT"
2530
LIBPROTOC="$DEPS_PATH/lib/libprotoc.$DY_EXT"

tools/pip/setup.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,12 @@ def skip_markdown_comments(md):
150150
if os.path.exists(os.path.join(libdir, 'libgfortran.so.3')):
151151
shutil.copy(os.path.join(libdir, 'libgfortran.so.3'), mxdir)
152152
package_data['mxnet'].append('mxnet/libgfortran.so.3')
153-
else:
153+
elif os.path.exists(os.path.join(libdir, 'libgfortran.so.4')):
154154
shutil.copy(os.path.join(libdir, 'libgfortran.so.4'), mxdir)
155155
package_data['mxnet'].append('mxnet/libgfortran.so.4')
156+
elif os.path.exists(os.path.join(libdir, 'libgfortran.so.5')):
157+
shutil.copy(os.path.join(libdir, 'libgfortran.so.5'), mxdir)
158+
package_data['mxnet'].append('mxnet/libgfortran.so.5')
156159
if os.path.exists(os.path.join(libdir, 'libopenblas.so.0')):
157160
shutil.copy(os.path.join(libdir, 'libopenblas.so.0'), mxdir)
158161
package_data['mxnet'].append('mxnet/libopenblas.so.0')

0 commit comments

Comments
 (0)