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 C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
...
-- Using _mm_malloc
CMake Error at CMakeLists.txt:436 (target_link_libraries):
Target "lightgbm_objs" of type OBJECT_LIBRARY may not be linked into
another target. One may link only to STATIC or SHARED libraries, or to
executables with the ENABLE_EXPORTS property set.
You have called ADD_LIBRARY for library _lightgbm without any source files. This typically indicates a problem with your CMakeLists.txt file
CMake Error at CMakeLists.txt:454 (target_link_libraries):
Target "lightgbm_capi_objs" of type OBJECT_LIBRARY may not be linked into
another target. One may link only to STATIC or SHARED libraries, or to
executables with the ENABLE_EXPORTS property set.
CMake Error at CMakeLists.txt:454 (target_link_libraries):
Target "lightgbm_objs" of type OBJECT_LIBRARY may not be linked into
another target. One may link only to STATIC or SHARED libraries, or to
executables with the ENABLE_EXPORTS property set.
Upgrading cmake to the latest release (v3.25.1), LightGBM can be compiled successfully.
apt-get remove -y --purge \
cmake
wget \
https://github.com/Kitware/CMake/releases/download/v3.25.1/cmake-3.25.1-linux-x86_64.sh
sudo mkdir /opt/cmake
sudo sh cmake-3.25.1-linux-x86_64.sh --prefix=/opt/cmake
cp /opt/cmake/bin/cmake /usr/bin
# 3.25.1
/usr/local/bin/cmake --version
cd /usr/local/src/LightGBM
rm -r ./build
mkdir ./build
cd ./build
/usr/local/bin/cmake -DUSE_OPENMP=OFF ..
make -j2
If you're finding this from a search engine... please consider contributing!
To resolve this, find the oldest CMake supported by LightGBM's current configuration. To do that, use something like the reproducible example in the original post to test versions one at a time.
Inspect the release notes for that version to identify what might have changed to make LightGBM incompatible with older versions.
If LightGBM's CMakeLists.txt can be modified to support and older version of CMake, make those modifications and repeat the process. Otherwise, increase the minimum version in CMakeLists.txt to that oldest supported version.
Description
LightGBM's
CMakeLists.txt
claims that it supportscmake>=3.0
.LightGBM/CMakeLists.txt
Line 37 in a174893
However, I found that it
CMake==3.10.2
is unable to generate Makefiles with the project's current setup.Reproducible example
Results in the following errors.
Upgrading
cmake
to the latest release (v3.25.1), LightGBM can be compiled successfully.Environment info
LightGBM version or commit hash: a174893
Additional Comments
That floor was last increased in October 2020 (#3501).
Some relevant CMake version dates:
Discovered while working on #5638 .
The text was updated successfully, but these errors were encountered: