Building gtest on msys2 fails in install, similar problem on other packages - cmake

When trying to install google test on MSYS2, I use:
cmake -G"MSYS Makefiles" ..
make
This works, the code is generated with no errors. Then, to install:
make install
This unfortunately, does not work. There seems to be a common problem, other packages have similar issues.
-- Installing: C:/Program Files/googletest-distribution/include
CMake Error at googlemock/cmake_install.cmake:31 (file):
file INSTALL cannot make directory "C:/Program
Files/googletest-distribution/include": No such file or directory
Call Stack (most recent call first):
cmake_install.cmake:32 (include)
Is this a permissions problem? I tried sudo, but that does not exist on msys2.
The line number 31 of the error seems wrong, that's a comment:
if(NOT CMAKE_INSTALL_LOCAL_ONLY)
# Include the install script for each subdirectory.
include("D:/git/extcode/googletest/build/googlemock/cmake_install.cmake")
endif()
line 32 is the include, which refers to d:,not c:, so I do not understand the message being generated?

Related

brew install cpp-ethereum CMake Error

I am trying to manually build my ethereum client on Mac OS X 10.13.5 (using brew gives me a similar error). I follow the simple instructions to :
git clone https://github.com/ethereum/cpp-ethereum.git
cd cpp-ethereum
mkdir -p build
cd build
cmake ..
It gives me an error and fails the build:
CMake Error at CMakeLists.txt:7 (include):
include could not find load file:
evmc/cmake/cable/bootstrap.cmake
CMake Error at CMakeLists.txt:8 (include):
include could not find load file:
CableBuildInfo
CMake Error at CMakeLists.txt:9 (include):
include could not find load file:
CableBuildType
CMake Error at CMakeLists.txt:10 (include):
include could not find load file:
CableToolchains
CMake Error at CMakeLists.txt:19 (cable_configure_toolchain):
Unknown CMake command "cable_configure_toolchain".
-- Configuring incomplete, errors occurred!
I know CMake is used to manage the building process but Id on't understand what is causing the problem. What is this CMakeList that is causing my build to fail and how do I troubleshoot these?
I think you can try
git clone --recursive https://github.com/ethereum/cpp-ethereum.git
I read it from the aleth github project.
Run this inside the cloned folder
git submodule update --init --recursive

CMake fails to find packages after removing conda

I removed conda by following option A in the documentation, i.e. I simply removed the
~/anaconda3 directory and got rid of the relevant line in my ~.bashrc. However, when I call cmake in a different project of mine, cmake still tries to link to libraries installed with anaconda:
$ cmake ..
CMake Error at /usr/share/cmake-3.9/Modules/FindBoost.cmake:1247 (file):
file STRINGS file "/home/USERNAME/anaconda3/include/boost/version.hpp"
cannot be read.
Call Stack (most recent call first):
dbklib/CMakeLists.txt:5 (find_package)
-- Boost version: 0.0.0
-- DBKLIB:
CMake Error at pydbk/pybind11/tools/FindPythonLibsNew.cmake:95 (message):
Python config failure:
Call Stack (most recent call first):
pydbk/pybind11/tools/pybind11Tools.cmake:16 (find_package)
pydbk/pybind11/CMakeLists.txt:33 (include)
How do I get rid of anaconda completely? Can I still somehow run the anaconda-clean tool without having conda?
After modifying installed packages set (especially after removing the package), when rebuild CMake project it is needed to clean CMake cache of that project, so CMake will recheck results of previous searching of packages.
CMake cache may be cleared by removing CMakeCache.txt file from build directory, or by completely cleaning the build directory.

CMake error not providing FindGnuradio.cmake

Getting the following error when running cmake and am unsure how to fix it. It seems like it's telling me exactly what to do, but not very familiar with Linux.
CMake Error at CMakeLists.txt:153 (find_package):
By not providing "FindGnuradio.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "Gnuradio",
but CMake did not find one.
Could not find a package configuration file provided by "Gnuradio"
(requested version 3.7.3) with any of the following names:
GnuradioConfig.cmake
gnuradio-config.cmake
Add the installation prefix of "Gnuradio" to CMAKE_PREFIX_PATH or set
"Gnuradio_DIR" to a directory contaning one of the above files. If
"Gnuradio" provides a separate development package or SDK, be sure it has
been installed.
EDIT: So I've located something called FindGnuradioRuntime.cmake but am still unsure what to do with it. The error message makes me think it was looking for something named "FindGnuradio.cmake" when it was actually called "FindGnuradioRuntime.cmake"
Commands that were run on a fresh Ubuntu install:
git clone git://git.osmocom.org/rtl-sdr.git
cd rtl-sdr/
mkdir build
cd build
cmake ../
make
sudo make install
sudo ldconfig
git clone git://git.osmocom.org/gr-osmosdr
cd gr-osmosdr/
mkdir build
cd build/
cmake ../ (here is where I ran into a the problem above)
Install / build GNU Radio.
Remove the CMakeCache.txt
When you call cmake .. you can pass arguments. Add the path to the parent directory of GnuradioConfig.cmake or FindGnuRadio.cmake as in
cmake -DCMAKE_PREFIX_PATH=/gnu/radio/path ..
Making my somewhat hidden response an actual answer:
Just found out that the install script provided on GNURadio's website not only installs GNURadio, but also the RTL SDR requirements as well, so I wiped my VM and started over and was successful. It takes a few hours, but it is complete and automated so definitely the best way to install GNURadio. Script is here http://www.sbrac.org/files/build-gnuradio
As previous answers noted you didn't describe where you ran into this problem. I'm going to assume it happened when creating an Out Of Tree (OOT) module.
On the OOT Module Page, see the "Notes" Section. They note that you need to install gr-dev. That package will install GnuradioConfig.cmake. You can find it in the standard yum repos, and install it with sudo yum install gnuradio-devel.

Kate Cmake error

I am trying to build Kate on Linux Mint Cinnamon 17.1 64-bit. I downloaded Kate source code and tried to install it according to http://kate-editor.org/get-it/. Now while trying to compile, I am getting cmake error.
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
QT_QTOPENGL_INCLUDE_DIR (ADVANCED)
used as include directory in directory /home/jaydipc/kde/kate/addons/kate/pate/sip
used as include directory in directory /home/jaydipc/kde/kate/addons/kate/pate/src
used as include directory in directory /home/jaydipc/kde/kate/addons/kate/pate/src
used as include directory in directory /home/jaydipc/kde/kate/addons/kate/pate/src/test
-- Configuring incomplete, errors occurred!
What am I doing wrong here? Please help.
Thanks.
I assume You have Qt4 development packages installed in Your system and only missing libqt4-opengl-dev. So, the bluntest solution would be just install it. For example like this:
$ sudo apt-get install libqt4-opengl-dev
Relevant issue on MacOS:
CMake Error: The following variables are used in this project, but they are set to NOTFOUND

How to install Cmake C compiler and CXX compiler

I need some help compiling this project with cmake. Here is the error message.
$ ./build_avida
-- Building for: NMake Makefiles
CMake Warning at CMakeLists.txt:1 (PROJECT):
To use the NMake generator, cmake must be run from a shell that can use the
compiler cl from the command line. This environment does not contain
INCLUDE, LIB, or LIBPATH, and these must be set for the cl compiler to
work.
CMake Error: CMake was unable to find a build program corresponding to "NMake 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/Desk/Dropbox/2012-2013/BCB504/AvidaProject/avidagit/avida/CMakeFiles/2.8.10.2/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/Desk/Dropbox/2012-2013/BCB504/AvidaProject/avidagit/avida/CMakeFiles/2.8.10.2/CMakeCXXCompiler.cmake
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
make: *** No rule to make target `install'. Stop.
Try to install gcc and gcc-c++, as Cmake works smooth with them.
RedHat-based
yum install gcc gcc-c++
Debian/Ubuntu-based
apt-get install cmake gcc g++
Then,
remove 'CMakeCache.txt'
run compilation again.
Even though I had gcc already installed, I had to run
sudo apt-get install build-essential
to get rid of that error
The approach I use is to start the "Visual Studio Command Prompt" which can be found in the Start menu. E.g. my visual studio 2010 Express install has a shortcute Visual Studio Command Prompt (2010) at Start Menu\Programs\Microsoft Visual Studio 2010\Visual Studio Tools.
This shortcut prepares an environment by calling a script vcvarsall.bat where the compiler, linker, etc. are setup from the right Visual Studio installation.
Alternatively, if you already have a prompt open, you can prepare the environment by calling a similar script:
:: For x86 (using the VS100COMNTOOLS env-var)
call "%VS100COMNTOOLS%"\..\..\VC\bin\vcvars32.bat
or
:: For amd64 (using the full path)
call C:\Program Files\Microsoft Visual Studio 10.0\VC\bin\amd64\vcvars64.bat
However:
Your output (with the '$' prompt) suggests that you are attempting to run CMake from a MSys shell. In that case it might be better to run CMake for MSys or MinGW, by explicitly specifying a makefile generator:
cmake -G"MSYS Makefiles"
cmake -G"MinGW Makefiles"
Run cmake --help to get a list of all possible generators.
Those errors :
"CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage"
means you haven't installed mingw32-base.
Go to http://sourceforge.net/projects/mingw/files/latest/download?source=files
and then make sure you select "mingw32-base"
Make sure you set up environment variables correctly in PATH section.
"C:\MinGW\bin"
After that open CMake and Select Installation --> Delete Cache.
And click configure button again. I solved the problem this way, hope you solve the problem.