CLion and MinGW - cmake

I want to try and learn how to use the C language. Therefore, I downloaded CLion and MinGW as toolchain. When trying to install the compiler, it says "test CMake run finished with errors".
Did anybody ever had this problem? What should I do? (At the end of the question- what's written when I click "more" when it says "error").
Or, if you know of any other programs I should download in order to work with C, I'll be happy to hear.
Thanks in advance.
When clicking "more" it says:
-- The C compiler identification is GNU 8.1.0
-- The CXX compiler identification is GNU 8.1.0
-- Check for working C compiler: C:/Program Files (x86)/mingw-w64/i686-8.1.0-posix-dwarf-rt_v6-rev0/mingw32/bin/gcc.exe
-- Check for working C compiler: C:/Program Files (x86)/mingw-w64/i686-8.1.0-posix-dwarf-rt_v6-rev0/mingw32/bin/gcc.exe -- broken
CMake Error at C:/Program Files/JetBrains/CLion 2019.3.5/bin/cmake/win/share/cmake-3.15/Modules/CMakeTestCCompiler.cmake:60 (message):
The C compiler
"C:/Program Files (x86)/mingw-w64/i686-8.1.0-posix-dwarf-rt_v6-rev0/mingw32/bin/gcc.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: C:/Users/׳ ׳•׳¢׳�/AppData/Local/Temp/cmake_check_environment/_build13533773436764788547/CMakeFiles/CMakeTmp
Run Build Command(s):C:/PROGRA~2/MINGW-~1/I686-8~1.0-P/mingw32/bin/mingw32-make.exe cmTC_e4849/fast && C:/PROGRA~2/MINGW-~1/I686-8~1.0-P/mingw32/bin/mingw32-make.exe -f CMakeFiles\cmTC_e4849.dir\build.make CMakeFiles/cmTC_e4849.dir/build
mingw32-make.exe[1]: Entering directory 'C:/Users/ג‰¡ֿƒג‰¥ֿ†/AppData/Local/Temp/cmake_check_environment/_build13533773436764788547/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_e4849.dir/testCCompiler.c.obj
C:\PROGRA~2\MINGW-~1\I686-8~1.0-P\mingw32\bin\gcc.exe -o CMakeFiles\cmTC_e4849.dir\testCCompiler.c.obj -c C:\Users\ג•«ֳ¡ג•«׳¥ג•«ֳ³ג•«ֲ¥\AppData\Local\Temp\cmake_check_environment\_build13533773436764788547\CMakeFiles\CMakeTmp\testCCompiler.c
gcc.exe: error: C:\Users\ג•«ֳ¡ג•«׳¥ג•«ֳ³ג•«ֲ¥\AppData\Local\Temp\cmake_check_environment\_build13533773436764788547\CMakeFiles\CMakeTmp\testCCompiler.c: No such file or directory
gcc.exe: fatal error: no input files
compilation terminated.
mingw32-make.exe[1]: *** [CMakeFiles\cmTC_e4849.dir\build.make:65: CMakeFiles/cmTC_e4849.dir/testCCompiler.c.obj] Error 1
mingw32-make.exe[1]: Leaving directory 'C:/Users/ג‰¡ֿƒג‰¥ֿ†/AppData/Local/Temp/cmake_check_environment/_build13533773436764788547/CMakeFiles/CMakeTmp'
mingw32-make.exe: *** [Makefile:120: cmTC_e4849/fast] Error 2
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:1 (project)
-- Configuring incomplete, errors occurred!
See also "C:/Users/׳ ׳•׳¢׳�/AppData/Local/Temp/cmake_check_environment/_build13533773436764788547/CMakeFiles/CMakeOutput.log".
See also "C:/Users/׳ ׳•׳¢׳�/AppData/Local/Temp/cmake_check_environment/_build13533773436764788547/CMakeFiles/CMakeError.log".
Error code: 1

Related

CMake - cannot build OpenCascade from source

I am trying to Build OpenCascade from source.
I am using this guide:
https://github.com/tpaviot/oce/blob/master/BUILD.MINGWw64.md
All the steps from 1-5, which include downloading stuff have been performed.
Now i am trying to build using CMAKE
*I used "Where is the source code" option to point to the directory of the oce (as instructed).
*I used "Where to build the binaries" option, to point the a folder which i named 'BUILD' inside the directory mentioned in the above step (as instructed).
*I pressed 'Configure' and selected "MSYS Makefiles" with default native compilers.
Here started the errors.
I noticed that CMake had produced a text file, so i went inside and changed the CMAKE MAKE location: CMAKE_MAKE_PROGRAM:FILEPATH=C:/Users/User1/Desktop/OPENCA~1/msys/bin
There i moved forward but new errors spawned.
so how do i move forward?
The guide then says:
"
Check OCE_USE_BUNDLE_SOURCE
Check OCE_WITH_FREEIMAGE
Check OCE_WITH_GL2PS
Check OCE_VISUALISATION
"
Where do i set these?
There are no such variables inside the text file, and neither i can set them up on CMAKE.
EDIT:
These are the errors i get now:
The C compiler identification is GNU 8.1.0
The CXX compiler identification is GNU 8.1.0
Detecting C compiler ABI info
CMake Error: Generator: execution of make failed. Make command was: C:/Users/User1/Desktop/OPENCA~1/msys/bin cmTC_a5bfb/fast &&
Detecting C compiler ABI info - failed
Check for working C compiler: C:/Program Files/mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/bin/gcc.exe
CMake Error: Generator: execution of make failed. Make command was: C:/Users/User1/Desktop/OPENCA~1/msys/bin cmTC_d3ad7/fast &&
Check for working C compiler: C:/Program Files/mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/bin/gcc.exe - broken
CMake Error at C:/Program Files/CMake/share/cmake-3.18/Modules/CMakeTestCCompiler.cmake:66 (message):
The C compiler
"C:/Program Files/mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/bin/gcc.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: C:/Users/User1/Desktop/OpenCascade project/oce/BUILD/CMakeFiles/CMakeTmp
Run Build Command(s):C:/Users/User1/Desktop/OPENCA~1/msys/bin cmTC_d3ad7/fast && Access is denied
Generator: execution of make failed. Make command was: C:/Users/User1/Desktop/OPENCA~1/msys/bin cmTC_d3ad7/fast &&
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:20 (project)
Configuring incomplete, errors occurred!
See also "C:/Users/User1/Desktop/OpenCascade project/oce/BUILD/CMakeFiles/CMakeOutput.log".
See also "C:/Users/User1/Desktop/OpenCascade project/oce/BUILD/CMakeFiles/CMakeError.log".
EDIT 2:
There are some null options in CMake:
EDIT 3:
After following the advice of Tsyvarev, i changed the line to
CMAKE_MAKE_PROGRAM:FILEPATH=C:/Users/User1/Desktop/OPENCA~1/msys/bin/make.exe
These are the errors i get:
The C compiler identification is GNU 8.1.0
The CXX compiler identification is GNU 8.1.0
Detecting C compiler ABI info
CMake Error: Generator: execution of make failed. Make command was: C:/Users/User1/Desktop/OPENCA~1/msys/bin cmTC_51dc6/fast &&
Detecting C compiler ABI info - failed
Check for working C compiler: C:/Program Files/mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/bin/gcc.exe
CMake Error: Generator: execution of make failed. Make command was: C:/Users/User1/Desktop/OPENCA~1/msys/bin cmTC_88ba8/fast &&
Check for working C compiler: C:/Program Files/mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/bin/gcc.exe - broken
CMake Error at C:/Program Files/CMake/share/cmake-3.18/Modules/CMakeTestCCompiler.cmake:66 (message):
The C compiler
"C:/Program Files/mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/bin/gcc.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: C:/Users/User1/Desktop/OpenCascade project/oce/BUILD/CMakeFiles/CMakeTmp
Run Build Command(s):C:/Users/User1/Desktop/OPENCA~1/msys/bin cmTC_88ba8/fast && Access is denied
Generator: execution of make failed. Make command was: C:/Users/User1/Desktop/OPENCA~1/msys/bin cmTC_88ba8/fast &&
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:20 (project)
Configuring incomplete, errors occurred!
See also "C:/Users/User1/Desktop/OpenCascade project/oce/BUILD/CMakeFiles/CMakeOutput.log".
See also "C:/Users/User1/Desktop/OpenCascade project/oce/BUILD/CMakeFiles/CMakeError.log".
Here's how I built OpenCascade 7.4.0 (static+shared) from http://www.opencascade.com/content/latest-release under MSYS2 using Ninja:
INSTALLPREFIX=/usr/local
mkdir -p build_static build_shared &&
cmake.exe -Wno-dev -GNinja -DCMAKE_INSTALL_PREFIX:PATH=$INSTALLPREFIX/share/opencascade -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_SHARED_LIBS:BOOL=OFF -DBUILD_LIBRARY_TYPE:STRING=Static -DUSE_VTK:BOOL=OFF -DUSE_RAPIDJSON:BOOL=ON -DUSE_FREEIMAGE:BOOL=OFF -DUSE_FFMPEG:BOOL=OFF -DUSE_D3D:BOOL=OFF -DBUILD_RELEASE_DISABLE_EXCEPTIONS:BOOL=ON -DBUILD_USE_PCH:BOOL=OFF -DBUILD_SAMPLES_QT:BOOL=OFF -S. -Bbuild_static &&
cmake.exe -Wno-dev -GNinja -DCMAKE_INSTALL_PREFIX:PATH=$INSTALLPREFIX/share/opencascade -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_SHARED_LIBS:BOOL=ON -DBUILD_LIBRARY_TYPE:STRING=Shared -DUSE_VTK:BOOL=OFF -DUSE_RAPIDJSON:BOOL=ON -DUSE_FREEIMAGE:BOOL=OFF -DUSE_FFMPEG:BOOL=OFF -DUSE_D3D:BOOL=OFF -DBUILD_RELEASE_DISABLE_EXCEPTIONS:BOOL=ON -DBUILD_USE_PCH:BOOL=OFF -DBUILD_SAMPLES_QT:BOOL=OFF -S. -Bbuild_shared &&
sed -i.bak -e "s/LINK_LIBRARIES *= *[^ ]*libTKTopAlgo\.dll\.a.*-lfreetype.*libTKernel\.dll\.a.*$/& -Wl,--as-needed -lz -lbz2 -lharfbuzz -lpng -lbrotlidec/" build_shared/build.ninja &&
ninja -Cbuild_static install/strip &&
ninja -Cbuild_shared install/strip &&
echo Success

cmake error: cc fails because no input files

hello I just installed cmake 3.6.2 (the one that comes with cygwin) and I got an error message trying to build llvm, saying that the build failed because cc was unable to find the input file. I've seen lots of postings about a similar problem but in this case, cc is right - the input file does not in fact exist, as I confirmed by checking the directory CMakeTmp. I don't have any spaces in the cmake installation directory tree which is typically the problem. So it looks like cmake has screwed up somewhere. Any ideas?
$ cmake $C/ProgramFiles/llvm-7.0.1/src
-- The C compiler identification is GNU 7.2.0
-- The CXX compiler identification is GNU 7.2.0
-- The ASM compiler identification is GNU
-- Found assembler: /cygdrive/c/ProgramFiles/Haskell Platform/8.4.3/mingw/bin/cc.exe
-- Check for working C compiler: /cygdrive/c/ProgramFiles/Haskell Platform/8.4.3/mingw/bin/cc.exe
-- Check for working C compiler: /cygdrive/c/ProgramFiles/Haskell Platform/8.4.3/mingw/bin/cc.exe -- broken
CMake Error at /usr/share/cmake-3.6.2/Modules/CMakeTestCCompiler.cmake:61 (message):
The C compiler "/cygdrive/c/ProgramFiles/Haskell
Platform/8.4.3/mingw/bin/cc.exe" is not able to compile a simple test
program.
It fails with the following output:
Change Dir: /cygdrive/c/ProgramFiles/llvm-7.0.1/build/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make.exe" "cmTC_d77a9/fast"
/usr/bin/make -f CMakeFiles/cmTC_d77a9.dir/build.make
CMakeFiles/cmTC_d77a9.dir/build
make[1]: Entering directory
'/cygdrive/c/ProgramFiles/llvm-7.0.1/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_d77a9.dir/testCCompiler.c.o
"/cygdrive/c/ProgramFiles/Haskell Platform/8.4.3/mingw/bin/cc.exe" -o
CMakeFiles/cmTC_d77a9.dir/testCCompiler.c.o -c
/cygdrive/c/ProgramFiles/llvm-7.0.1/build/CMakeFiles/CMakeTmp/testCCompiler.c
cc.exe: error:
/cygdrive/c/ProgramFiles/llvm-7.0.1/build/CMakeFiles/CMakeTmp/testCCompiler.c:
No such file or directory
cc.exe: fatal error: no input files
compilation terminated.
make[1]: *** [CMakeFiles/cmTC_d77a9.dir/build.make:66:
CMakeFiles/cmTC_d77a9.dir/testCCompiler.c.o] Error 1
make[1]: Leaving directory
'/cygdrive/c/ProgramFiles/llvm-7.0.1/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:126: cmTC_d77a9/fast] Error 2
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:50 (project)
-- Configuring incomplete, errors occurred!
See also "/cygdrive/c/ProgramFiles/llvm-7.0.1/build/CMakeFiles/CMakeOutput.log".
See also "/cygdrive/c/ProgramFiles/llvm-7.0.1/build/CMakeFiles/CMakeError.log".
So I installed cmake from the cmake website and that works fine, so it definitely looks like a problem with the cygwin cmake. I would report this bug to cygwin if there was a way to do so

Trying to use JetBrains CLion, but Cmake - c++ compiler broken after cygwin install

I have been trying to get JetBrains CLion IDE working, but I am running into a problem with Cmake and none of my research online has been helpful. I installed cygwin with the necessary packages (as stated here - gcc/g++, cmake, make, gdb). When I open up CLion and go into Settings (I'm running Windows 10) under Build>Toolchains>Debugger everything has a check next to it, so it seems like CLion has found everything alright, but when I look in the Debugger window I get the following error:
"C:\Users\Lucas Lofaro\.CLion2016.3\system\cygwin_cmake\bin\cmake.exe" -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - Unix Makefiles" "/cygdrive/c/Users/Lucas Lofaro/ClionProjects/cracking_the_coding_interview"
-- The CXX compiler identification is GNU 5.3.0
-- Check for working CXX compiler: /usr/bin/c++.exe
-- Check for working CXX compiler: /usr/bin/c++.exe -- broken
CMake Error at /cygdrive/c/Users/Lucas Lofaro/.CLion2016.3/system/cygwin_cmake/share/cmake-3.6.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:
Change Dir: /cygdrive/c/Users/Lucas Lofaro/ClionProjects/cracking_the_coding_interview/cmake-build-debug/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make.exe" "cmTC_96921/fast"
/usr/bin/make -f CMakeFiles/cmTC_96921.dir/build.make
CMakeFiles/cmTC_96921.dir/build
make[1]: Entering directory '/cygdrive/c/Users/Lucas
Lofaro/ClionProjects/cracking_the_coding_interview/cmake-build-debug/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_96921.dir/testCXXCompiler.cxx.o
/usr/bin/c++.exe -o CMakeFiles/cmTC_96921.dir/testCXXCompiler.cxx.o -c
"/cygdrive/c/Users/Lucas
Lofaro/ClionProjects/cracking_the_coding_interview/cmake-build-debug/CMakeFiles/CMakeTmp/testCXXCompiler.cxx"
Linking CXX executable cmTC_96921.exe
"/cygdrive/c/Users/Lucas
Lofaro/.CLion2016.3/system/cygwin_cmake/bin/cmake.exe" -E cmake_link_script
CMakeFiles/cmTC_96921.dir/link.txt --verbose=1
/usr/bin/c++.exe -Wl,--enable-auto-import
CMakeFiles/cmTC_96921.dir/testCXXCompiler.cxx.o -o cmTC_96921.exe
-Wl,--out-implib,libcmTC_96921.dll.a
-Wl,--major-image-version,0,--minor-image-version,0
c++: fatal error: -fuse-linker-plugin, but cyglto_plugin.dll not found
compilation terminated.
CMakeFiles/cmTC_96921.dir/build.make:97: recipe for target 'cmTC_96921.exe'
failed
make[1]: *** [cmTC_96921.exe] Error 1
make[1]: Leaving directory '/cygdrive/c/Users/Lucas
Lofaro/ClionProjects/cracking_the_coding_interview/cmake-build-debug/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_96921/fast' failed
make: *** [cmTC_96921/fast] Error 2
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 "/cygdrive/c/Users/Lucas Lofaro/ClionProjects/cracking_the_coding_interview/cmake-build-debug/CMakeFiles/CMakeOutput.log".
See also "/cygdrive/c/Users/Lucas Lofaro/ClionProjects/cracking_the_coding_interview/cmake-build-debug/CMakeFiles/CMakeError.log".
I've also added the cygwin bin directory to my Path environment variable, but I am really at a loss as to what to do next. Something isn't linking up and I don't want to start digging around in Cmake files without a better understanding of what's going on. Any guidance would be much appreciated. Please let me know if I can provide any additional information.
It turns out that the cmake, make, and g++ packages were installed but not updated to their most recent versions. Rerunning cygwin installer solved my problem and everything now compiles fine.

The C compiler identification is unknown

I want to compile a C program. When I run cmake
build]$ cmake ../
-- The C compiler identification is unknown
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- broken
CMake Error at /usr/share/cmake-3.0/Modules/CMakeTestCCompiler.cmake:61 (message):
The C compiler "/usr/bin/cc" is not able to compile a simple test program.
It fails with the following output:
Change Dir: /home/vahid/dev/Indexer/build/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTryCompileExec3431547622/fast"
/usr/bin/make -f CMakeFiles/cmTryCompileExec3431547622.dir/build.make
CMakeFiles/cmTryCompileExec3431547622.dir/build
make[1]: Entering directory
'/home/vahid/dev/Indexer/build/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report
/home/vahid/dev/Indexer/build/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object
CMakeFiles/cmTryCompileExec3431547622.dir/testCCompiler.c.o
/usr/bin/cc -o CMakeFiles/cmTryCompileExec3431547622.dir/testCCompiler.c.o
-c /home/vahid/dev/Indexer/build/CMakeFiles/CMakeTmp/testCCompiler.c
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.0/cc1: error while loading shared
libraries: libisl.so.13: cannot open shared object file: No such file or
directory
CMakeFiles/cmTryCompileExec3431547622.dir/build.make:57: recipe for target
'CMakeFiles/cmTryCompileExec3431547622.dir/testCCompiler.c.o' failed
make[1]: *** [CMakeFiles/cmTryCompileExec3431547622.dir/testCCompiler.c.o]
Error 1
make[1]: Leaving directory
'/home/vahid/dev/Indexer/build/CMakeFiles/CMakeTmp'
Makefile:118: recipe for target 'cmTryCompileExec3431547622/fast' failed
make: *** [cmTryCompileExec3431547622/fast] Error 2
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 "/home/vahid/dev/Indexer/build/CMakeFiles/CMakeOutput.log".
See also "/home/vahid/dev/Indexer/build/CMakeFiles/CMakeError.log".
why did this error occur? How can I fix it?
why this error occured?
According to this error message:
/usr/bin/cc -o CMakeFiles/cmTryCompileExec3431547622.dir/testCCompiler.c.o -c /home/vahid/dev/Indexer/build/CMakeFiles/CMakeTmp/testCCompiler.c
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.0/cc1: error while loading shared libraries: libisl.so.13: cannot open shared object file: No such file or directory
It looks like your compiler does not work.
how i can fix it?
Reinstall toolchain should be the simplest way to fix it.
How to do that depends on your operating system, if you are using Linux distribution like Debian, you can use something like apt-get install build-essential to install it; if you are using Fedora or CentOS, you could use yum group install c-development.

CMake cannot compile test program as source directory doesnt exist

all. I'm trying to use cmake for compile some android code with android toolchain on Windows 7x64.
when i call cmake as following
cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=android.cmake 1>!cmake.log 2>!cmake.error.log
I run this command from Administrator console and get following output:
!cmake.log
-- The C compiler identification is GNU 4.6.0
-- The CXX compiler identification is GNU 4.6.0
-- Check for working C compiler: c:/cygwin/usr/local/android-toolchain-r8ea9/bin/arm-linux-androideabi-gcc.exe
-- Check for working C compiler: c:/cygwin/usr/local/android-toolchain-r8ea9/bin/arm-linux-androideabi-gcc.exe -- broken
-- Configuring incomplete, errors occurred!
!cmake.error.log
CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:61 (message):
The C compiler
"c:/cygwin/usr/local/android-toolchain-r8ea9/bin/arm-linux-androideabi-gcc.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: C:/PDK_BUILD/openssl/CMakeFiles/CMakeTmp
Run Build Command:C:/PROGRA~2/CMAKE2~1.8/bin/cmake.exe
"cmTryCompileExec333575975/fast"
CMake Error: The source directory
"C:/PDK_BUILD/openssl/CMakeFiles/CMakeTmp/cmTryCompileExec333575975/fast"
does not exist.
Specify --help for usage, or press the help button on the CMake GUI.
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
I granted adninistrator rights for cmake.exe itself, cleared read-only attributes from CMakeFiles folder and disabled anti-virus but still not worked.
It looks like you are running into CMake Bug 0013131. This comment suggests that using unset TMP should fix the problem. Don't forget to delete the CMakeCache.txt and CMakeFiles folders (or the entire build tree when using out-of-source builds), before retrying.