Skip to content

Commit

Permalink
[ci] update macOS on Travis to Mojave (#2086)
Browse files Browse the repository at this point in the history
* added fix for OpenMP on macOS into test script

* test: AppleClang on Travis

* use Mojave on Travis

* bash hotfix

* get back to gcc compiler on Travis macOS
  • Loading branch information
StrikerRUS authored and henry0312 committed Apr 10, 2019
1 parent b3c31c4 commit 0e025e9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
18 changes: 14 additions & 4 deletions .ci/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@ elif [[ $OS_NAME == "linux" ]] && [[ $COMPILER == "clang" ]]; then
export CC=clang
fi

if [[ $OS_NAME == "macos" ]] && [[ $COMPILER == "clang" ]] && [[ $(sw_vers -productVersion | cut -d'.' -f2) -ge "14" ]]; then
CMAKE_OPTS=(-DOpenMP_C_FLAGS="-Xpreprocessor -fopenmp -I$(brew --prefix libomp)/include"
-DOpenMP_C_LIB_NAMES=omp
-DOpenMP_CXX_FLAGS="-Xpreprocessor -fopenmp -I$(brew --prefix libomp)/include"
-DOpenMP_CXX_LIB_NAMES=omp
-DOpenMP_omp_LIBRARY=$(brew --prefix libomp)/lib/libomp.dylib)
else
CMAKE_OPTS=()
fi

conda create -q -y -n $CONDA_ENV python=$PYTHON_VERSION
source activate $CONDA_ENV

Expand Down Expand Up @@ -51,7 +61,7 @@ fi

if [[ $TASK == "if-else" ]]; then
conda install -q -y -n $CONDA_ENV numpy
mkdir $BUILD_DIRECTORY/build && cd $BUILD_DIRECTORY/build && cmake .. && make lightgbm -j4 || exit -1
mkdir $BUILD_DIRECTORY/build && cd $BUILD_DIRECTORY/build && cmake "${CMAKE_OPTS[@]}" .. && make lightgbm -j4 || exit -1
cd $BUILD_DIRECTORY/tests/cpp_test && ../../lightgbm config=train.conf convert_model_language=cpp convert_model=../../src/boosting/gbdt_prediction.cpp && ../../lightgbm config=predict.conf output_result=origin.pred || exit -1
cd $BUILD_DIRECTORY/build && make lightgbm -j4 || exit -1
cd $BUILD_DIRECTORY/tests/cpp_test && ../../lightgbm config=predict.conf output_result=ifelse.pred && python test.py || exit -1
Expand Down Expand Up @@ -101,17 +111,17 @@ if [[ $TASK == "gpu" ]]; then
pytest $BUILD_DIRECTORY/tests/python_package_test || exit -1
exit 0
fi
cmake -DUSE_GPU=ON -DOpenCL_INCLUDE_DIR=$AMDAPPSDK_PATH/include/ ..
cmake -DUSE_GPU=ON -DOpenCL_INCLUDE_DIR=$AMDAPPSDK_PATH/include/ "${CMAKE_OPTS[@]}" ..
elif [[ $TASK == "mpi" ]]; then
if [[ $METHOD == "pip" ]]; then
cd $BUILD_DIRECTORY/python-package && python setup.py sdist || exit -1
pip install --user $BUILD_DIRECTORY/python-package/dist/lightgbm-$LGB_VER.tar.gz -v --install-option=--mpi || exit -1
pytest $BUILD_DIRECTORY/tests/python_package_test || exit -1
exit 0
fi
cmake -DUSE_MPI=ON ..
cmake -DUSE_MPI=ON "${CMAKE_OPTS[@]}" ..
else
cmake ..
cmake "${CMAKE_OPTS[@]}" ..
fi

make _lightgbm -j4 || exit -1
Expand Down
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
language: cpp
dist: trusty

git:
submodules: true

os:
- linux
- osx
osx_image: xcode10.1
dist: trusty
osx_image: xcode10.2

env:
global: # default values
Expand Down

0 comments on commit 0e025e9

Please sign in to comment.