Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
tianlh
LightGBM-DCU
Commits
255c93b5
Unverified
Commit
255c93b5
authored
Jan 16, 2024
by
James Lamb
Committed by
GitHub
Jan 16, 2024
Browse files
[R-package] [ci] remove unnecessary include in linear_tree_learner (fixes #6264) (#6265)
parent
ef2a49cd
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
90 additions
and
41 deletions
+90
-41
.ci/install-clang-devel.sh
.ci/install-clang-devel.sh
+71
-0
.github/workflows/r_package.yml
.github/workflows/r_package.yml
+19
-40
src/treelearner/linear_tree_learner.h
src/treelearner/linear_tree_learner.h
+0
-1
No files found.
.ci/install-clang-devel.sh
0 → 100755
View file @
255c93b5
#!/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
""
.github/workflows/r_package.yml
View file @
255c93b5
...
...
@@ -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
...
...
@@ -276,46 +287,9 @@ 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
:
|
...
...
@@ -323,6 +297,11 @@ jobs:
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
...
...
src/treelearner/linear_tree_learner.h
View file @
255c93b5
...
...
@@ -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>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment