LightGBM Installation issue on cmake - cmake

I would like to download LightGbm and i followed this website for doing it. But suddenly stopped with an error. Please post a solution.
Thankshttps://lightgbm.readthedocs.io/en/latest/Installation-Guide.html#macos
Error:
cmake ..
CMake Error at /usr/local/Cellar/cmake/3.13.0/share/cmake/Modules/CMakeDetermineCCompiler.cmake:48 (message):
Could not find compiler set in environment variable CC:
gcc-7.
Call Stack (most recent call first):
CMakeLists.txt:7 (PROJECT)
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
See also "/Users/kj/LightGBM/build/CMakeFiles/CMakeOutput.log".

Your environment variable CC is set to gcc-7 but this compiler can't be access with your $PATH variable.
Try to write gcc-7 in a terminal you should get a Command not found error.

Related

How to set the environment variables in CMAKE?

I am trying to use Cmake to manage the dependencies of the Fortran and C code when I compiled the spectral solver. But it seems that Cmake cannot find the compiler although I have downloaded the Fortran and GCC already. This is the error I am getting. I hope there is someone who can tell me how to solve it.
the error screenshot
`CMake Error at /usr/share/cmake-3.16/Modules/CMakeDetermineCompiler.cmake:58 (set_property):
set_property could not find CACHE variable CMAKE_Fortran_COMPILER. Perhaps
it has not yet been created.
Call Stack (most recent call first):
/usr/share/cmake-3.16/Modules/CMakeDetermineFortranCompiler.cmake:96 (_cmake_find_compiler)
CMakeLists.txt:109 (project)
-- The Fortran compiler identification is unknown
CMake Error at /usr/share/cmake-3.16/Modules/CMakeDetermineCompiler.cmake:58 (set_property):
set_property could not find CACHE variable CMAKE_C_COMPILER. Perhaps it
has not yet been created.
Call Stack (most recent call first):
/usr/share/cmake-3.16/Modules/CMakeDetermineCCompiler.cmake:65 (_cmake_find_compiler)
CMakeLists.txt:109 (project)
-- The C compiler identification is unknown
CMake Error at CMakeLists.txt:109 (project):
No CMAKE_Fortran_COMPILER could be found.
Tell CMake where to find the compiler by setting either the environment
variable "FC" or the CMake cache entry CMAKE_Fortran_COMPILER to the full
path to the compiler, or to the compiler name if it is in the PATH.
CMake Error at CMakeLists.txt:109 (project):
No CMAKE_C_COMPILER could be found.
Tell CMake where to find the compiler by setting either the environment
variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
the compiler, or to the compiler name if it is in the PATH.`
CMakeLists.txt
You need set the env variables. I used the following steps:
1: vim ~/.bashrc (to set the env variables)
2: Add the following statements
export CC=/usr/bin/gcc (the path basically) and export FC=/usr/bin/gfortran
3 - Also make sure your path to PETSC_DIR and PETSC_ARCH is defined, add the following statements too, export PETSC_DIR = /path/to/petsc and export PETSC_ARCH = gfortran
4 - save and close the file
5 - Run this on command line - to read and execute the bash script source ~/.bashrc

Can't build AWS SDK CPP examples. Cmake can't find AWSSDKConfig.cmake, but the file is present on my disk

