Skip to content

Commit

Permalink
Merge branch 'master' into newer-scikit-build-core
Browse files Browse the repository at this point in the history
  • Loading branch information
jameslamb committed Jan 28, 2024
2 parents 8c6a8e3 + 252828f commit 220f7db
Show file tree
Hide file tree
Showing 11 changed files with 134 additions and 58 deletions.
2 changes: 1 addition & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: 4.2.0.99.{build}
version: 4.3.0.{build}

image: Visual Studio 2015
platform: x64
Expand Down
71 changes: 71 additions & 0 deletions .ci/install-clang-devel.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
#!/bin/bash

# [description]
#
# Installs a development version of clang and the other LLVM tools.
#

set -e -E -u -o pipefail

CLANG_VERSION=${1}

apt-get autoremove -y --purge \
clang-* \
libclang-* \
libunwind-* \
llvm-*

apt-get update -y
apt-get install --no-install-recommends -y \
gnupg \
lsb-release \
software-properties-common \
wget

wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -

# ref: https://apt.llvm.org/
add-apt-repository -y "deb http://apt.llvm.org/unstable/ llvm-toolchain main"
add-apt-repository -y "deb-src http://apt.llvm.org/unstable/ llvm-toolchain main"

apt-get install -y --no-install-recommends \
clang-${CLANG_VERSION} \
clangd-${CLANG_VERSION} \
clang-format-${CLANG_VERSION} \
clang-tidy-${CLANG_VERSION} \
clang-tools-${CLANG_VERSION} \
lldb-${CLANG_VERSION} \
lld-${CLANG_VERSION} \
llvm-${CLANG_VERSION}-dev \
llvm-${CLANG_VERSION}-tools \
libomp-${CLANG_VERSION}-dev \
libc++-${CLANG_VERSION}-dev \
libc++abi-${CLANG_VERSION}-dev \
libclang-common-${CLANG_VERSION}-dev \
libclang-${CLANG_VERSION}-dev \
libclang-cpp${CLANG_VERSION}-dev \
libunwind-${CLANG_VERSION}-dev

# overwriting the stuff in /usr/bin is simpler and more reliable than
# updating PATH, LD_LIBRARY_PATH, etc.
cp --remove-destination /usr/lib/llvm-${CLANG_VERSION}/bin/* /usr/bin/

# per https://www.stats.ox.ac.uk/pub/bdr/Rconfig/r-devel-linux-x86_64-fedora-clang
#
# clang was built to use libc++: for a version built to default to libstdc++
# (as shipped by Fedora/Debian/Ubuntu), add -stdlib=libc++ to CXX
# and install the libcxx-devel/libc++-dev package.
mkdir -p "${HOME}/.R"

cat << EOF > "${HOME}/.R/Makevars"
CXX += -stdlib=libc++
CXX11 += -stdlib=libc++
CXX14 += -stdlib=libc++
CXX17 += -stdlib=libc++
CXX20 += -stdlib=libc++
EOF

echo ""
echo "done installing clang"
clang --version
echo ""
4 changes: 2 additions & 2 deletions .ci/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -319,9 +319,9 @@ matplotlib.use\(\"Agg\"\)\
jupyter nbconvert --ExecutePreprocessor.timeout=180 --to notebook --execute --inplace *.ipynb || exit -1 # run all notebooks

# importing the library should succeed even if all optional dependencies are not present
conda uninstall --force --yes \
conda uninstall -n $CONDA_ENV --force --yes \
cffi \
dask \
dask-core \
distributed \
joblib \
matplotlib \
Expand Down
59 changes: 19 additions & 40 deletions .github/workflows/r_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -258,10 +258,21 @@ jobs:
cat ./tests.log
exit ${exit_code}
test-r-debian-clang:
name: r-package (debian, R-devel, clang)
name: r-package (debian, R-devel, clang-${{ matrix.clang-version }})
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
# list of versions tested in CRAN "Additional Checks":
# https://cran.r-project.org/web/checks/check_issue_kinds.html
clang-version:
- 16
- 17
- 18
runs-on: ubuntu-latest
container: rhub/debian-clang-devel
env:
DEBIAN_FRONTEND: noninteractive
steps:
- name: Install Git before checkout
shell: bash
Expand All @@ -276,53 +287,21 @@ jobs:
with:
fetch-depth: 5
submodules: true
- name: update to clang 15
shell: bash
- name: install clang
run: |
# remove clang stuff that comes installed in the image
apt-get autoremove -y --purge \
clang-* \
libclang-* \
libunwind-* \
llvm-*
#
# replace it all with clang-15
apt-get update -y
apt-get install --no-install-recommends -y \
gnupg \
lsb-release \
software-properties-common \
wget
#
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
#
add-apt-repository "deb http://apt.llvm.org/unstable/ llvm-toolchain main"
apt-get install -y --no-install-recommends \
clang-15 \
clangd-15 \
clang-format-15 \
clang-tidy-15 \
clang-tools-15 \
lldb-15 \
lld-15 \
llvm-15-dev \
llvm-15-tools \
libomp-15-dev \
libc++-15-dev \
libc++abi-15-dev \
libclang-common-15-dev \
libclang-15-dev \
libclang-cpp15-dev \
libunwind-15-dev
# overwrite everything in /usr/bin with the new v15 versions
cp --remove-destination /usr/lib/llvm-15/bin/* /usr/bin/
./.ci/install-clang-devel.sh ${{ matrix.clang-version }}
- name: Install packages and run tests
shell: bash
run: |
export PATH=/opt/R-devel/bin/:${PATH}
Rscript -e "install.packages(c('R6', 'data.table', 'jsonlite', 'knitr', 'markdown', 'Matrix', 'RhpcBLASctl', 'testthat'), repos = 'https://cran.rstudio.com', Ncpus = parallel::detectCores())"
sh build-cran-package.sh
R CMD check --as-cran --run-donttest lightgbm_*.tar.gz || exit -1
echo ""
echo "install logs:"
echo ""
cat lightgbm.Rcheck/00install.out
echo ""
if grep -q -E "NOTE|WARNING|ERROR" lightgbm.Rcheck/00check.log; then
echo "NOTEs, WARNINGs, or ERRORs have been found by R CMD check"
exit -1
Expand Down
11 changes: 9 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ if(USE_CUDA)
list(APPEND CUDA_ARCHS "8.7")
endif()
if(CUDA_VERSION VERSION_GREATER_EQUAL "11.8")
list(APPEND CUDA_ARCHS "8.9")
list(APPEND CUDA_ARCHS "9.0")
endif()
list(POP_BACK CUDA_ARCHS CUDA_LAST_SUPPORTED_ARCH)
Expand Down Expand Up @@ -428,7 +429,10 @@ file(
src/network/*.cpp
src/treelearner/*.cpp
src/utils/*.cpp
if(USE_CUDA)
)
file(
GLOB
LGBM_CUDA_SOURCES
src/treelearner/*.cu
src/boosting/cuda/*.cpp
src/boosting/cuda/*.cu
Expand All @@ -442,9 +446,12 @@ if(USE_CUDA)
src/io/cuda/*.cpp
src/cuda/*.cpp
src/cuda/*.cu
endif()
)

if(USE_CUDA)
list(APPEND SOURCES ${LGBM_CUDA_SOURCES})
endif()

add_library(lightgbm_objs OBJECT ${SOURCES})

if(BUILD_CLI)
Expand Down
18 changes: 9 additions & 9 deletions R-package/configure
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.71 for lightgbm 4.2.0.99.
# Generated by GNU Autoconf 2.71 for lightgbm 4.3.0.
#
#
# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation,
Expand Down Expand Up @@ -607,8 +607,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='lightgbm'
PACKAGE_TARNAME='lightgbm'
PACKAGE_VERSION='4.2.0.99'
PACKAGE_STRING='lightgbm 4.2.0.99'
PACKAGE_VERSION='4.3.0'
PACKAGE_STRING='lightgbm 4.3.0'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''

Expand Down Expand Up @@ -1211,7 +1211,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures lightgbm 4.2.0.99 to adapt to many kinds of systems.
\`configure' configures lightgbm 4.3.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
Expand Down Expand Up @@ -1273,7 +1273,7 @@ fi

if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of lightgbm 4.2.0.99:";;
short | recursive ) echo "Configuration of lightgbm 4.3.0:";;
esac
cat <<\_ACEOF
Expand Down Expand Up @@ -1341,7 +1341,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
lightgbm configure 4.2.0.99
lightgbm configure 4.3.0
generated by GNU Autoconf 2.71
Copyright (C) 2021 Free Software Foundation, Inc.
Expand Down Expand Up @@ -1378,7 +1378,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by lightgbm $as_me 4.2.0.99, which was
It was created by lightgbm $as_me 4.3.0, which was
generated by GNU Autoconf 2.71. Invocation command line was
$ $0$ac_configure_args_raw
Expand Down Expand Up @@ -2454,7 +2454,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by lightgbm $as_me 4.2.0.99, which was
This file was extended by lightgbm $as_me 4.3.0, which was
generated by GNU Autoconf 2.71. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
Expand Down Expand Up @@ -2509,7 +2509,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config='$ac_cs_config_escaped'
ac_cs_version="\\
lightgbm config.status 4.2.0.99
lightgbm config.status 4.3.0
configured by $0, generated by GNU Autoconf 2.71,
with options \\"\$ac_cs_config\\"
Expand Down
20 changes: 20 additions & 0 deletions R-package/cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
# CRAN Submission History

## v4.3.0 - Submission 1 - (January 18, 2024)

### CRAN response

Accepted to CRAN

### Maintainer Notes

This submission was put up in response to CRAN saying the package would be archived if the following
warning was not fixed within 14 days.

```text
/usr/local/clang-trunk/bin/../include/c++/v1/__fwd/string_view.h:22:41:
warning: 'char_traits<fmt::detail::char8_type>' is deprecated:
char_traits<T> for T not equal to char, wchar_t, char8_t, char16_t or char32_t is non-standard and is provided for a temporary period.
It will be removed in LLVM 19, so please migrate off of it. [-Wdeprecated-declarations]
```

See https://github.com/microsoft/LightGBM/issues/6264.

## v4.2.0 - Submission 1 - (December 7, 2023)

### CRAN response
Expand Down
2 changes: 1 addition & 1 deletion R-package/pkgdown/_pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ repo:
user: https://github.com/

development:
mode: unreleased
mode: release

authors:
Yu Shi:
Expand Down
2 changes: 1 addition & 1 deletion VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.2.0.99
4.3.0
2 changes: 1 addition & 1 deletion python-package/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ maintainers = [
name = "lightgbm"
readme = "README.rst"
requires-python = ">=3.6"
version = "4.2.0.99"
version = "4.3.0"

[project.optional-dependencies]
arrow = [
Expand Down
1 change: 0 additions & 1 deletion src/treelearner/linear_tree_learner.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#ifndef LIGHTGBM_TREELEARNER_LINEAR_TREE_LEARNER_H_
#define LIGHTGBM_TREELEARNER_LINEAR_TREE_LEARNER_H_

#include <string>
#include <cmath>
#include <cstdio>
#include <memory>
Expand Down

0 comments on commit 220f7db

Please sign in to comment.