- Projects for 2021 haven't been selected yet. You can see past years in the archive.
- ./configure -disable-openmp -disable-debug -disable-opencl -disable-graphics -disable-shared 'CXXFLAGS=-g -O2 -Wall -Wextra -Wpedantic' Post-Install Instructions. There are two parts to install for Tesseract, the engine itself, and the traineddata for a language. The above installation commands install the Tesseract engine and training tools.
- Adding Opencl On Dev C++ Pc
- Adding Opencl On Dev C++ Keyboard
- Adding Opencl On Dev C 2b 2b Program
- Adding Opencl On Dev C 2b 2b Code
Feb 07, 2021 1 Overview. The TS-4900 is a TS-Socket Macrocontroller System on Module designed for high performance applications. 2 Getting Started. A Linux PC is recommended for development, and will be assumed for this documentation.
For the easiest installation, go to “Installing the CRAN package”.
Adding Opencl On Dev C++ Pc
If you experience any issues with that, try “Installing from Source with CMake”. This can produce a more efficient version of the library on Windows systems with Visual Studio.
To build a GPU-enabled version of the package, follow the steps in “Installing a GPU-enabled Build”.
If any of the above options do not work for you or do not meet your needs, please let the maintainers know by opening an issue.
When your package installation is done, you can check quickly if your LightGBM R-package is working by running the following:
Installing the CRAN package
lightgbm is available on CRAN, and can be installed with the following R code.
This is the easiest way to install lightgbm. It does not require
Visual Studio, and should work well on many different operating systems and compilers.
Each CRAN package is also available on LightGBM releases, with a name like
Custom Installation (Linux, Mac)
The steps above should work on most systems, but users with highly-customized environments might want to change how R builds packages from source.
To change the compiler used when installing the CRAN package, you can create a file
~/.R/Makevars which overrides
C compiler) and
Adding Opencl On Dev C++ Keyboard
For example, to use
gcc instead of
clang on Mac, you could use something like the following:
Installing from Source with CMake
You need to install git and CMake first.
Note: this method is only supported on 64-bit systems. If you need to run LightGBM on 32-bit Windows (i386), follow the instructions in “Installing the CRAN Package”.
NOTE: Windows users may need to run with administrator rights (either R or the command prompt, depending on the way you are installing this package).
Installing a 64-bit version of Rtools is mandatory.
CMake, be sure the following paths are added to the environment variable
PATH. These may have been automatically added when installing other software.
- If you have
- If you have
- If you have
Rtools paths are required from
Rtools 4.0 onwards because paths and the list of included software was changed in
Windows Toolchain Options
A “toolchain” refers to the collection of software used to build the library. The R package can be built with three different toolchains.
Adding Opencl On Dev C 2b 2b Program
Warning for Windows users: it is recommended to use Visual Studio for its better multi-threading efficiency in Windows for many core systems. For very simple systems (dual core computers or worse), MinGW64 is recommended for maximum performance. If you do not know what to choose, it is recommended to use Visual Studio, the default compiler. Do not try using MinGW in Windows on many core systems. It may result in 10x slower results than Visual Studio.
Visual Studio (default)
By default, the package will be built with Visual Studio Build Tools.
MinGW (R 3.x)
If you are using R 3.x and installation fails with Visual Studio,
LightGBM will fall back to using MinGW bundled with
If you want to force
LightGBM to use MinGW (for any R version), pass
--use-mingw to the installation script.
MSYS2 (R 4.x)
If you are using R 4.x and installation fails with Visual Studio,
LightGBM will fall back to using MSYS2. This should work with the tools already bundled in
If you want to force
LightGBM to use MSYS2 (for any R version), pass
--use-msys2 to the installation script.
Mac OS Preparation
Adding Opencl On Dev C 2b 2b Code
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) first and CMake version 3.16 or higher is required. In case you prefer gcc, you need to install it (details for installation can be found in Installation Guide) and set some environment variables to tell R to use
g++. If you install these from Homebrew, your versions of
gcc are most likely in
/usr/local/bin, as shown below.
Install with CMake
After following the “preparation” steps above for your operating system, build and install the R-package with the following commands:
build_r.R script builds the package in a temporary directory called
lightgbm_r. It will destroy and recreate that directory each time you run the script. That script supports the following command-line options:
--skip-install: Build the package tarball, but do not install it.
--use-gpu: Build a GPU-enabled version of the library.
--use-mingw: Force the use of MinGW toolchain, regardless of R version.
--use-msys2: Force the use of MSYS2 toolchain, regardless of R version.
Note: for the build with Visual Studio/VS Build Tools in Windows, you should use the Windows CMD or PowerShell.
Installing a GPU-enabled Build
You will need to install Boost and OpenCL first: details for installation can be found in Installation-Guide.
After installing these other libraries, follow the steps in “Installing from Source with CMake”. When you reach the step that mentions
build_r.R, pass the flag
You may also need or want to provide additional configuration, depending on your setup. For example, you may need to provide locations for Boost and OpenCL.
The following options correspond to the CMake FindBoost options by the same names.
The following options correspond to the CMake FindOpenCL options by the same names.
Installing Precompiled Binaries
Precompiled binaries for Mac and Windows are prepared by CRAN a few days after each release to CRAN. They can be installed with the following R code.
These packages do not require compilation, so they will be faster and easier to install than packages that are built from source.
CRAN does not prepare precompiled binaries for Linux, and as of this writing neither does this project.
Installing from a Pre-compiled lib_lightgbm
Previous versions of LightGBM offered the ability to first compile the C++ library (
lib_lightgbm.dll) and then build an R package that wraps it.
As of version 3.0.0, this is no longer supported. If building from source is difficult for you, please open an issue.
Please visit demo:
The R package’s unit tests are run automatically on every commit, via integrations like GitHub Actions. Adding new tests in
R-package/tests/testthat is a valuable way to improve the reliability of the R package.
When adding tests, you may want to use test coverage to identify untested areas and to check if the tests you’ve added are covering all branches of the intended code.
The example below shows how to generate code coverage for the R package on a macOS or Linux setup. To adjust for your environment, refer to the customization step described above.
Preparing a CRAN Package
This section is primarily for maintainers, but may help users and contributors to understand the structure of the R package.
CMake to handle tasks like setting compiler and linker flags, including header file locations, and linking to other libraries. Because CRAN packages typically do not assume the presence of
CMake, the R package uses an alternative method that is in the CRAN-supported toolchain for building R packages with C++ code:
For more information on this approach, see “Writing R Extensions”.
Build a CRAN Package
From the root of the repository, run the following.
This will create a file
VERSION is the version of
Alternatively, GitHub Actions can generate this file for you. On a pull request, create a comment with this phrase:
/gha run build-r-artifacts
Go to https://github.com/microsoft/LightGBM/actions, and find the most recent run of the “R artifact builds” workflow. If it ran successfully, you’ll find a download link for the package (in
.zip format) in that run’s “Artifacts” section.
Standard Installation from CRAN Package
After building the package, install it with a command like the following:
Changing the CRAN Package
A lot of details are handled automatically by
R CMD build and
R CMD install, so it can be difficult to understand how the files in the R package are related to each other. An extensive treatment of those details is available in “Writing R Extensions”.
This section briefly explains the key files for building a CRAN package. To update the package, edit the files relevant to your change and re-run the steps in Build a CRAN Package.
Linux or Mac
At build time,
configure will be run and used to create a file
Makevars.in as a template.
autoconf. Do not edit it by hand. This file must be generated on Ubuntu 18.04.
If you have an Ubuntu 18.04 environment available, run the provided script from the root of the
If you do not have easy access to an Ubuntu 18.04 environment, the
configurescript can be generated using Docker by running the code below from the root of this repo.
The version of
autoconfused by this project is stored in
R-package/AUTOCONF_UBUNTU_VERSION. To update that version, update that file and run the commands above. To see available versions, see https://packages.ubuntu.com/search?keywords=autoconf.
Configuring for Windows
At build time,
configure.win will be run and used to create a file
Makevars.win.in as a template.
Testing the CRAN Package
lightgbm is tested automatically on every commit, across many combinations of operating system, R version, and compiler. This section describes how to test the package locally while you are developing.
All packages uploaded to CRAN must pass
R CMD check on Solaris 10. To test LightGBM on this operating system, you can use the free service R Hub, a free service generously provided by the R Consortium.
Alternatively, GitHub Actions can run code above for you. On a pull request, create a comment with this phrase:
/gha run r-solaris
NOTE: Please do this only once you see that other R tests on a pull request are passing. R Hub is a free resource with limited capacity, and we want to be respectful community members.
All packages uploaded to CRAN must pass a build using
gcc instrumented with two sanitizers: the Address Sanitizer (ASAN) and the Undefined Behavior Sanitizer (UBSAN). For more background, see this blog post.
You can replicate these checks locally using Docker.
All packages uploaded to CRAN must be built and tested without raising any issues from
valgrind is a profiler that can catch serious issues like memory leaks and illegal writes. For more information, see this blog post.
You can replicate these checks locally using Docker. Note that instrumented versions of R built to use
valgrind run much slower, and these tests may take as long as 20 minutes to run.
These tests can also be triggered on any pull request by leaving a comment in a pull request:
/gha run r-valgrind
External (Unofficial) Repositories
Projects listed here are not maintained or endorsed by the
LightGBM development team, but may offer some features currently missing from the main R package.
- lightgbm.py: This R package offers a wrapper built with
reticulate, a package used to call Python code from R. If you are comfortable with the added installation complexity of installing
lightgbm’s Python package and the performance cost of passing data between R and Python, you might find that this package offers some features that are not yet available in the native
For information about known issues with the R package, see the R-package section of LightGBM’s main FAQ page.