Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ci] dowgrade gcc version for Linux on Azure #1718

Merged
merged 12 commits into from
Oct 3, 2018
20 changes: 12 additions & 8 deletions .ci/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,25 @@ if [[ $OS_NAME == "macos" ]]; then
wget -O conda.sh https://repo.continuum.io/miniconda/Miniconda${PYTHON_VERSION:0:1}-latest-MacOSX-x86_64.sh
fi
else # Linux
sudo apt-get update
if [[ $AZURE == "true" ]] && [[ $COMPILER == "clang" ]]; then
update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-6.0 100
update-alternatives --install /usr/bin/clang clang /usr/bin/clang-6.0 100
sudo apt-get update
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
sudo apt-get install libomp-dev
elif [[ $AZURE == "true" ]] && [[ $COMPILER == "gcc" ]] && [[ $TASK != "gpu" ]]; then
# downgrade gcc version
sudo apt-get remove -y gcc || exit -1
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
sudo apt-get update
sudo apt-get install --no-install-recommends -y g++-4.8 || exit -1
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 100
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 100
fi
if [[ $TASK == "mpi" ]]; then
if [[ $AZURE == "true" ]]; then
sudo apt-get update
fi
sudo apt-get install -y libopenmpi-dev openmpi-bin
sudo apt-get install --no-install-recommends -y libopenmpi-dev openmpi-bin
fi
if [[ $TASK == "gpu" ]]; then
if [[ $AZURE == "true" ]]; then
sudo apt-get update
sudo apt-get install --no-install-recommends -y libboost-dev libboost-system-dev libboost-filesystem-dev
fi
sudo apt-get install --no-install-recommends -y ocl-icd-opencl-dev
Expand Down
10 changes: 5 additions & 5 deletions .vsts-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ phases:
- bash: $(Build.SourcesDirectory)/.ci/test.sh
displayName: Test
- task: PublishBuildArtifacts@1
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
condition: and(succeeded(), not(startsWith(variables['Build.SourceBranch'], 'refs/pull/')))
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: PackageAssets
Expand All @@ -64,7 +64,7 @@ phases:
variables:
COMPILER: clang
queue:
name: 'Hosted macOS Preview'
name: 'Hosted macOS'
parallel: 3
matrix:
regular:
Expand Down Expand Up @@ -97,7 +97,7 @@ phases:
- bash: $(Build.SourcesDirectory)/.ci/test.sh
displayName: Test
- task: PublishBuildArtifacts@1
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
condition: and(succeeded(), not(startsWith(variables['Build.SourceBranch'], 'refs/pull/')))
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: PackageAssets
Expand Down Expand Up @@ -128,7 +128,7 @@ phases:
- powershell: $(Build.SourcesDirectory)/.ci/test_windows.ps1
displayName: Test
- task: PublishBuildArtifacts@1
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
condition: and(succeeded(), not(startsWith(variables['Build.SourceBranch'], 'refs/pull/')))
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: PackageAssets
Expand All @@ -141,7 +141,7 @@ phases:
- Linux
- MacOS
- Windows
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
condition: and(succeeded(), not(startsWith(variables['Build.SourceBranch'], 'refs/pull/')))
queue:
name: 'Hosted VS2017'
steps:
Expand Down
2 changes: 1 addition & 1 deletion src/metric/regression_metric.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ class GammaMetric : public RegressionMetric<GammaMetric> {
const double theta = -1.0 / score;
const double a = psi;
const double b = -std::log(-theta);
const double c = 1. / psi * std::log(label / psi) - std::log(label) - std::lgamma(1.0 / psi);
const double c = 1. / psi * std::log(label / psi) - std::log(label) - 0; // 0 = std::lgamma(1.0 / psi) = std::lgamma(1.0);
return -((label * theta - b) / a + c);
}
inline static const char* Name() {
Expand Down