"...git@developer.sourcefind.cn:tianlh/lightgbm-dcu.git" did not exist on "480600b3afaf2a0a6f32cf417edf9567f625b2c3"
Commit 0e025e9c authored by Nikita Titov's avatar Nikita Titov Committed by Tsukasa OMOTO
Browse files

[ci] update macOS on Travis to Mojave (#2086)

* 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
parent b3c31c40
...@@ -8,6 +8,16 @@ elif [[ $OS_NAME == "linux" ]] && [[ $COMPILER == "clang" ]]; then ...@@ -8,6 +8,16 @@ elif [[ $OS_NAME == "linux" ]] && [[ $COMPILER == "clang" ]]; then
export CC=clang export CC=clang
fi 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 conda create -q -y -n $CONDA_ENV python=$PYTHON_VERSION
source activate $CONDA_ENV source activate $CONDA_ENV
...@@ -51,7 +61,7 @@ fi ...@@ -51,7 +61,7 @@ fi
if [[ $TASK == "if-else" ]]; then if [[ $TASK == "if-else" ]]; then
conda install -q -y -n $CONDA_ENV numpy 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/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/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 cd $BUILD_DIRECTORY/tests/cpp_test && ../../lightgbm config=predict.conf output_result=ifelse.pred && python test.py || exit -1
...@@ -101,7 +111,7 @@ if [[ $TASK == "gpu" ]]; then ...@@ -101,7 +111,7 @@ if [[ $TASK == "gpu" ]]; then
pytest $BUILD_DIRECTORY/tests/python_package_test || exit -1 pytest $BUILD_DIRECTORY/tests/python_package_test || exit -1
exit 0 exit 0
fi 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 elif [[ $TASK == "mpi" ]]; then
if [[ $METHOD == "pip" ]]; then if [[ $METHOD == "pip" ]]; then
cd $BUILD_DIRECTORY/python-package && python setup.py sdist || exit -1 cd $BUILD_DIRECTORY/python-package && python setup.py sdist || exit -1
...@@ -109,9 +119,9 @@ elif [[ $TASK == "mpi" ]]; then ...@@ -109,9 +119,9 @@ elif [[ $TASK == "mpi" ]]; then
pytest $BUILD_DIRECTORY/tests/python_package_test || exit -1 pytest $BUILD_DIRECTORY/tests/python_package_test || exit -1
exit 0 exit 0
fi fi
cmake -DUSE_MPI=ON .. cmake -DUSE_MPI=ON "${CMAKE_OPTS[@]}" ..
else else
cmake .. cmake "${CMAKE_OPTS[@]}" ..
fi fi
make _lightgbm -j4 || exit -1 make _lightgbm -j4 || exit -1
......
language: cpp language: cpp
dist: trusty
git: git:
submodules: true submodules: true
...@@ -7,7 +6,8 @@ git: ...@@ -7,7 +6,8 @@ git:
os: os:
- linux - linux
- osx - osx
osx_image: xcode10.1 dist: trusty
osx_image: xcode10.2
env: env:
global: # default values global: # default values
......
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