Commit 739c2635 authored by Nikita Titov's avatar Nikita Titov Committed by Guolin Ke
Browse files

[ci] added job for swig compilation on Linux with artifacts (#2125)

* added job for swig compilation on Linux with artifacts

* hotfix

* test: SWIG with Clang compiler

* switch compiler back to gcc

* switch to main docker
parent 8d2ec69f
...@@ -41,6 +41,26 @@ RUN curl -sL https://cmake.org/files/v3.14/cmake-3.14.1-Linux-x86_64.sh -o cmake ...@@ -41,6 +41,26 @@ RUN curl -sL https://cmake.org/files/v3.14/cmake-3.14.1-Linux-x86_64.sh -o cmake
&& ./cmake.sh --prefix=/usr/local --exclude-subdir \ && ./cmake.sh --prefix=/usr/local --exclude-subdir \
&& rm cmake.sh && rm cmake.sh
# Install Java
RUN add-apt-repository ppa:openjdk-r/ppa -y \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
openjdk-8-jdk \
&& rm -rf /var/lib/apt/lists/*
ENV JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/
# Install SWIG
RUN curl -sL https://downloads.sourceforge.net/project/swig/swig/swig-3.0.12/swig-3.0.12.tar.gz -o swig.tar.gz \
&& tar -xzf swig.tar.gz \
&& cd swig-3.0.12 \
&& ./configure --prefix=/usr/local --without-pcre \
&& make \
&& make install \
&& cd .. \
&& rm swig.tar.gz \
&& rm -rf swig-3.0.12
# Install Miniconda # Install Miniconda
RUN curl -sL https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -o miniconda.sh \ RUN curl -sL https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -o miniconda.sh \
&& chmod +x miniconda.sh \ && chmod +x miniconda.sh \
......
...@@ -18,6 +18,19 @@ else ...@@ -18,6 +18,19 @@ else
CMAKE_OPTS=() CMAKE_OPTS=()
fi fi
if [[ $AZURE == "true" ]] && [[ $OS_NAME == "linux" ]] && [[ $TASK == "swig" ]]; then
mkdir $BUILD_DIRECTORY/build && cd $BUILD_DIRECTORY/build
cmake -DUSE_SWIG=ON "${CMAKE_OPTS[@]}" ..
make -j4 || exit -1
if [[ $COMPILER == "gcc" ]]; then
objdump -T $BUILD_DIRECTORY/lib_lightgbm.so > $BUILD_DIRECTORY/objdump.log || exit -1
objdump -T $BUILD_DIRECTORY/lib_lightgbm_swig.so >> $BUILD_DIRECTORY/objdump.log || exit -1
python $BUILD_DIRECTORY/helpers/check_dynamic_dependencies.py $BUILD_DIRECTORY/objdump.log || exit -1
fi
cp $BUILD_DIRECTORY/build/lightgbmlib.jar $BUILD_ARTIFACTSTAGINGDIRECTORY/lightgbmlib.jar
exit 0
fi
conda create -q -y -n $CONDA_ENV python=$PYTHON_VERSION conda create -q -y -n $CONDA_ENV python=$PYTHON_VERSION
source activate $CONDA_ENV source activate $CONDA_ENV
......
...@@ -15,7 +15,7 @@ jobs: ...@@ -15,7 +15,7 @@ jobs:
vmImage: 'ubuntu-16.04' vmImage: 'ubuntu-16.04'
container: ubuntu1404 container: ubuntu1404
strategy: strategy:
maxParallel: 6 maxParallel: 7
matrix: matrix:
regular: regular:
TASK: regular TASK: regular
...@@ -25,6 +25,8 @@ jobs: ...@@ -25,6 +25,8 @@ jobs:
bdist: bdist:
TASK: bdist TASK: bdist
PYTHON_VERSION: 3.6 PYTHON_VERSION: 3.6
swig:
TASK: swig
inference: inference:
TASK: if-else TASK: if-else
mpi_source: mpi_source:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment