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

if [[ $TRAVIS_OS_NAME == "osx" ]]; then
4
5
6
7
8
9
10
11
12
13
14
15
    if  [[ $COMPILER == "clang" ]]; then
        brew install libomp
        brew reinstall cmake  # CMake >=3.12 is needed to find OpenMP at macOS
    else
        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"
        rm '/usr/local/include/c++'
#        brew cask uninstall oclint  #  reserve variant to deal with conflict link
        if [[ $TASK != "mpi" ]]; then
            brew install gcc
        fi
#        brew link --overwrite gcc  # previous variant to deal with conflict link
    fi
16
    if [[ $TASK == "mpi" ]]; then
17
18
        brew install open-mpi
    fi
19
    wget -O conda.sh https://repo.continuum.io/miniconda/Miniconda${PYTHON_VERSION:0:1}-latest-MacOSX-x86_64.sh
20
else  # Linux
21
    if [[ $TASK == "mpi" ]]; then
22
23
        sudo apt-get install -y libopenmpi-dev openmpi-bin
    fi
24
    if [[ $TASK == "gpu" ]]; then
25
        sudo apt-get install -y ocl-icd-opencl-dev
26
27
28
29
30
31
32
        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
wxchan's avatar
wxchan committed
33
    fi
34
    wget -O conda.sh https://repo.continuum.io/miniconda/Miniconda${PYTHON_VERSION:0:1}-latest-Linux-x86_64.sh
wxchan's avatar
wxchan committed
35
fi
36
37
38
39

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