I'm trying to build OpenCV 3.0.0 on a Raspberry Pi 2 running Raspbian Jessie. After installing all dependencies, I tried running cmake with the following parameters: cmake -D CMAKE_C_COMPILER=/usr/bin/gcc -D CMAKE_CXX_COMPILER=/usr/bin/c++ -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local ..
But then I got the following error.
CMake Error: Error in cmake code at
/usr/share/cmake-3.0/Modules/CMakeDetermineCXXCompiler.cmake:112:
Parse error. Function missing ending ")". End of file reached.
CMake Error: Could not find cmake module file: /usr/share/cmake-3.0/Modules/CMakeDetermineCXXCompiler.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: Could not find cmake module file: /home/pi/Downloads/opencv-3.0.0/release/CMakeFiles/3.0.2/CMakeCXXCompiler.cmake
CMake Error: Error in cmake code at
/usr/share/cmake-3.0/Modules/CMakeDetermineCCompiler.cmake:119:
Parse error. Expected a command name, got unquoted argument with text "".
CMake Error: Could not find cmake module file: /usr/share/cmake-3.0/Modules/CMakeDetermineCCompiler.cmake
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: Could not find cmake module file: /home/pi/Downloads/opencv-3.0.0/release/CMakeFiles/3.0.2/CMakeCCompiler.cmake
CMake Error: Error in cmake code at
/usr/share/cmake-3.0/Modules/CMakeCXXInformation.cmake:221:
Parse error. Function missing ending ")". End of file reached.
CMake Error: Could not process cmake module file: /usr/share/cmake-3.0/Modules/CMakeCXXInformation.cmake
-- Check for working CXX compiler: /usr/bin/c++
CMake Error at /usr/share/cmake-3.0/Modules/CMakeTestCXXCompiler.cmake:40 (try_compile):
Unknown extension ".cxx" for file
/home/pi/Downloads/opencv-3.0.0/release/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
try_compile() works only for enabled languages. Currently these are:
C CXX
See project() command to enable other languages.
Call Stack (most recent call first):
CMakeLists.txt:88 (project)
-- Check for working CXX compiler: /usr/bin/c++ -- broken
CMake Error at /usr/share/cmake-3.0/Modules/CMakeTestCXXCompiler.cmake:54 (message):
The C++ compiler "/usr/bin/c++" 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:88 (project)
CMake Error: Error in cmake code at
/usr/share/cmake-3.0/Modules/CMakeCInformation.cmake:113:
Parse error. Function missing ending ")". End of file reached.
CMake Error: Could not process cmake module file: /usr/share/cmake-3.0/Modules/CMakeCInformation.cmake
-- Configuring incomplete, errors occurred!
See also "/home/pi/Downloads/opencv-3.0.0/release/CMakeFiles/CMakeOutput.log".
See also "/home/pi/Downloads/opencv-3.0.0/release/CMakeFiles/CMakeError.log".
Any suggestions?
It's not actually a solution, but I reinstalled my Raspberry Pi again, but this time with the older Raspbian version "Wheezy". On Wheezy, everything worked fine. So I guess there's a problem with Raspbian "Jessie" with OpenCV and/or cmake.
Related
I'm running a conda environment on Windows to get a bash-similar environment (I'm a native Linux Mint user and this is my first time running Windows). But when I run cmake in my conda environment I get the following error:
-- Building for: NMake Makefiles
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:33 (project):
The CMAKE_C_COMPILER:
cl
is not a full path and was not found in the PATH.
To use the NMake generator with Visual C++, cmake must be run from a shell
that can use the compiler cl from the command line. This environment is
unable to invoke the cl compiler. To fix this problem, run cmake from the
Visual Studio Command Prompt (vcvarsall.bat).
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.
CMake Error at CMakeLists.txt:33 (project):
The CMAKE_CXX_COMPILER:
cl
is not a full path and was not found in the PATH.
To use the NMake generator with Visual C++, cmake must be run from a shell
that can use the compiler cl from the command line. This environment is
unable to invoke the cl compiler. To fix this problem, run cmake from the
Visual Studio Command Prompt (vcvarsall.bat).
Tell CMake where to find the compiler by setting either the environment
variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
to the compiler, or to the compiler name if it is in the PATH.
-- Configuring incomplete, errors occurred!
See also "C://CMakeFiles/CMakeOutput.log".
See also "C://CMakeFiles/CMakeError.log".
CMake Error: Cannot open file for write: C://CMakeCache.txt.tmp
CMake Error: : System Error: Permission denied
CMake Error: Unable to open cache file for save. C://CMakeCache.txt
CMake Error: : System Error: Permission denied
I've installed GCC on my conda environment, but I'm not sure how to force CMake to find it.
UPDATE:
I was able to point the compiler to where gcc is installed, but now I get this error:
-- Building for: NMake Makefiles
-- The C compiler identification is GNU 5.3.0
-- The CXX compiler identification is GNU 5.3.0
-- Check for working C compiler: C:/Users/aeglick/AppData/Local/Continuum/anaconda2/Library/mingw-w64/bin/gcc.exe
CMake Error: Generator: execution of make failed. Make command was: nmake /nologo cmTC_da93e\fast &&
-- Check for working C compiler: C:/Users/aeglick/AppData/Local/Continuum/anaconda2/Library/mingw-w64/bin/gcc.exe - broken
CMake Error at C:/Users/aeglick/AppData/Local/Continuum/anaconda2/Library/share/cmake-3.17/Modules/CMakeTestCCompiler.cmake:60 (message):
The C compiler
"C:/Users/aeglick/AppData/Local/Continuum/anaconda2/Library/mingw-w64/bin/gcc.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: C:/Users/aeglick/Documents/GEANT4.10.07/geant4-build/CMakeFiles/CMakeTmp
Run Build Command(s):nmake /nologo cmTC_da93e\fast && The system cannot find the file specified
Generator: execution of make failed. Make command was: nmake /nologo cmTC_da93e\fast &&
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:33 (project)
-- Configuring incomplete, errors occurred!
See also "C:/Users/aeglick/Documents/GEANT4.10.07/geant4-build/CMakeFiles/CMakeOutput.log".
See also "C:/Users/aeglick/Documents/GEANT4.10.07/geant4-build/CMakeFiles/CMakeError.log".
I am currently learning CMake. Right now I am trying to configure CMake to build an example program to learn the basics, but I can't get past what seems like something that should be really easy. It seems that CMake does not agree with my gcc and g++ compilers. I have installed them through CodeBlocks, and they work fine there. However, when I go to configure a project in the CMake GUI I get the following:
The C compiler identification is unknown
The CXX compiler identification is unknown
Check for working C compiler: C:/CodeBlocks/MinGW/bin/gcc.exe
Check for working C compiler: C:/CodeBlocks/MinGW/bin/gcc.exe -- broken
CMake Error at C:/Program Files/CMake/share/cmake-3.15/Modules/CMakeTestCCompiler.cmake:60 (message):
The C compiler
"C:/CodeBlocks/MinGW/bin/gcc.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: C:/Users/Bank/Desktop/Introductions-to-Libraries-with-CMake/Build/CMakeFiles/CMakeTmp
Run Build Command(s):C:/MinGW/bin/mingw32-make.exe cmTC_52744/fast && C:/MinGW/bin/mingw32-make.exe -f CMakeFiles\cmTC_52744.dir\build.make CMakeFiles/cmTC_52744.dir/build
mingw32-make.exe[1]: Entering directory 'C:/Users/Bank/Desktop/Introductions-to-Libraries-with-CMake/Build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_52744.dir/testCCompiler.c.obj
C:\CodeBlocks\MinGW\bin\gcc.exe -o CMakeFiles\cmTC_52744.dir\testCCompiler.c.obj -c C:\Users\Bank\Desktop\Introductions-to-Libraries-with-CMake\Build\CMakeFiles\CMakeTmp\testCCompiler.c
CMakeFiles\cmTC_52744.dir\build.make:64: recipe for target 'CMakeFiles/cmTC_52744.dir/testCCompiler.c.obj' failed
mingw32-make.exe[1]: *** [CMakeFiles/cmTC_52744.dir/testCCompiler.c.obj] Error 1
mingw32-make.exe[1]: Leaving directory 'C:/Users/Bank/Desktop/Introductions-to-Libraries-with-CMake/Build/CMakeFiles/CMakeTmp'
Makefile:120: recipe for target 'cmTC_52744/fast' failed
mingw32-make.exe: *** [cmTC_52744/fast] Error 2
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:6 (project)
Configuring incomplete, errors occurred!
See also "C:/Users/Bank/Desktop/Introductions-to-Libraries-with-CMake/Build/CMakeFiles/CMakeOutput.log".
See also "C:/Users/Bank/Desktop/Introductions-to-Libraries-with-CMake/Build/CMakeFiles/CMakeError.log".
Here is my CMakeLists file:
cmake_minimum_required(VERSION 3.0.0)
set(CMAKE_C_COMPILER "C:/CodeBlocks/MinGW/bin/gcc.exe")
set(CMAKE_CXX_COMPILER "C:/CodeBlocks/MinGW/bin/g++.exe")
project("Foo")
add_subdirectory("foo")
And if it helps, here is what the Path variable in my Environment Variables looks like:
C:\Program Files (x86)\Common Files\Oracle\Java\javapath;c:\windows\system32;c:\windows;c:\windows\system32\wbem;c:\windows\system32\windowspowershell\v1.0\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Git;C:\Program Files\Git\cmd;C:\Users\Bank\AppData\Local\Android\Sdk\tools;C:\Users\Bank\AppData\Local\Android\Sdk\platform-tools;C:\Users\Bank\Desktop\sfAnd\android-ndk-r20;C:\Program Files\CMake\bin;C:\Program Files\Java\jdk1.8.0_231;C:\MinGW\msys\1.0\bin;C:\Program Files\Java\jdk1.8.0_231\jre;C:\Gradle\gradle-6.0-all\gradle-6.0\bin;C:\Gradle\gradle-6.0-all\gradle-6.0;C:\Program Files (x86)\GnuWin32\bin;I:\Storage\Programs\apache-ant-1.9.14-bin\apache-ant-1.9.14\bin;C:\Python27;C:\ninja-win;C:\Program Files\dotnet\;C:\CodeBlocks\MinGW
What could the problem be?
C:\CodeBlocks\MinGW probably doesn't contain the DLL's to gcc or g++. You should add C:\CodeBlocks\MinGW\bin and/or C:\CodeBlocks\MinGW\lib to your path instead, depending on how MinGW was installed. I use MSys2 and use the provided environment for 32bit and 64bit tools. I try to get rid of the pre-packaged versions of MinGW to avoid confusion on my own computers (I noticed msys 1.0 in your path).
I figured it out, finally, thanks to this post:
Cmake build error for c++
I read some posts that said "[your_path]\MinGW" needed to be in your PATH variable, but it's actually "[your_path]\MinGW\bin." I am still not sure why adding the following in CMakeLists did not work:
set(CMAKE_C_COMPILER "C:/CodeBlocks/MinGW/bin/gcc.exe")
set(CMAKE_CXX_COMPILER "C:/CodeBlocks/MinGW/bin/g++.exe")
but that's for another time. Thank you for your help.
I am trying to build OpenBLAS from here, following these instructions. After running
cmake .. -G "Ninja" -DCMAKE_CXX_COMPILER=clang-cl -DCMAKE_C_COMPILER=clang-cl -DCMAKE_Fortran_COMPILER=flang -DBUILD_WITHOUT_LAPACK=no -DNOFORTRAN=0 -DDYNAMIC_ARCH=ON -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON
The error generated is:
-- The C compiler identification is unknown
-- The ASM compiler identification is unknown
-- Didn't find assembler
CMake Error at CMakeLists.txt:6 (project):
The CMAKE_C_COMPILER:
clang-cl
is not a full path and was not found in the PATH.
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.
CMake Error at CMakeLists.txt:6 (project):
No CMAKE_ASM_COMPILER could be found.
Tell CMake where to find the compiler by setting either the environment
variable "ASM" or the CMake cache entry CMAKE_ASM_COMPILER to the full path
to the compiler, or to the compiler name if it is in the PATH.
-- Warning: Did not find file Compiler/-ASM
-- Configuring incomplete, errors occurred!
See also "D:/OpenBLAS_0.3.10/xianyi-OpenBLAS-63b03ef/build/CMakeFiles/CMakeOutput.log".
See also "D:/OpenBLAS_0.3.10/xianyi-OpenBLAS-63b03ef/build/CMakeFiles/CMakeError.log".
After a bit of googling, I found this webpage: Assembler
It does not specify how to resolve this issue. How to solve it?
I'm struggling with integrating JWAsm together with CMake.
I've found an old thread from 2009 which uses CMakeTestASMCompiler to
change the assembler. It defines:
1.) CMakeDetermineASM_JWASMCompiler.cmake
SET(ASM_DIALECT "_JWASM")
SET(CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS asm)
IF(CMAKE_HOST_WIN32)
SET(CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT
"<CMAKE_ASM${ASM_DIALECT}_COMPILER> -nologo -coff <FLAGS> -Fo<OBJECT>
<SOURCE>")
ELSE(CMAKE_HOST_WIN32)
SET(CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT
"<CMAKE_ASM${ASM_DIALECT}_COMPILER> -nologo -elf <FLAGS> -Fo<OBJECT>
<SOURCE>")
ENDIF(CMAKE_HOST_WIN32)
INCLUDE(CMakeASMInformation)
SET(ASM_DIALECT)
2.) CMakeDetermineASM_JWASMCompiler.cmake
SET(ASM_DIALECT "_JWASM")
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT jwasm)
INCLUDE(CMakeDetermineASMCompiler)
SET(ASM_DIALECT)
And it uses like that:
set(CMAKE_ASM_JWASM_COMPILER "/usr/sbin/jwasm")
set(ASM_DIALECT "_JWASM")
include(CMakeTestASMCompiler)
set(ASM_DIALECT)
enable_language(ASM_JWASM)
My issue: CMake fails locating 1.) and 2.) with the following error message:
CMake Error: Could not find cmake module file: CMakeDetermineASM_JWASMCompiler.cmake
CMake Error: Error required internal CMake variable not set, cmake may not be built correctly.
Missing variable is:
CMAKE_ASM_JWASM_COMPILER_ENV_VAR
CMake Error: Could not find cmake module file: [...]/build/[..]/CMakeFiles/3.13.4/CMakeASM_JWASMCompiler.cmake
CMake Error: Could not find cmake module file: CMakeASM_JWASMInformation.cmake
CMake Error: Could not find cmake module file: CMakeTestASM_JWASMCompiler.cmake
Any idea where/how should those .cmake files be installed?
Thanks,
Ok it appears the files have to be copied to CMAKE_ROOT/Modules
Here's the error I'm getting:
-- Building for: NMake Makefiles
-- The C compiler identification is GNU 4.8.1
-- The CXX compiler identification is GNU 4.8.1
-- Check for working C compiler: C:/MinGW/bin/gcc.exe
CMake Error: Generator: execution of make failed. Make command was: "nmake" "/NOLOGO" "cmTC_86068\fast"
-- Check for working C compiler: C:/MinGW/bin/gcc.exe -- broken
CMake Error at C:/Program Files (x86)/CMake/share/cmake-3.4/Modules/CMakeTestCCompiler.cmake:61 (message):
The C compiler "C:/MinGW/bin/gcc.exe" is not able to compile a simple test program.
It fails with the following output:
Change Dir: C:/--REDACTED--/CMakeFiles/CMakeTmp
Run Build Command:"nmake" "/NOLOGO" "cmTC_86068\fast"
The system cannot find the file specified
Generator: execution of make failed. Make command was: "nmake" "/NOLOGO" "cmTC_86068\fast"
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:2 (PROJECT)
-- Configuring incomplete, errors occurred!
See also "C:/--REDACTED--/socket.io-client-cpp-1.6.1/CMakeFiles/CMakeOutput.log".
See also "C:/--REDACTED--/socket.io-client-cpp-1.6.1/CMakeFiles/CMakeError.log".
For the record I am using:
gcc and g++ from MinGW 4.8.1
CMake 3.4.1
I have no idea what the issue could be, I've looked extensively online and have not found anywhere where somebody has gotten a solution, except in cases where it had to do with path issues where the path included non-latin characters or no write access, which is not the case for any of the directories in question. I seriously am about to give up completely on ever being able to get this to work, but I don't know what to do because I absolutely NEED the socket.io client for C++ for this project.
CMake is a utility which generates a "makefile" for different build systems. Here you generate a nmake makefile and it seems that you don't have nmake in your path.
You can launch CMake with option -G "MinGW Makefiles" in order to generate a makefile compatible with mingw make. Then issue the command:
mingw32-make