You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The attempt to include CUDA sources files only when USE_CUDA is true is done incorrectly, which can cause errors when LightGBM is built as part of a CMake superproject. Nesting, if() commands inside of a file(GLOB) command is just adding if(USE_CUDA) and endif() as globbing patters, not filtering the patterns between them.
Tracing the will reveal that filtering the file globbing command failed: the CUDA files are included in the list of sources for the lightgbm_objs library, even though USE_CUDA is OFF.
Description
The attempt to include CUDA sources files only when
USE_CUDA
is true is done incorrectly, which can cause errors when LightGBM is built as part of a CMake superproject. Nesting,if()
commands inside of afile(GLOB)
command is just addingif(USE_CUDA)
andendif()
as globbing patters, not filtering the patterns between them.Reproducible example
Running CMake with tracing will allow you to see that you are not removing anything with the above command
cmake --trace --trace-expand --trace-redirect=trace.log -B build -S .
Tracing the will reveal that filtering the file globbing command failed: the CUDA files are included in the list of sources for the
lightgbm_objs
library, even thoughUSE_CUDA
isOFF
.Environment info
LightGBM
version or commit hash: 5516533Command(s) you used to install LightGBM
LigtGBM was cloned from github.com
Additional Comments
The following should fix the code:
The text was updated successfully, but these errors were encountered: