Skip to content

Commit

Permalink
use --config-settings (with an 's') for pip
Browse files Browse the repository at this point in the history
  • Loading branch information
jameslamb committed Jun 9, 2023
1 parent 4414897 commit 41badff
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions .ci/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ if [[ $TASK == "gpu" ]]; then
pip install \
--user \
-v \
--config-setting=cmake.define.USE_GPU=ON \
--config-settings=cmake.define.USE_GPU=ON \
$BUILD_DIRECTORY/dist/lightgbm-$LGB_VER.tar.gz \
|| exit -1
pytest $BUILD_DIRECTORY/tests/python_package_test || exit -1
Expand Down Expand Up @@ -229,7 +229,7 @@ elif [[ $TASK == "cuda" ]]; then
pip install \
--user \
-v \
--config-setting=cmake.define.USE_CUDA=ON \
--config-settings=cmake.define.USE_CUDA=ON \
$BUILD_DIRECTORY/dist/lightgbm-$LGB_VER.tar.gz \
|| exit -1
pytest $BUILD_DIRECTORY/tests/python_package_test || exit -1
Expand All @@ -252,7 +252,7 @@ elif [[ $TASK == "mpi" ]]; then
pip install \
--user \
-v \
--config-setting=cmake.define.USE_MPI=ON \
--config-settings=cmake.define.USE_MPI=ON \
$BUILD_DIRECTORY/dist/lightgbm-$LGB_VER.tar.gz \
|| exit -1
pytest $BUILD_DIRECTORY/tests/python_package_test || exit -1
Expand Down
2 changes: 1 addition & 1 deletion build-python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ while [ $# -gt 0 ]; do
PRECOMPILE="true"
;;
--time-costs)
BUILD_ARGS="${PIP_INSTALL_ARGS} --config-setting=cmake.define.USE_TIMETAG=ON"
BUILD_ARGS="${BUILD_ARGS} --config-setting=cmake.define.USE_TIMETAG=ON"
;;
--user)
PIP_INSTALL_ARGS="${PIP_INSTALL_ARGS} --user"
Expand Down
20 changes: 10 additions & 10 deletions python-package/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Build Threadless Version

.. code:: sh
pip install lightgbm --config-setting=cmake.define.USE_OPENMP=OFF
pip install lightgbm --config-settings=cmake.define.USE_OPENMP=OFF
All requirements, except the **OpenMP** requirement, from `Build from Sources section <#build-from-sources>`__ apply for this installation option as well.

Expand All @@ -71,7 +71,7 @@ Build MPI Version

.. code:: sh
pip install lightgbm --config-setting=cmake.define.USE_MPI=ON
pip install lightgbm --config-settings=cmake.define.USE_MPI=ON
All requirements from `Build from Sources section <#build-from-sources>`__ apply for this installation option as well.

Expand All @@ -84,7 +84,7 @@ Build GPU Version

.. code:: sh
pip install lightgbm --config-setting=cmake.define.USE_GPU=ON
pip install lightgbm --config-settings=cmake.define.USE_GPU=ON
All requirements from `Build from Sources section <#build-from-sources>`__ apply for this installation option as well.

Expand All @@ -95,9 +95,9 @@ For **Windows** users, `CMake`_ (version 3.8 or higher) is strongly required.
.. code:: sh
pip install lightgbm \
--config-setting=cmake.define.USE_GPU=ON \
--config-setting=cmake.define.OpenCL_INCLUDE_DIR="/usr/local/cuda/include/" \
--config-setting=cmake.define.OpenCL_LIBRARY="/usr/local/cuda/lib64/libOpenCL.so"
--config-settings=cmake.define.USE_GPU=ON \
--config-settings=cmake.define.OpenCL_INCLUDE_DIR="/usr/local/cuda/include/" \
--config-settings=cmake.define.OpenCL_LIBRARY="/usr/local/cuda/lib64/libOpenCL.so"
All available options that can be passed via ``cmake.define.{option}``.

Expand All @@ -120,7 +120,7 @@ Build CUDA Version

.. code:: sh
pip install lightgbm --config-setting=cmake.define.USE_CUDA=ON
pip install lightgbm --config-settings=cmake.define.USE_CUDA=ON
All requirements from `Build from Sources section <#build-from-sources>`__ apply for this installation option as well, and `CMake`_ (version 3.16 or higher) is strongly required.

Expand All @@ -133,7 +133,7 @@ Build HDFS Version

.. code:: sh
pip install lightgbm --config-setting=cmake.define.USE_HDFS=ON
pip install lightgbm --config-settings=cmake.define.USE_HDFS=ON
All requirements from `Build from Sources section <#build-from-sources>`__ apply for this installation option as well.

Expand All @@ -148,7 +148,7 @@ Build with MinGW-w64 on Windows
# in sh.exe, git bash, or other Unix-like shell
export CMAKE_GENERATOR='MinGW Makefiles'
pip install lightgbm --config-setting=cmake.define.CMAKE_SH=CMAKE_SH-NOTFOUND
pip install lightgbm --config-settings=cmake.define.CMAKE_SH=CMAKE_SH-NOTFOUND
`CMake`_ and `MinGW-w64 <https://www.mingw-w64.org/>`_ should be installed first.

Expand All @@ -174,7 +174,7 @@ Build with Time Costs Output

.. code:: sh
pip install lightgbm --config-setting=cmake.define.USE_TIMETAG=ON
pip install lightgbm --config-settings=cmake.define.USE_TIMETAG=ON
Use this option to make LightGBM output time costs for different internal routines, to investigate and benchmark its performance.

Expand Down

0 comments on commit 41badff

Please sign in to comment.