Unverified Commit 552fafc7 authored by shiyu1994's avatar shiyu1994 Committed by GitHub
Browse files

Merge branch 'master' into rocm3

parents 5acc6781 7c10e6d8
version: 4.6.0.99.{build} version: 4.6.0.99.{build}
image: Visual Studio 2015 image: Visual Studio 2017
platform: x64 platform: x64
configuration: configuration:
- '3.9' - '3.9'
......
...@@ -153,7 +153,7 @@ if [[ "${TASK}" != "cpp-tests" ]] && [[ "${TASK}" != "r-package" ]]; then ...@@ -153,7 +153,7 @@ if [[ "${TASK}" != "cpp-tests" ]] && [[ "${TASK}" != "r-package" ]]; then
sh miniforge.sh -b -p "${CONDA}" sh miniforge.sh -b -p "${CONDA}"
fi fi
conda config --set always_yes yes --set changeps1 no conda config --set always_yes yes --set changeps1 no
conda update -q -y conda conda update -q -y conda conda-libmamba-solver
# print output of 'conda info', to help in submitting bug reports # print output of 'conda info', to help in submitting bug reports
echo "conda info:" echo "conda info:"
......
...@@ -153,6 +153,10 @@ elif [[ $R_BUILD_TYPE == "cran" ]]; then ...@@ -153,6 +153,10 @@ elif [[ $R_BUILD_TYPE == "cran" ]]; then
cd "${R_CMD_CHECK_DIR}" cd "${R_CMD_CHECK_DIR}"
fi fi
if [[ $PRODUCES_ARTIFACTS == "true" ]]; then
cp "${PKG_TARBALL}" "${BUILD_ARTIFACTSTAGINGDIRECTORY}/lightgbm-${LGB_VER}-r-cran.tar.gz"
fi
declare -i allowed_notes=0 declare -i allowed_notes=0
bash "${BUILD_DIRECTORY}/.ci/run-r-cmd-check.sh" \ bash "${BUILD_DIRECTORY}/.ci/run-r-cmd-check.sh" \
"${PKG_TARBALL}" \ "${PKG_TARBALL}" \
......
...@@ -66,7 +66,7 @@ if ($env:TASK -eq "swig") { ...@@ -66,7 +66,7 @@ if ($env:TASK -eq "swig") {
conda init powershell conda init powershell
conda activate conda activate
conda config --set always_yes yes --set changeps1 no conda config --set always_yes yes --set changeps1 no
conda update -q -y conda "python=$env:PYTHON_VERSION[build=*_cp*]" conda update -q -y conda conda-libmamba-solver "python=$env:PYTHON_VERSION[build=*_cp*]"
# print output of 'conda info', to help in submitting bug reports # print output of 'conda info', to help in submitting bug reports
Write-Output "conda info:" Write-Output "conda info:"
......
...@@ -13,6 +13,9 @@ ARCH=$(uname -m) ...@@ -13,6 +13,9 @@ ARCH=$(uname -m)
LGB_VER=$(head -n 1 "${BUILD_DIRECTORY}/VERSION.txt") LGB_VER=$(head -n 1 "${BUILD_DIRECTORY}/VERSION.txt")
# create the artifact upload directory if it doesn't exist yet
mkdir -p "${BUILD_ARTIFACTSTAGINGDIRECTORY}"
if [[ $OS_NAME == "macos" ]] && [[ $COMPILER == "gcc" ]]; then if [[ $OS_NAME == "macos" ]] && [[ $COMPILER == "gcc" ]]; then
export CXX=g++-14 export CXX=g++-14
export CC=gcc-14 export CC=gcc-14
......
...@@ -74,9 +74,11 @@ jobs: ...@@ -74,9 +74,11 @@ jobs:
uses: actions/checkout@v5 uses: actions/checkout@v5
with: with:
fetch-depth: 5 fetch-depth: 5
persist-credentials: false
submodules: true submodules: true
- name: Setup and run tests - name: Setup and run tests
run: | run: |
export BUILD_ARTIFACTSTAGINGDIRECTORY="${{ github.workspace }}/artifacts"
export BUILD_DIRECTORY="$GITHUB_WORKSPACE" export BUILD_DIRECTORY="$GITHUB_WORKSPACE"
export PATH=$CONDA/bin:$PATH export PATH=$CONDA/bin:$PATH
......
...@@ -21,6 +21,7 @@ jobs: ...@@ -21,6 +21,7 @@ jobs:
uses: actions/checkout@v5 uses: actions/checkout@v5
with: with:
fetch-depth: 5 fetch-depth: 5
persist-credentials: false
submodules: false submodules: false
- name: Setup and run tests - name: Setup and run tests
run: | run: |
......
...@@ -14,6 +14,7 @@ jobs: ...@@ -14,6 +14,7 @@ jobs:
uses: actions/checkout@v5 uses: actions/checkout@v5
with: with:
fetch-depth: 5 fetch-depth: 5
persist-credentials: false
submodules: false submodules: false
- name: Check that all tests succeeded - name: Check that all tests succeeded
shell: bash shell: bash
......
...@@ -14,6 +14,9 @@ concurrency: ...@@ -14,6 +14,9 @@ concurrency:
cancel-in-progress: true cancel-in-progress: true
env: env:
# tell scripts where to put artifacts
# (this variable name is left over from when jobs ran on Azure DevOps)
BUILD_ARTIFACTSTAGINGDIRECTORY: '${{ github.workspace }}/artifacts'
CMAKE_BUILD_PARALLEL_LEVEL: 4 CMAKE_BUILD_PARALLEL_LEVEL: 4
SKBUILD_STRICT_CONFIG: true SKBUILD_STRICT_CONFIG: true
...@@ -27,6 +30,7 @@ jobs: ...@@ -27,6 +30,7 @@ jobs:
uses: actions/checkout@v5 uses: actions/checkout@v5
with: with:
fetch-depth: 5 fetch-depth: 5
persist-credentials: false
submodules: true submodules: true
- name: Setup and run tests - name: Setup and run tests
shell: bash shell: bash
...@@ -106,6 +110,7 @@ jobs: ...@@ -106,6 +110,7 @@ jobs:
uses: actions/checkout@v5 uses: actions/checkout@v5
with: with:
fetch-depth: 5 fetch-depth: 5
persist-credentials: false
submodules: true submodules: true
- name: Setup and run tests - name: Setup and run tests
shell: bash shell: bash
...@@ -140,6 +145,7 @@ jobs: ...@@ -140,6 +145,7 @@ jobs:
uses: actions/checkout@v5 uses: actions/checkout@v5
with: with:
fetch-depth: 5 fetch-depth: 5
persist-credentials: false
submodules: true submodules: true
- name: Create wheel - name: Create wheel
run: | run: |
...@@ -174,6 +180,7 @@ jobs: ...@@ -174,6 +180,7 @@ jobs:
uses: actions/checkout@v5 uses: actions/checkout@v5
with: with:
fetch-depth: 5 fetch-depth: 5
persist-credentials: false
submodules: true submodules: true
- name: Create wheel - name: Create wheel
run: | run: |
......
...@@ -14,6 +14,9 @@ concurrency: ...@@ -14,6 +14,9 @@ concurrency:
cancel-in-progress: true cancel-in-progress: true
env: env:
# tell scripts where to put artifacts
# (this variable name is left over from when jobs ran on Azure DevOps)
BUILD_ARTIFACTSTAGINGDIRECTORY: '${{ github.workspace }}/artifacts'
# in CMake-driven builds, parallelize compilation # in CMake-driven builds, parallelize compilation
CMAKE_BUILD_PARALLEL_LEVEL: 4 CMAKE_BUILD_PARALLEL_LEVEL: 4
# on Debian-based images, avoid interactive prompts # on Debian-based images, avoid interactive prompts
...@@ -114,6 +117,8 @@ jobs: ...@@ -114,6 +117,8 @@ jobs:
r_version: 4.3 r_version: 4.3
build_type: cran build_type: cran
container: 'ubuntu:22.04' container: 'ubuntu:22.04'
produces-artifacts: 'true'
artifact-name: r-cran-package
- os: macos-13 - os: macos-13
task: r-package task: r-package
compiler: clang compiler: clang
...@@ -160,6 +165,7 @@ jobs: ...@@ -160,6 +165,7 @@ jobs:
uses: actions/checkout@v5 uses: actions/checkout@v5
with: with:
fetch-depth: 5 fetch-depth: 5
persist-credentials: false
submodules: true submodules: true
- name: Install pandoc - name: Install pandoc
uses: r-lib/actions/setup-pandoc@v2 uses: r-lib/actions/setup-pandoc@v2
...@@ -182,6 +188,8 @@ jobs: ...@@ -182,6 +188,8 @@ jobs:
export IN_UBUNTU_BASE_CONTAINER="true" export IN_UBUNTU_BASE_CONTAINER="true"
fi fi
export BUILD_DIRECTORY="$GITHUB_WORKSPACE" export BUILD_DIRECTORY="$GITHUB_WORKSPACE"
export LGB_VER=$(head -n 1 "${BUILD_DIRECTORY}/VERSION.txt")
export PRODUCES_ARTIFACTS="${{ matrix.produces-artifacts }}"
export R_VERSION="${{ matrix.r_version }}" export R_VERSION="${{ matrix.r_version }}"
export R_BUILD_TYPE="${{ matrix.build_type }}" export R_BUILD_TYPE="${{ matrix.build_type }}"
$GITHUB_WORKSPACE/.ci/setup.sh $GITHUB_WORKSPACE/.ci/setup.sh
...@@ -198,6 +206,13 @@ jobs: ...@@ -198,6 +206,13 @@ jobs:
$env:COMPILER = "${{ matrix.compiler }}" $env:COMPILER = "${{ matrix.compiler }}"
$env:TASK = "${{ matrix.task }}" $env:TASK = "${{ matrix.task }}"
& "$env:GITHUB_WORKSPACE/.ci/test-windows.ps1" & "$env:GITHUB_WORKSPACE/.ci/test-windows.ps1"
- name: Upload artifacts
if: ${{ matrix.produces-artifacts == 'true' }}
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact-name }}
path: ${{ env.BUILD_ARTIFACTSTAGINGDIRECTORY }}/*.tar.gz
if-no-files-found: error
test-r-sanitizers: test-r-sanitizers:
name: r-sanitizers (ubuntu-latest, R-devel, ${{ matrix.compiler }} ASAN/UBSAN) name: r-sanitizers (ubuntu-latest, R-devel, ${{ matrix.compiler }} ASAN/UBSAN)
timeout-minutes: 60 timeout-minutes: 60
...@@ -219,6 +234,7 @@ jobs: ...@@ -219,6 +234,7 @@ jobs:
uses: actions/checkout@v5 uses: actions/checkout@v5
with: with:
fetch-depth: 5 fetch-depth: 5
persist-credentials: false
submodules: true submodules: true
- name: Install packages - name: Install packages
shell: bash shell: bash
...@@ -259,6 +275,7 @@ jobs: ...@@ -259,6 +275,7 @@ jobs:
uses: actions/checkout@v5 uses: actions/checkout@v5
with: with:
fetch-depth: 5 fetch-depth: 5
persist-credentials: false
submodules: true submodules: true
- name: Install pandoc - name: Install pandoc
uses: r-lib/actions/setup-pandoc@v2 uses: r-lib/actions/setup-pandoc@v2
......
...@@ -28,6 +28,7 @@ jobs: ...@@ -28,6 +28,7 @@ jobs:
with: with:
fetch-depth: 5 fetch-depth: 5
submodules: true submodules: true
persist-credentials: false
repository: microsoft/LightGBM repository: microsoft/LightGBM
ref: "refs/pull/${{ github.event.client_payload.pr_number }}/merge" ref: "refs/pull/${{ github.event.client_payload.pr_number }}/merge"
- name: Send init status - name: Send init status
......
...@@ -30,6 +30,7 @@ jobs: ...@@ -30,6 +30,7 @@ jobs:
uses: actions/checkout@v5 uses: actions/checkout@v5
with: with:
fetch-depth: 5 fetch-depth: 5
persist-credentials: false
submodules: false submodules: false
- name: Setup and run tests - name: Setup and run tests
shell: bash shell: bash
...@@ -48,6 +49,7 @@ jobs: ...@@ -48,6 +49,7 @@ jobs:
uses: actions/checkout@v5 uses: actions/checkout@v5
with: with:
fetch-depth: 5 fetch-depth: 5
persist-credentials: false
submodules: false submodules: false
- name: Setup and run tests - name: Setup and run tests
shell: bash shell: bash
...@@ -70,6 +72,7 @@ jobs: ...@@ -70,6 +72,7 @@ jobs:
uses: actions/checkout@v5 uses: actions/checkout@v5
with: with:
fetch-depth: 5 fetch-depth: 5
persist-credentials: false
submodules: true submodules: true
- name: Install packages - name: Install packages
shell: bash shell: bash
......
...@@ -18,6 +18,7 @@ jobs: ...@@ -18,6 +18,7 @@ jobs:
uses: actions/checkout@v5 uses: actions/checkout@v5
with: with:
fetch-depth: 5 fetch-depth: 5
persist-credentials: false
submodules: false submodules: false
- name: Trigger R valgrind tests - name: Trigger R valgrind tests
......
...@@ -331,33 +331,6 @@ jobs: ...@@ -331,33 +331,6 @@ jobs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)' pathtoPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: PackageAssets artifactName: PackageAssets
artifactType: container artifactType: container
##############
# R_artifact #
##############
- job: R_artifact
condition: not(startsWith(variables['Build.SourceBranch'], 'refs/pull/'))
pool:
vmImage: 'ubuntu-22.04'
container: rbase
steps:
- script: |
git clean -d -f -x
displayName: 'Clean source directory'
- script: |
LGB_VER=$(head -n 1 VERSION.txt | sed "s/rc/-/g")
R_LIB_PATH=~/Rlib
export R_LIBS=${R_LIB_PATH}
mkdir -p ${R_LIB_PATH}
RDscript .ci/install-r-deps.R --build --include=RhpcBLASctl || exit 1
sh build-cran-package.sh --r-executable=RD || exit 1
mv lightgbm_${LGB_VER}.tar.gz $(Build.ArtifactStagingDirectory)/lightgbm-${LGB_VER}-r-cran.tar.gz
displayName: 'Build CRAN R-package'
- task: PublishBuildArtifacts@1
condition: succeeded()
inputs:
pathtoPublish: $(Build.ArtifactStagingDirectory)
artifactName: R-package
artifactType: container
########### ###########
# Package # # Package #
...@@ -368,7 +341,6 @@ jobs: ...@@ -368,7 +341,6 @@ jobs:
- Linux_latest - Linux_latest
- macOS - macOS
- Windows - Windows
- R_artifact
condition: and(succeeded(), not(startsWith(variables['Build.SourceBranch'], 'refs/pull/'))) condition: and(succeeded(), not(startsWith(variables['Build.SourceBranch'], 'refs/pull/')))
pool: pool:
vmImage: 'ubuntu-22.04' vmImage: 'ubuntu-22.04'
...@@ -399,12 +371,6 @@ jobs: ...@@ -399,12 +371,6 @@ jobs:
inputs: inputs:
artifactName: PackageAssets artifactName: PackageAssets
downloadPath: $(Build.SourcesDirectory)/binaries downloadPath: $(Build.SourcesDirectory)/binaries
- task: DownloadBuildArtifacts@0
displayName: Download R-package
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/v'))
inputs:
artifactName: R-package
downloadPath: $(Build.SourcesDirectory)/R
- script: | - script: |
python "$(Build.SourcesDirectory)/.ci/create-nuget.py" "$(Build.SourcesDirectory)/binaries/PackageAssets" python "$(Build.SourcesDirectory)/.ci/create-nuget.py" "$(Build.SourcesDirectory)/binaries/PackageAssets"
displayName: 'Create NuGet configuration files' displayName: 'Create NuGet configuration files'
...@@ -430,7 +396,6 @@ jobs: ...@@ -430,7 +396,6 @@ jobs:
title: '$(Build.SourceBranchName)' title: '$(Build.SourceBranchName)'
assets: | assets: |
$(Build.SourcesDirectory)/binaries/PackageAssets/* $(Build.SourcesDirectory)/binaries/PackageAssets/*
$(Build.SourcesDirectory)/R/R-package/*
$(Build.ArtifactStagingDirectory)/nuget/*.nupkg $(Build.ArtifactStagingDirectory)/nuget/*.nupkg
$(Build.ArtifactStagingDirectory)/archives/* $(Build.ArtifactStagingDirectory)/archives/*
assetUploadMode: 'delete' assetUploadMode: 'delete'
......
...@@ -128,6 +128,14 @@ If you want to force `LightGBM` to use MSYS2 (for any R version), pass `--use-ms ...@@ -128,6 +128,14 @@ If you want to force `LightGBM` to use MSYS2 (for any R version), pass `--use-ms
Rscript build_r.R --use-msys2 Rscript build_r.R --use-msys2
``` ```
**MinGW**
If you want to force `LightGBM` to use [MinGW](https://www.mingw-w64.org/) (for any R version), pass `--use-mingw` to the installation script.
```shell
Rscript build_r.R --use-mingw
```
#### Mac OS Preparation #### Mac OS Preparation
You can perform installation either with **Apple Clang** or **gcc**. In case you prefer **Apple Clang**, you should install **OpenMP** (details for installation can be found in [Installation Guide](https://github.com/microsoft/LightGBM/blob/master/docs/Installation-Guide.rst#apple-clang)) first. In case you prefer **gcc**, you need to install it (details for installation can be found in [Installation Guide](https://github.com/microsoft/LightGBM/blob/master/docs/Installation-Guide.rst#gcc)) and set some environment variables to tell R to use `gcc` and `g++`. If you install these from Homebrew, your versions of `g++` and `gcc` are most likely in `/usr/local/bin`, as shown below. You can perform installation either with **Apple Clang** or **gcc**. In case you prefer **Apple Clang**, you should install **OpenMP** (details for installation can be found in [Installation Guide](https://github.com/microsoft/LightGBM/blob/master/docs/Installation-Guide.rst#apple-clang)) first. In case you prefer **gcc**, you need to install it (details for installation can be found in [Installation Guide](https://github.com/microsoft/LightGBM/blob/master/docs/Installation-Guide.rst#gcc)) and set some environment variables to tell R to use `gcc` and `g++`. If you install these from Homebrew, your versions of `g++` and `gcc` are most likely in `/usr/local/bin`, as shown below.
......
...@@ -11,7 +11,6 @@ CXX17=`"${R_EXE}" CMD config CXX17` ...@@ -11,7 +11,6 @@ CXX17=`"${R_EXE}" CMD config CXX17`
CXX17STD=`"${R_EXE}" CMD config CXX17STD` CXX17STD=`"${R_EXE}" CMD config CXX17STD`
CXX="${CXX17} ${CXX17STD}" CXX="${CXX17} ${CXX17STD}"
CXXFLAGS=`"${R_EXE}" CMD config CXX17FLAGS` CXXFLAGS=`"${R_EXE}" CMD config CXX17FLAGS`
CXX_STD="CXX17"
CPPFLAGS=`"${R_EXE}" CMD config CPPFLAGS` CPPFLAGS=`"${R_EXE}" CMD config CPPFLAGS`
# LightGBM-specific flags # LightGBM-specific flags
...@@ -98,9 +97,6 @@ then ...@@ -98,9 +97,6 @@ then
fi fi
# Generate Makevars.win from Makevars.win.in # Generate Makevars.win from Makevars.win.in
sed -e \
"s/@CXX_STD@/$CXX_STD/" \
< src/Makevars.win.in > src/Makevars.win
sed -e \ sed -e \
"s/@LGB_CPPFLAGS@/$LGB_CPPFLAGS/" \ "s/@LGB_CPPFLAGS@/$LGB_CPPFLAGS/" \
< src/Makevars.win.in > src/Makevars.win < src/Makevars.win.in > src/Makevars.win
CXX_STD = @CXX_STD@ CXX_STD = CXX17
PKGROOT=. PKGROOT=.
......
...@@ -15,8 +15,6 @@ if (.Machine$sizeof.pointer != 8L) { ...@@ -15,8 +15,6 @@ if (.Machine$sizeof.pointer != 8L) {
stop("LightGBM only supports 64-bit R, please check the version of R and Rtools.") stop("LightGBM only supports 64-bit R, please check the version of R and Rtools.")
} }
R_ver <- as.double(R.Version()$major) + as.double(R.Version()$minor) / 10.0
# Get some paths # Get some paths
source_dir <- file.path(R_PACKAGE_SOURCE, "src", fsep = "/") source_dir <- file.path(R_PACKAGE_SOURCE, "src", fsep = "/")
build_dir <- file.path(source_dir, "build", fsep = "/") build_dir <- file.path(source_dir, "build", fsep = "/")
...@@ -67,7 +65,6 @@ inst_dir <- file.path(R_PACKAGE_SOURCE, "inst", fsep = "/") ...@@ -67,7 +65,6 @@ inst_dir <- file.path(R_PACKAGE_SOURCE, "inst", fsep = "/")
"Visual Studio 17 2022" "Visual Studio 17 2022"
, "Visual Studio 16 2019" , "Visual Studio 16 2019"
, "Visual Studio 15 2017" , "Visual Studio 15 2017"
, "Visual Studio 14 2015"
) )
working_vs_version <- NULL working_vs_version <- NULL
for (vs_version in vs_versions) { for (vs_version in vs_versions) {
...@@ -162,11 +159,7 @@ if (use_mingw) { ...@@ -162,11 +159,7 @@ if (use_mingw) {
# Rtools 4.0 moved from MinGW to MSYS toolchain. If user tries # Rtools 4.0 moved from MinGW to MSYS toolchain. If user tries
# Visual Studio install but that fails, fall back to the toolchain # Visual Studio install but that fails, fall back to the toolchain
# supported in Rtools # supported in Rtools
if (R_ver >= 4.0) { windows_toolchain <- "MSYS2"
windows_toolchain <- "MSYS2"
} else {
windows_toolchain <- "MinGW"
}
} }
windows_build_tool <- WINDOWS_BUILD_TOOLS[[windows_toolchain]][["build_tool"]] windows_build_tool <- WINDOWS_BUILD_TOOLS[[windows_toolchain]][["build_tool"]]
windows_makefile_generator <- WINDOWS_BUILD_TOOLS[[windows_toolchain]][["makefile_generator"]] windows_makefile_generator <- WINDOWS_BUILD_TOOLS[[windows_toolchain]][["makefile_generator"]]
......
...@@ -39,7 +39,7 @@ data.table::setDTthreads(1L) ...@@ -39,7 +39,7 @@ data.table::setDTthreads(1L)
# [description] # [description]
# test that every element of 'x' is in 'y' # test that every element of 'x' is in 'y'
# #
# testthat::expect_in() was added in {testthat} v3.1.19 # testthat::expect_in() was added in {testthat} v3.1.19.
# This is here to support a similar interface on older {testthat} versions. # This is here to support a similar interface on older {testthat} versions.
.expect_in <- function(x, y) { .expect_in <- function(x, y) {
if (exists("expect_in")) { if (exists("expect_in")) {
......
...@@ -78,8 +78,6 @@ if(WIN32) ...@@ -78,8 +78,6 @@ if(WIN32)
set(MSVC_TOOLCHAIN_ID "142") set(MSVC_TOOLCHAIN_ID "142")
elseif(${MSVC_VERSION} GREATER 1909) elseif(${MSVC_VERSION} GREATER 1909)
set(MSVC_TOOLCHAIN_ID "141") set(MSVC_TOOLCHAIN_ID "141")
elseif(${MSVC_VERSION} GREATER 1899)
set(MSVC_TOOLCHAIN_ID "140")
else() else()
message(FATAL_ERROR "Unsupported MSVC version number: ${MSVC_VERSION}") message(FATAL_ERROR "Unsupported MSVC version number: ${MSVC_VERSION}")
endif() endif()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment