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

Commit

Permalink
Use cmake for all CI builds
Browse files Browse the repository at this point in the history
Improvements to CMake build
- Enable WError for RelWithDebug build
- Add USE_LIBJPEG_TURBO to CMake build

Changes to CI setup
- Install protobuf in ubuntu_core.sh
- Install up-to-date CMake on Centos 7
- Don't use RelWithDebInfo on Android builds, as gcc 4.9 throws
  -Wdelete-non-virtual-dtor
  • Loading branch information
leezu committed Feb 21, 2020
1 parent 9dcf71d commit 1eb6e5a
Show file tree
Hide file tree
Showing 16 changed files with 323 additions and 304 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/os_x_staticbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
uses: actions/checkout@v2
- name: Install Dependencies
run: |
brew install nasm automake ninja libtool
brew install nasm automake ninja libtool cmake pkgconfig protobuf
- name: Build project
run: |
git --version
Expand Down
16 changes: 16 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ else()
endif()
option(USE_GPERFTOOLS "Build with GPerfTools support" OFF)
option(USE_JEMALLOC "Build with Jemalloc support" OFF)
option(USE_LIBJPEG_TURBO "Use libjpeg-turbo" OFF)
option(USE_DIST_KVSTORE "Build with DIST_KVSTORE support" OFF)
option(USE_PLUGINS_WARPCTC "Use WARPCTC Plugins" OFF)
option(USE_PLUGIN_CAFFE "Use Caffe Plugin" OFF)
Expand Down Expand Up @@ -370,6 +371,15 @@ if(USE_JEMALLOC)
endif()
endif()

if(USE_LIBJPEG_TURBO)
# We can switch from pkgconfig to libjpeg-turboConfig.cmake once libjpeg-turbo
# 2.1 is released https://github.com/libjpeg-turbo/libjpeg-turbo/pull/342
find_package(PkgConfig REQUIRED)
pkg_search_module(TURBOJPEG REQUIRED libturbojpeg)
include_directories(SYSTEM ${TURBOJPEG_INCLUDE_DIRS})
list(APPEND mxnet_LINKER_LIBS ${TURBOJPEG_LIBRARIES})
endif()

# ---[ OpenCV
if(USE_OPENCV)
find_package(OpenCV COMPONENTS core highgui imgproc imgcodecs)
Expand Down Expand Up @@ -663,6 +673,12 @@ if(UNIX)
target_link_libraries(mxnet PRIVATE mxnet_static)
target_link_libraries(mxnet_static PUBLIC ${CMAKE_DL_LIBS})
set_target_properties(mxnet_static PROPERTIES OUTPUT_NAME mxnet)
if(CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
target_compile_options(mxnet_static PRIVATE -Werror)
if(USE_CUDA)
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} -Werror cross-execution-space-call)
endif()
endif()
elseif(MSVC)
if(USE_CUDA)
if(MSVC)
Expand Down
9 changes: 8 additions & 1 deletion ci/docker/install/centos7_base.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,14 @@ yum -y install epel-release
yum -y install git
yum -y install wget
yum -y install make
yum -y install cmake
yum -y install unzip
yum -y install ninja-build
yum -y install gcc-gfortran

# CMake 3.13.2+ is required
mkdir /opt/cmake && cd /opt/cmake
wget -nv https://cmake.org/files/v3.13/cmake-3.13.5-Linux-x86_64.sh
sh cmake-3.13.5-Linux-x86_64.sh --prefix=/opt/cmake --skip-license
ln -s /opt/cmake/bin/cmake /usr/local/bin/cmake
rm cmake-3.13.5-Linux-x86_64.sh
cmake --version
9 changes: 8 additions & 1 deletion ci/docker/install/centos7_core.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,14 @@ yum -y install opencv-devel
yum -y install openssl-devel
yum -y install gcc-c++-4.8.*
yum -y install make
yum -y install cmake
yum -y install wget
yum -y install unzip
yum -y install ninja-build

# CMake 3.13.2+ is required
mkdir /opt/cmake && cd /opt/cmake
wget -nv https://cmake.org/files/v3.13/cmake-3.13.5-Linux-x86_64.sh
sh cmake-3.13.5-Linux-x86_64.sh --prefix=/opt/cmake --skip-license
ln -s /opt/cmake/bin/cmake /usr/local/bin/cmake
rm cmake-3.13.5-Linux-x86_64.sh
cmake --version
2 changes: 2 additions & 0 deletions ci/docker/install/ubuntu_core.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ apt-get install -y \
zlib1g-dev \
libedit-dev \
libxml2-dev \
libprotobuf-dev \
protobuf-compiler \
ninja-build \
software-properties-common \
sudo \
Expand Down

0 comments on commit 1eb6e5a

Please sign in to comment.