I installed the AWS SDK for C++ on my Ubuntu box using the instructions given in the Amazon doc:
https://docs.aws.amazon.com/sdk-for-cpp/v1/developer-guide/setup.html
I was able to compile the SDK without error.
Then I followed the README for building the examples, for C++. when I run Cmake I get the following error:
CMake Error at CMakeLists.txt:15 (find_package):
By not providing "FindAWSSDK.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "AWSSDK", but
CMake did not find one.
Could not find a package configuration file provided by "AWSSDK" with any
of the following names:
AWSSDKConfig.cmake
awssdk-config.cmake
Add the installation prefix of "AWSSDK" to CMAKE_PREFIX_PATH or set
"AWSSDK_DIR" to a directory containing one of the above files. If "AWSSDK"
provides a separate development package or SDK, be sure it has been
installed.
However AWSSDKConfig.cmake is definitely on my system:
$ locate AWSSDKConfig.cmake
/home/robert/Documents/GitHub/aws-sdk-cpp/cmake/AWSSDKConfig.cmake
So I tried adding the path to the configuration file directly using the CMake CMAKE_PREFIX_PATH command line argument:
sudo cmake -D CMAKE_PREFIX_PATH="/home/robert/Documents/GitHub/aws-sdk-cpp/cmake/" /home/robert/Documents/GitHub/aws-doc-sdk-examples/cpp/example_code/dynamodb
But then I get this set of error messages:
CMake Error at /home/robert/Documents/GitHub/aws-sdk-cpp/cmake/AWSSDKConfig.cmake:27 (include):
include could not find load file:
/home/robert/Documents/GitHub/aws-sdk-cpp/cmake/AWSSDKConfigVersion.cmake
Call Stack (most recent call first):
CMakeLists.txt:15 (find_package)
CMake Error at /home/robert/Documents/GitHub/aws-sdk-cpp/cmake/AWSSDKConfig.cmake:29 (include):
include could not find load file:
/home/robert/Documents/GitHub/aws-sdk-cpp/cmake/platformDeps.cmake
Call Stack (most recent call first):
CMakeLists.txt:15 (find_package)
CMake Error at /home/robert/Documents/GitHub/aws-sdk-cpp/cmake/AWSSDKConfig.cmake:86 (message):
AWS SDK for C++ is missing, please install it first
Call Stack (most recent call first):
CMakeLists.txt:15 (find_package)
-- Configuring incomplete, errors occurred!
See also "/home/robert/Documents/GitHub/aws-doc-sdk-examples-build/dynamodb/CMakeFiles/CMakeOutput.log".
I figure I must be doing something fundamentally wrong at this point. How can I make this work?

CMake error while compiling linphone android project in ubuntu 16.04

I am new in linphone. I clone linphone git repo here, I got error when i am going to compiling linphone project.
As mention step in linphone github page here, follow all the step. and install required software in ubuntu 16.04.
When i am going to do ./prepare.py -ac or ./prepare.py -L got same error.
Issues is,
/linphone-android$ ./prepare.py ac
cmake /home/krunal/linphone-android/submodules/cmake-builder -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=/home/krunal/linphone-android/liblinphone-sdk/android-arm -DCMAKE_INSTALL_PREFIX=/home/krunal/linphone-android/liblinphone-sdk/android-arm -DLINPHONE_BUILDER_WORK_DIR=/home/krunal/linphone-android/WORK/android-arm -DCMAKE_TOOLCHAIN_FILE=toolchains/toolchain-android-arm.cmake -DLINPHONE_BUILDER_CONFIG_FILE=configs/config-android.cmake -DCMAKE_INSTALL_MESSAGE=LAZY -DLINPHONE_BUILDER_EXTERNAL_SOURCE_PATH=/home/krunal/linphone-android/submodules -DENABLE_VIDEO=NO -G "Unix Makefiles" -DENABLE_GPL_THIRD_PARTIES=YES -DENABLE_NON_FREE_CODECS=YES -DENABLE_AMRNB=YES -DENABLE_AMRWB=YES -DENABLE_BV16=YES -DENABLE_CODEC2=YES -DENABLE_G729=YES -DENABLE_GSM=YES -DENABLE_ILBC=YES -DENABLE_ISAC=YES -DENABLE_OPUS=YES -DENABLE_SILK=YES -DENABLE_SPEEX=YES -DENABLE_FFMPEG=YES -DENABLE_H263=YES -DENABLE_H263P=YES -DENABLE_MPEG4=YES -DENABLE_OPENH264=YES -DENABLE_VPX=YES
CMake Error at toolchains/android/toolchain-android.cmake:53 (message):
Cannot find the compiler
Call Stack (most recent call first):
toolchains/toolchain-android-arm.cmake:27 (include)
/usr/share/cmake-3.5/Modules/CMakeDetermineSystem.cmake:98 (include)
CMakeLists.txt
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
- Configuring incomplete, errors occurred!
Set your compiler, and have a compiler with the -Doption:
-DCMAKE_C_COMPILER=/usr/bin/gcc
Related: cmake: problems specifying the compiler (2)

CGAL cmake on cygwin fails

