I downloaded this Celero library to test my sorting algorithms.
I saw there were sample demos .cpp file with a CMakeLists.txt.
I read about how this works and I think running cmake .
makes a Makefile according to the CMakeLists.txt, but when I am inside the demo folder
Celero-master\experiments\DemoSimple
And I run this command I get error
CMake Warning (dev) in CMakeLists.txt:
No project() command is present. The top-level CMakeLists.txt file must
contain a literal, direct call to the project() command. Add a line of
code such as
project(ProjectName)
near the top of the file, but after cmake_minimum_required().
CMake is pretending there is a "project(Project)" command on the first
line.
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) in CMakeLists.txt:
cmake_minimum_required() should be called prior to this top-level project()
call. Please see the cmake-commands(7) manual for usage documentation of
both commands.
This warning is for project developers. Use -Wno-dev to suppress it.
-- Selecting Windows SDK version to target Windows 6.2.9200.
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error in CMakeLists.txt:
No CMAKE_C_COMPILER could be found.
CMake Error in CMakeLists.txt:
No CMAKE_CXX_COMPILER could be found.
CMake Warning (dev) in CMakeLists.txt:
No cmake_minimum_required command is present. A line of code such as
cmake_minimum_required(VERSION 3.26)
should be added at the top of the file. The version specified may be lower
if you wish to support older CMake versions for this project. For more
information run "cmake --help-policy CMP0000".
This warning is for project developers. Use -Wno-dev to suppress it.
-- Configuring incomplete, errors occurred!
I added these to top of CMakeLists:
set(CMAKE_CXX_COMPILER "D:/Downloads/winlibs-x86_64-posix-seh-gcc-12.2.0-llvm-16.0.0-mingw-w64msvcrt-10.0.0-r5/mingw64/bin/g++.exe")
set(CMAKE_C_COMPILER "D:/Downloads/winlibs-x86_64-posix-seh-gcc-12.2.0-llvm-16.0.0-mingw-w64msvcrt-10.0.0-r5/mingw64/bin/gcc.exe")
...but I still get the same error.
How do build demos from the Celero project?
EDIT 1:
After running cmake . from root I get this error
-- Selecting Windows SDK version to target Windows 6.2.9200.
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: D:Downloads/winlibs-x86_64-posix-seh-gcc-12.2.0-llvm-16.0.0-mingw-w64msvcrt-10.0.0-r5/mingw64/bin/gcc.exe
-- Check for working C compiler: D:Downloads/winlibs-x86_64-posix-seh-gcc-12.2.0-llvm-16.0.0-mingw-w64msvcrt-10.0.0-r5/mingw64/bin/gcc.exe - broken
CMake Error at C:/Program Files/winlibs-x86_64-posix-seh-gcc-12.2.0-llvm-16.0.0-mingw-w64msvcrt-10.0.0-r5/mingw64/share/cmake-3.26/Modules/CMakeTestCCompiler.cmake:67 (message):
The C compiler
"D:Downloads/winlibs-x86_64-posix-seh-gcc-12.2.0-llvm-16.0.0-mingw-w64msvcrt-10.0.0-r5/mingw64/bin/gcc.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: C:/Users/HomePC/Desktop/New folder (2)/Celero-master/Celero-master/CMakeFiles/CMakeScratch/TryCompile-60nkgv
Run Build Command(s):D:/Program Files/Microsoft Visual Studio/2022/Community/MSBuild/Current/Bin/amd64/MSBuild.exe cmTC_25446.vcxproj /p:Configuration=Debug /p:Platform=x64 /p:VisualStudioVersion=17.0 /v:n && MSBuild version 17.5.1+f6fdcf537 for .NET Framework
Build started 5/24/2023 12:47:30 AM.
Included response file: D:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64\MSBuild.rsp
Project "C:\Users\HomePC\Desktop\New folder (2)\Celero-master\Celero-master\CMakeFiles\CMakeScratch\TryCompile-60nkgv\cmTC_25446.vcxproj" on node 1 (default targets).
PrepareForBuild:
Creating directory "cmTC_25446.dir\Debug\".
D:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(499,5): warning MSB8003: The WindowsSDKDir property is not defined. Some build tools may not be found. [C:\Users\HomePC\Desktop\New folder (2)\Celero-master\Celero-master\CMakeFiles\CMakeScratch\TryCompile-60nkgv\cmTC_25446.vcxproj]
Creating directory "C:\Users\HomePC\Desktop\New folder (2)\Celero-master\Celero-master\CMakeFiles\CMakeScratch\TryCompile-60nkgv\Debug\".
Creating directory "cmTC_25446.dir\Debug\cmTC_25446.tlog\".
InitializeBuildStatus:
Creating "cmTC_25446.dir\Debug\cmTC_25446.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
ClCompile:
D:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\bin\HostX64\x64\CL.exe /c /W1 /WX- /diagnostics:column /O2 /D _MBCS /D "CMAKE_INTDIR=\"Debug\"" /Gm- /MD /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"cmTC_25446.dir\Debug\\" /Fd"cmTC_25446.dir\Debug\vc143.pdb" /external:W1 /Gd /TC /errorReport:queue "C:\Users\HomePC\Desktop\New folder (2)\Celero-master\Celero-master\CMakeFiles\CMakeScratch\TryCompile-60nkgv\testCCompiler.c"
Microsoft (R) C/C++ Optimizing Compiler Version 19.35.32216.1 for x64
testCCompiler.c
Copyright (C) Microsoft Corporation. All rights reserved.
cl /c /W1 /WX- /diagnostics:column /O2 /D _MBCS /D "CMAKE_INTDIR=\"Debug\"" /Gm- /MD /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"cmTC_25446.dir\Debug\\" /Fd"cmTC_25446.dir\Debug\vc143.pdb" /external:W1 /Gd /TC /errorReport:queue "C:\Users\HomePC\Desktop\New folder (2)\Celero-master\Celero-master\CMakeFiles\CMakeScratch\TryCompile-60nkgv\testCCompiler.c"
Link:
D:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\bin\HostX64\x64\link.exe /ERRORREPORT:QUEUE /OUT:"C:\Users\HomePC\Desktop\New folder (2)\Celero-master\Celero-master\CMakeFiles\CMakeScratch\TryCompile-60nkgv\Debug\cmTC_25446.exe" /INCREMENTAL /ILK:"cmTC_25446.dir\Debug\cmTC_25446.ilk" /NOLOGO /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /PDB:"C:/Users/HomePC/Desktop/New folder (2)/Celero-master/Celero-master/CMakeFiles/CMakeScratch/TryCompile-60nkgv/Debug/cmTC_25446.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"C:/Users/HomePC/Desktop/New folder (2)/Celero-master/Celero-master/CMakeFiles/CMakeScratch/TryCompile-60nkgv/Debug/cmTC_25446.lib" /MACHINE:X64 cmTC_25446.dir\Debug\testCCompiler.obj
LINK : fatal error LNK1104: cannot open file 'kernel32.lib' [C:\Users\HomePC\Desktop\New folder (2)\Celero-master\Celero-master\CMakeFiles\CMakeScratch\TryCompile-60nkgv\cmTC_25446.vcxproj]
Done Building Project "C:\Users\HomePC\Desktop\New folder (2)\Celero-master\Celero-master\CMakeFiles\CMakeScratch\TryCompile-60nkgv\cmTC_25446.vcxproj" (default targets) -- FAILED.
Build FAILED.
"C:\Users\HomePC\Desktop\New folder (2)\Celero-master\Celero-master\CMakeFiles\CMakeScratch\TryCompile-60nkgv\cmTC_25446.vcxproj" (default target) (1) ->
(PrepareForBuild target) ->
D:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(499,5): warning MSB8003: The WindowsSDKDir property is not defined. Some build tools may not be found. [C:\Users\HomePC\Desktop\New folder (2)\Celero-master\Celero-master\CMakeFiles\CMakeScratch\TryCompile-60nkgv\cmTC_25446.vcxproj]
"C:\Users\HomePC\Desktop\New folder (2)\Celero-master\Celero-master\CMakeFiles\CMakeScratch\TryCompile-60nkgv\cmTC_25446.vcxproj" (default target) (1) ->
(Link target) ->
LINK : fatal error LNK1104: cannot open file 'kernel32.lib' [C:\Users\HomePC\Desktop\New folder (2)\Celero-master\Celero-master\CMakeFiles\CMakeScratch\TryCompile-60nkgv\cmTC_25446.vcxproj]
1 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.63
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:86 (PROJECT)
-- Configuring incomplete, errors occurred!
PS C:\Users\HomePC\Desktop\New folder (2)\Celero-master\Celero-master> cmake .
-- Selecting Windows SDK version to target Windows 6.2.9200.
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: D:Downloads/winlibs-x86_64-posix-seh-gcc-12.2.0-llvm-16.0.0-mingw-w64msvcrt-10.0.0-r5/mingw64/bin/gcc.exe
-- Check for working C compiler: D:Downloads/winlibs-x86_64-posix-seh-gcc-12.2.0-llvm-16.0.0-mingw-w64msvcrt-10.0.0-r5/mingw64/bin/gcc.exe - broken
CMake Error at C:/Program Files/winlibs-x86_64-posix-seh-gcc-12.2.0-llvm-16.0.0-mingw-w64msvcrt-10.0.0-r5/mingw64/share/cmake-3.26/Modules/CMakeTestCCompiler.cmake:67 (message):
The C compiler
"D:Downloads/winlibs-x86_64-posix-seh-gcc-12.2.0-llvm-16.0.0-mingw-w64msvcrt-10.0.0-r5/mingw64/bin/gcc.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: C:/Users/HomePC/Desktop/New folder (2)/Celero-master/Celero-master/CMakeFiles/CMakeScratch/TryCompile-nfx358
Run Build Command(s):D:/Program Files/Microsoft Visual Studio/2022/Community/MSBuild/Current/Bin/amd64/MSBuild.exe cmTC_5c4b2.vcxproj /p:Configuration=Debug /p:Platform=x64 /p:VisualStudioVersion=17.0 /v:n && MSBuild version 17.5.1+f6fdcf537 for .NET Framework
Build started 5/24/2023 12:52:38 AM.
Included response file: D:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64\MSBuild.rsp
Project "C:\Users\HomePC\Desktop\New folder (2)\Celero-master\Celero-master\CMakeFiles\CMakeScratch\TryCompile-nfx358\cmTC_5c4b2.vcxproj" on node 1 (default targets).
PrepareForBuild:
Creating directory "cmTC_5c4b2.dir\Debug\".
D:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(499,5): warning MSB8003: The WindowsSDKDir property is not defined. Some build tools may not be found. [C:\Users\HomePC\Desktop\New folder (2)\Celero-master\Celero-master\CMakeFiles\CMakeScratch\TryCompile-nfx358\cmTC_5c4b2.vcxproj]
Creating directory "C:\Users\HomePC\Desktop\New folder (2)\Celero-master\Celero-master\CMakeFiles\CMakeScratch\TryCompile-nfx358\Debug\".
Creating directory "cmTC_5c4b2.dir\Debug\cmTC_5c4b2.tlog\".
InitializeBuildStatus:
Creating "cmTC_5c4b2.dir\Debug\cmTC_5c4b2.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
ClCompile:
D:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\bin\HostX64\x64\CL.exe /c /W1 /WX- /diagnostics:column /O2 /D _MBCS /D "CMAKE_INTDIR=\"Debug\"" /Gm- /MD /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"cmTC_5c4b2.dir\Debug\\" /Fd"cmTC_5c4b2.dir\Debug\vc143.pdb" /external:W1 /Gd /TC /errorReport:queue "C:\Users\HomePC\Desktop\New folder (2)\Celero-master\Celero-master\CMakeFiles\CMakeScratch\TryCompile-nfx358\testCCompiler.c"
Microsoft (R) C/C++ Optimizing Compiler Version 19.35.32216.1 for x64
testCCompiler.c
Copyright (C) Microsoft Corporation. All rights reserved.
cl /c /W1 /WX- /diagnostics:column /O2 /D _MBCS /D "CMAKE_INTDIR=\"Debug\"" /Gm- /MD /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"cmTC_5c4b2.dir\Debug\\" /Fd"cmTC_5c4b2.dir\Debug\vc143.pdb" /external:W1 /Gd /TC /errorReport:queue "C:\Users\HomePC\Desktop\New folder (2)\Celero-master\Celero-master\CMakeFiles\CMakeScratch\TryCompile-nfx358\testCCompiler.c"
Link:
D:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\bin\HostX64\x64\link.exe /ERRORREPORT:QUEUE /OUT:"C:\Users\HomePC\Desktop\New folder (2)\Celero-master\Celero-master\CMakeFiles\CMakeScratch\TryCompile-nfx358\Debug\cmTC_5c4b2.exe" /INCREMENTAL /ILK:"cmTC_5c4b2.dir\Debug\cmTC_5c4b2.ilk" /NOLOGO /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /PDB:"C:/Users/HomePC/Desktop/New folder (2)/Celero-master/Celero-master/CMakeFiles/CMakeScratch/TryCompile-nfx358/Debug/cmTC_5c4b2.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"C:/Users/HomePC/Desktop/New folder (2)/Celero-master/Celero-master/CMakeFiles/CMakeScratch/TryCompile-nfx358/Debug/cmTC_5c4b2.lib" /MACHINE:X64 cmTC_5c4b2.dir\Debug\testCCompiler.obj
LINK : fatal error LNK1104: cannot open file 'kernel32.lib' [C:\Users\HomePC\Desktop\New folder (2)\Celero-master\Celero-master\CMakeFiles\CMakeScratch\TryCompile-nfx358\cmTC_5c4b2.vcxproj]
Done Building Project "C:\Users\HomePC\Desktop\New folder (2)\Celero-master\Celero-master\CMakeFiles\CMakeScratch\TryCompile-nfx358\cmTC_5c4b2.vcxproj" (default targets) -- FAILED.
Build FAILED.
"C:\Users\HomePC\Desktop\New folder (2)\Celero-master\Celero-master\CMakeFiles\CMakeScratch\TryCompile-nfx35
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:86 (PROJECT)
-- Configuring incomplete, errors occurred!