setup.sh 1.43 KB
Newer Older
wxchan's avatar
wxchan committed
1
2
3
#!/bin/bash

if [[ $TRAVIS_OS_NAME == "osx" ]]; then
4
    sudo softwareupdate -i "Command Line Tools (macOS High Sierra version 10.13) for Xcode-9.3"  # fix "fatal error: _stdio.h: No such file or directory"
5
    rm '/usr/local/include/c++'
6
7
#    brew cask uninstall oclint  #  reserve variant to deal with conflict link
    if [[ $TASK == "mpi" ]]; then
8
9
10
11
        brew install open-mpi
    else
        brew install gcc
    fi
12
#    brew link --overwrite gcc  # previous variant to deal with conflict link
13
    wget -O conda.sh https://repo.continuum.io/miniconda/Miniconda${PYTHON_VERSION:0:1}-latest-MacOSX-x86_64.sh
wxchan's avatar
wxchan committed
14
else
15
    if [[ $TASK == "mpi" ]]; then
16
17
        sudo apt-get install -y libopenmpi-dev openmpi-bin
    fi
18
    if [[ $TASK == "gpu" ]]; then
19
        sudo apt-get install -y ocl-icd-opencl-dev
wxchan's avatar
wxchan committed
20
    fi
21
    wget -O conda.sh https://repo.continuum.io/miniconda/Miniconda${PYTHON_VERSION:0:1}-latest-Linux-x86_64.sh
wxchan's avatar
wxchan committed
22
fi
23
24
25
26
27
28

sh conda.sh -b -p $HOME/miniconda
conda config --set always_yes yes --set changeps1 no
conda update -q conda

if [[ $TASK == "gpu" ]] && [[ $TRAVIS_OS_NAME == "linux" ]]; then
29
    wget https://github.com/Microsoft/LightGBM/releases/download/v2.0.12/AMD-APP-SDKInstaller-v3.0.130.136-GA-linux64.tar.bz2
30
31
32
    tar -xjf AMD-APP-SDK*.tar.bz2
    mkdir -p $OPENCL_VENDOR_PATH
    sh AMD-APP-SDK*.sh --tar -xf -C $AMDAPPSDK
33
    mv $AMDAPPSDK/lib/x86_64/sdk/* $AMDAPPSDK/lib/x86_64/
34
35
    echo libamdocl64.so > $OPENCL_VENDOR_PATH/amdocl64.icd
fi