Search code examples
cmakewindows-10lightgbm

LightGBM windows installation issue - cmake - does not support platform specification


I am trying to install LightGBM in windows 10 using cmake.

I am following the process given on this link

on this command

cmake -DCMAKE_GENERATOR_PLATFORM=x64 ..

it gives the error saying

CMake Error at CMakeLists.txt:7 (PROJECT):

  Generator

NMake Makefiles

  does not support platform specification, but platform

x64

  was specified.


CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
See also "C:/Users/meetp/LightGBM/build/CMakeFiles/CMakeOutput.log".

I'm new to this, since I've never used cmake before.

can someone give me some insights about what parameter i need to add in cmake command?


Solution

  • Platform specification is mainly used for Visual Studio generator. Sometimes, CMake uses this generator by default. In other cases, you need to specify generator explicitly, with -G option:

    cmake -G "Visual Studio 15 2017" -DCMAKE_GENERATOR_PLATFORM=x64 ..
    

    (Make sure that generator corresponds to the Visual Studio which you actually have. See list of Visual Studio generators supported by CMake.)