setup.sh 2.17 KB
Newer Older
1
2
3
4
5
#!/bin/bash

if [[ $OS_NAME == "macos" ]]; then
    if  [[ $COMPILER == "clang" ]]; then
        brew install libomp
6
        if [[ $AZURE == "true" ]]; then
7
            sudo xcode-select -s /Applications/Xcode_9.4.1.app/Contents/Developer
8
        fi
Nikita Titov's avatar
Nikita Titov committed
9
    else  # gcc
10
11
        if [[ $TASK != "mpi" ]]; then
            brew install gcc
12
13
14
15
16
17
            if [[ $GITHUB_ACTIONS == "true" ]]; then
                brew update
            fi
            if [[ $TRAVIS == "true" ]] || [[ $GITHUB_ACTIONS == "true" ]]; then
                brew upgrade gcc
            fi
18
19
20
21
22
        fi
    fi
    if [[ $TASK == "mpi" ]]; then
        brew install open-mpi
    fi
23
24
25
    if [[ $AZURE == "true" ]] && [[ $TASK == "sdist" ]]; then
        brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/f3544543a3115023fc7ca962c21d14b443f419d0/Formula/swig.rb  # swig 3.0.12
    fi
Nikita Titov's avatar
Nikita Titov committed
26
    wget -q -O conda.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh
27
28
else  # Linux
    if [[ $TASK == "mpi" ]]; then
29
        sudo apt-get update
30
        sudo apt-get install --no-install-recommends -y libopenmpi-dev openmpi-bin
31
32
    fi
    if [[ $TASK == "gpu" ]]; then
Nikita Titov's avatar
Nikita Titov committed
33
        sudo add-apt-repository ppa:mhier/libboost-latest -y
34
        sudo apt-get update
35
        sudo apt-get install --no-install-recommends -y libboost1.73-dev ocl-icd-opencl-dev
Nikita Titov's avatar
Nikita Titov committed
36
        cd $BUILD_DIRECTORY  # to avoid permission errors
37
        wget -q https://github.com/microsoft/LightGBM/releases/download/v2.0.12/AMD-APP-SDKInstaller-v3.0.130.136-GA-linux64.tar.bz2
38
39
40
41
42
43
44
        tar -xjf AMD-APP-SDK*.tar.bz2
        mkdir -p $OPENCL_VENDOR_PATH
        mkdir -p $AMDAPPSDK_PATH
        sh AMD-APP-SDK*.sh --tar -xf -C $AMDAPPSDK_PATH
        mv $AMDAPPSDK_PATH/lib/x86_64/sdk/* $AMDAPPSDK_PATH/lib/x86_64/
        echo libamdocl64.so > $OPENCL_VENDOR_PATH/amdocl64.icd
    fi
45
    if [[ $TRAVIS == "true" ]] || [[ $GITHUB_ACTIONS == "true" ]]; then
Nikita Titov's avatar
Nikita Titov committed
46
        wget -q -O conda.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
47
48
49
    fi
fi

50
if [[ $TRAVIS == "true" ]] || [[ $GITHUB_ACTIONS == "true" ]] || [[ $OS_NAME == "macos" ]]; then
Nikita Titov's avatar
Nikita Titov committed
51
    sh conda.sh -b -p $CONDA
52
fi
53
conda config --set always_yes yes --set changeps1 no
Nikita Titov's avatar
Nikita Titov committed
54
conda update -q -y conda