I'm trying to compile CGAL 4.5 on cygwin (windows 7). i have gcc-core, gcc-g++ and gmp installed but when i try to run cmake i get following error:
$ cmake .
-- The CXX compiler identification is GNU 4.8.3
CMake Error: Could not find cmake module file:/home/metalab/CGAL-4.5/CMakeFiles/2.8.11.2/CMakeCXXCompiler.cmake
-- The C compiler identification is GNU 4.8.3
CMake Error: Could not find cmake module file:/home/metalab/CGAL-4.5/CMakeFiles/2.8.11.2/CMakeCCompiler.cmake
CMake Warning at /usr/share/cmake-2.8.11.2/Modules/Platform/CYGWIN.cmake:15 (message):
CMake no longer defines WIN32 on Cygwin!
(1) If you are just trying to build this project, ignore this warning or
quiet it by setting CMAKE_LEGACY_CYGWIN_WIN32=0 in your environment or in
the CMake cache. If later configuration or build errors occur then this
project may have been written under the assumption that Cygwin is WIN32.
In that case, set CMAKE_LEGACY_CYGWIN_WIN32=1 instead.
(2) If you are developing this project, add the line
set(CMAKE_LEGACY_CYGWIN_WIN32 0) # Remove when CMake >= 2.8.4 is required
at the top of your top-level CMakeLists.txt file or set the minimum
required version of CMake to 2.8.4 or higher. Then teach your project to
build on Cygwin without WIN32.
Call Stack (most recent call first):
/usr/share/cmake-2.8.11.2/Modules/CMakeSystemSpecificInformation.cmake:36 (include)
CMakeLists.txt:7 (project)
CMake Error: Could not find cmake module file:/home/metalab/CGAL-4.5/CMakeFiles/2.8.11.2/CMakeRCCompiler.cmake
-- Check for working CXX compiler: /usr/bin/c++.exe
CMake Error at /usr/share/cmake-2.8.11.2/Modules/CMakeTestCXXCompiler.cmake:40 (try_compile):
Unknown extension ".cxx" for file
/home/metalab/CGAL-4.5/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
try_compile() works only for enabled languages. Currently these are:
C CXX RC
See project() command to enable other languages.
Call Stack (most recent call first):
CMakeLists.txt:7 (project)
-- Check for working CXX compiler: /usr/bin/c++.exe -- broken
CMake Error at /usr/share/cmake-2.8.11.2/Modules/CMakeTestCXXCompiler.cmake:54 (message):
The C++ compiler "/usr/bin/c++.exe" is not able to compile a simple test
program.
It fails with the following output:
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:7 (project)
-- Configuring incomplete, errors occurred!
i already tried playing with CMAKE_LEGACY_CYGWIN_WIN32 but no success.
I ran in a similar error. cmake seemed to not be able to find anything from Cygwin.
The fact is that you need to run the Cygwin version of cmake. If you installed cmake from an installer and it went under C:\Program Files, you have the wrong cmake and it won't find most everything which it should otherwise find.

Error during building of YAML_CPP with CMake on WIndows

I keep getting an error when I try to build yaml-cpp on Windows.
Using the CMake gui application I selected build- and sourcepath correctly, but as soon as I hit the "Configure" Button there is the following error thrown:
CMake Error: CMake was unable to find a build program corresponding to "**MinGW Makefiles**". **CMAKE_MAKE_PROGRAM** is not set. You probably need to select a different build tool.
CMake Error: CMake was unable to find a build program corresponding to "MinGW Makefiles". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_C_COMPILER_ENV_VAR
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_C_COMPILER
CMake Error: Could not find cmake module file:C:/Users/Robert/Programs/Lib/yaml-cpp/build/CMakeFiles/CMakeCCompiler.cmake
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_CXX_COMPILER_ENV_VAR
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_CXX_COMPILER
CMake Error: Could not find cmake module file:C:/Users/Robert/Programs/Lib/yaml-cpp/build/CMakeFiles/CMakeCXXCompiler.cmake
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
Configuring incomplete, errors occurred!
I know it has to do with the selected Generator, I selected CodeBlocks - MinGW Makefiles. However I have installed CodeBlocks correctly. So is there perhaps a way to set the CMAKE_MAKE_PROGRAM variable manually?