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

if [[ $OS_NAME == "macos" ]]; then
    if  [[ $COMPILER == "clang" ]]; then
        brew install libomp
6
        brew upgrade cmake  # CMake >=3.12 is needed to find OpenMP at macOS
7
8
9
        if [[ $AZURE == "true" ]]; then
            sudo xcode-select -s /Applications/Xcode_8.3.1.app/Contents/Developer
        fi
10
11
    else
        if [[ $TRAVIS == "true" ]]; then
Nikita Titov's avatar
Nikita Titov committed
12
#            rm '/usr/local/include/c++'  # previous variant to deal with conflict link
13
#            brew cask uninstall oclint  #  reserve variant to deal with conflict link
Nikita Titov's avatar
Nikita Titov committed
14
            brew link --overwrite gcc
15
16
17
18
19
20
21
22
23
24
25
26
27
        fi
        if [[ $TASK != "mpi" ]]; then
            brew install gcc
        fi
    fi
    if [[ $TASK == "mpi" ]]; then
        brew install open-mpi
    fi
    if [[ $TRAVIS == "true" ]]; then
        wget -O conda.sh https://repo.continuum.io/miniconda/Miniconda${PYTHON_VERSION:0:1}-latest-MacOSX-x86_64.sh
    fi
else  # Linux
    if [[ $AZURE == "true" ]] && [[ $COMPILER == "clang" ]]; then
28
        sudo apt-get update
29
30
        sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-6.0 100
        sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-6.0 100
31
        sudo apt-get install --no-install-recommends -y libomp-dev
32
33
    fi
    if [[ $TASK == "mpi" ]]; then
34
        sudo apt-get update
35
        sudo apt-get install --no-install-recommends -y libopenmpi-dev openmpi-bin
36
37
    fi
    if [[ $TASK == "gpu" ]]; then
38
39
        if [[ $TRAVIS == "true" ]]; then
            sudo add-apt-repository ppa:kzemek/boost -y
40
        fi
41
42
        sudo apt-get update
        sudo apt-get install --no-install-recommends -y libboost1.58-dev libboost-system1.58-dev libboost-filesystem1.58-dev ocl-icd-opencl-dev
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
        cd $HOME_DIRECTORY
        wget -q https://github.com/Microsoft/LightGBM/releases/download/v2.0.12/AMD-APP-SDKInstaller-v3.0.130.136-GA-linux64.tar.bz2
        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
    if [[ $TRAVIS == "true" ]]; then
        wget -O conda.sh https://repo.continuum.io/miniconda/Miniconda${PYTHON_VERSION:0:1}-latest-Linux-x86_64.sh
    fi
fi

if [[ $TRAVIS == "true" ]]; then
    sh conda.sh -b -p $HOME_DIRECTORY/miniconda
fi
60
61
conda config --set always_yes yes --set changeps1 no
conda update -q conda