CUDA compile problems on Windows, Cmake error: No CUDA toolset found - c++

so I've been successfully working on my CUDA program on my Linux but I would like to support Windows platform as well. However, I've been struggling with correctly compiling it. I use :
Windows 10
Cmake 3.15
Visual Studio 2017
CUDA Toolkit 10.1
When using the old deprecated Cmake CUDA support of using find_package(CUDA 10.1 REQUIRED) it correctly reports the correct path to the toolkit when using it. However, it is my understanding that the latest Cmake does not properly support the old method anymore and that cuda_add_libraryetc don't properly link anymore. So I have reformatted my 'CMakeLists.txt' file to the following based on this:
cmake_minimum_required(VERSION 3.8 FATAL_ERROR)
project(myproject LANGUAGES CXX CUDA)
add_library(mylib SHARED mycudalib.cu)
# My code requires C++ 11 for the CUDA library, not sure which ones of these
# will do the trick correctly. Never got the compiler this far.
target_compile_features(mylib PUBLIC cxx_std_11)
SET(CMAKE_CXX_STANDARD 11)
SET(CMAKE_CUDA_STANDARD 11)
set_target_properties( mylib PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
add_executable(test_mylib test.cpp)
target_link_libraries(test_mylib mylib ${CUDA_CUFFT_LIBRARIES})
However, I get the following error from line 2:
CMake Error at C:/Program Files/CMake/share/cmake-3.15/Modules/CMakeDetermineCompilerId.cmake:345 (message):
No CUDA toolset found.
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.15/Modules/CMakeDetermineCompilerId.cmake:32 (CMAKE_DETERMINE_COMPILER_ID_BUILD)
C:/Program Files/CMake/share/cmake-3.15/Modules/CMakeDetermineCUDACompiler.cmake:72 (CMAKE_DETERMINE_COMPILER_ID)
CMakeLists.txt:2 (project)
I've tried a variation of suggestions online such as adding the following to 'CMakeLists.txt':
set(CMAKE_CUDA_COMPILER "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.1/bin/nvcc")
or adding the following variable to Cmake:
This is the 'CMakeLists.txt' file I use on Linux to compile succesfully. The difference is there I use Cmake 3.5 and CUDA Toolkit 9.0:
cmake_minimum_required(VERSION 3.5)
project( myproject)
find_package(CUDA 9.0 REQUIRED)
if(CUDA_FOUND)
list(APPEND CUDA_NVCC_FLAGS "-std=c++11")
endif(CUDA_FOUND)
cuda_add_library(mylib SHARED mycudalib.cu)
cuda_add_executable(test_mylib test.cpp)
target_link_libraries(test_mylib mylib ${CUDA_CUFFT_LIBRARIES})

For Windows 10, VS2019 Community, and CUDA 11.3, the following worked for me:
Extract the full installation package with 7-zip or WinZip
Copy the four files from this extracted directory .\visual_studio_integration\CUDAVisualStudioIntegration\extras\visual_studio_integration\MSBuildExtensions
into the MSBuild folder of your VS2019 install C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\BuildCustomizations
The four files are:
CUDA 11.3.props
CUDA 11.3.targets
CUDA 11.3.xml
Nvda.Build.CudaTasks.v11.3.dll
I had tried installing (and reinstalling) CUDA with Visual Studio Integration, but CMake wasn't able to find the CUDA installation (even with CUDA_PATH and CMAKE_CUDA_COMPILER defined).

I have tried it on a different PC now and it works fine. So I had absolutely no idea why it's not working on this one. As CUDA_PATH is correctly setup in my system variables.
Then looking into it further, by uninstalling the 'Build Tools' of Visual Studio and only having the Community IDE installed, CMake used the IDE instead of the Build Tools and then it started working fine.

Look at this. It may solve your issues.
https://gitlab.kitware.com/cmake/cmake/issues/19029
Seems like Nvidia cuda installer has some issues with installing the VS integration with vs 2017.
Check if you can find this file in your vs installing path.
C:/Program Files (x86)/Microsoft Visual
Studio/2017/Professional/Common7/IDE/VC/VCTargets/BuildCustomizations/CUDA
10.1.xml

I was trying to build darknet from source and came across this issue.
What resolved it for me was the following:
making sure no other Visual Studio or Visual Studio Build Tool was installed except for VS2019. (I configured this using the uninstall feature of the ~1 mb vs_community.exe installer program)
REINSTALLING CUDA 10.1, using the 2.5 gb installer, and in that process, making sure 'VS Integration' is installed (for me... this was a 'reinstall' since I had already installed it, but with a bunch of VS2019,VS2017 + Build Tools all installed at once!!) during the installation.
At that point, my cudnn files were still in the bin/lib/include folder of the 10.1 installation, and I hit "Configure" in CMake again.
Success! No errors. (CMake 3.18, VS2019, CUDA 10.1.243, cudnn 7.6.5)

I just have the same issue of No CUDA toolset found with different versions, and my system:
-Windows 11
-Cmake 3.20.0
-Visual Studio 2019
-CUDA Toolkit 11.6
Some netizens said that it happened if you installed Visual Studio before you install CUDA. So, I tried and reinstall CUDA, finally it work now. You also can try it. Good luck.
enter image description here

Related

Error: No CMAKE_Fortran_COMPILER could be found for Visual Studio 2019 Fortran support

I am using CMAKE to build Open Source Projects (like those are available at GitHub etc.) and I also have installed Visual Studio 2019. There is a problem that CMAKE can not find Fortran compiler in my system whereas I've installed MinGW with Fortran compiler. The error is:
**The Fortran compiler identification is unknown**
**No CMAKE_Fortran_COMPILER could be found.**
How can I solve this problem and make CMAKE be aware of Fortran compiler?
Note: I tried other projects that does not require Fortran compiler and those are built successfully.
Installed software:
CMAKE 3.18.5,
Visual Studio 2019,
MinGW
You need to show where your fortran executable file to CMakeList.txt like
set(CMAKE_Fortran_COMPILER "C:/MinGW/bin/gfortran.exe")
EDIT 2 for Visual studio 2019:
If you want to produce Visual Studio 2019 solution
Download Intel® oneAPI HPC Toolkit here.
If cmake cannot find Fortran compiler add a cmake flag CMAKE_Fortran_COMPILER with the value of ifort.exe path that u installed above. Like %install_path%/Intel/oneAPI/compiler/2021.1.1/windows/bin/intel64/ifort.exe
Configure and generate solution.
EDIT:
Alright, now I understand why you get this error. The Visual Studio generator does not support MinGW gfortran. They are totally separate ecosystems.
Remove your build directory and create a fresh one. Then use cmake .. -G "MinGW Makefiles" instead. I tried from CLI prompt of msys and successfully obtained the libraries from Windows machine.
If you are using Intel processors, you should first set-up Fortran environment for Visual Studio 2019
Better to check compilation guide and some troubleshooting Fortran Integration Issues with visual studio

CMake 64-bit with SFML 64-bit

I'm trying to build a C++ project with CMake 64-bit for Windows and SFML 2.5.1 64-bit. When I run cmake on the project I'm getting an error message.
The only way I can get it to work is to change the CMAKE_PREFIX_PATH to point to a 32-bit version of SFML but that's not what I want.
CMakeLists.txt:
cmake_minimum_required (VERSION 3.8)
#project(GameOfLife)
set(CMAKE_PREFIX_PATH "D:\\Program Files\\SFML-2.5.1\\lib\\cmake\\SFML")
find_package(SFML 2.5 COMPONENTS graphics window REQUIRED)
# Add source to this project's executable.
add_executable (GameOfLife "GameOfLife.cpp" "GameOfLife.h")
# Link SFML
target_link_libraries(GameOfLife sfml-graphics sfml-window)
Error message:
CMake Error at CMakeLists.txt:16 (find_package): Could not find a
configuration file for package "SFML" that is compatible with
requested version "2.5".
The following configuration files were considered but not accepted:
D:/Program Files/SFML-2.5.1/lib/cmake/SFML/SFMLConfig.cmake, version:
2.5.1 (64bit)
I faced with the same problem and after some investigation I understood that Stanley's comment was correct. To use a 64-bit toolchain just run:
cmake -G "Visual Studio 15 2017 Win64" ..
For 32-bit SFML version it is enough to run simply: cmake ..
This issue happened to me on CLion, in my case I downloaded SFML for MinGW-64, but the default toolchain was configured to Visual Studio.
I solved this by going to File->Settings->Build, Execution, Deployment->Toolchains, clicking on MinGW and then the up arrow, making MinGW the defaut toolchain.

CMAKE: "No CMAKE_CXX_COMPILER could be found."

I have a simple project where the file structure looks like this:
- CMakeLists.txt
- main.cpp
The CMakeLists.txtlooks like this:
# Project initialization
cmake_minimum_required (VERSION 2.6)
project (Tutorial)
add_executable(Tutorial main.cpp)
When I run the Cmake GUI I get:
CMake Error at CMakeLists.txt:3 (project):
No CMAKE_CXX_COMPILER could be found.
I have Microsoft Visual Studio 2017 installed. I have compiled and run apps from it. The basic example from the CMAKE tutorial does not work.
Can anyone tell me why?
I'm not sure what is going wrong but you might want to take a look at:
https://learn.microsoft.com/en-us/cpp/ide/cmake-tools-for-visual-cpp?view=vs-2017
Visual Studio 2017 is able to open cmake files directly (should do the generator step for you behind the scenes) which may avoid the problem you have.
Use the integrated Visual Studio CMAKE.
The error reporting in the VS build/output/error window has become somewhat complex, and many errors are delegated between the toolchains, etc. (i.e. the whole VS has become modularized lately)
Universal truth: log files are your best friend.
In my case,
CMakeError.log has been constantly complaining it can't find kernel32.lib
Guess what? I forgot to install Windows SDK.
Basically, for any serious work, you need at least MSVS and Windows SDK, if you want to build for Windows. (Windows SDK is also now known as "Windows Kits", which is what you'll get in the StartMenu).
Essentially, your problem might simply be you don't have proper dev libs installed.

visual studio code unable to debug - Target debugging is no longer supported with the legacy driver

I am using visual studio code for a c++ cmake project.
I am unable to use cmake: target debug (CTRL + F5)
When debugging the project I get
Target debugging is no longer supported with the legacy driver
Platform and Versions
Visual studio code 1.28.2
C/C++ 0.20.1
CMake 0.0.17
CMake Tools 1.1.2 (vector of bool)
CMake Tools Helper 0.2.1
Doxygen Documentation Generator 0.4.1
Include Autocomplete 0.0.4
Python 2018.9.2
Swig(.tpl) 0.0.6
Compiler/Toolchain: GCC 5.4.0
Has anybody encountered this?
The visual studio code cmake extension requires CMake 3.7.2 or newer. See https://github.com/vector-of-bool/vscode-cmake-tools/issues/388
If this isn't available from your package manager you will need to download it from https://cmake.org/

CMake error at CMakeLists.txt:30 (project): No CMAKE_C_COMPILER could be found

I'm trying make a Visual Studio solution with CMake to compile the latest version of aseprite and CMake keeps giving me the:
No CMAKE_C_COMPILER could be found.
No CMAKE_CXX_COMPILER could be found.
I've already downloaded GCC, and I'm using Visual Studio 2015.
I'm following this tutorial:
https://github.com/aseprite/aseprite/blob/master/INSTALL.md
For Ubuntu, please install the below things:
sudo apt-get update && sudo apt-get install build-essential
Those error messages
CMake Error at ... (project):
No CMAKE_C_COMPILER could be found.
-- Configuring incomplete, errors occurred!
See also ".../CMakeFiles/CMakeOutput.log".
See also ".../CMakeFiles/CMakeError.log".
or
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found.
Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
...
-- Configuring incomplete, errors occurred!
just mean that CMake was unable to find your C/CXX compiler to compile a simple test program (one of the first things CMake tries while detecting your build environment).
The steps to find your problem are dependent on the build environment you want to generate. The following tutorials are a collection of answers here on Stack Overflow and some of my own experiences with CMake on Microsoft Windows 7/8/10 and Ubuntu 14.04.
Preconditions
You have installed the compiler/IDE and it was able to once compile any other program (directly without CMake)
You e.g. may have the IDE, but may not have installed the compiler or supporting framework itself like described in Problems generating solution for VS 2017 with CMake or How do I tell CMake to use Clang on Windows?
You have the latest CMake version
You have access rights on the drive you want CMake to generate your build environment
You have a clean build directory (because CMake does cache things from the last try) e.g. as sub-directory of your source tree
Windows cmd.exe
> rmdir /s /q VS2015
> mkdir VS2015
> cd VS2015
Bash shell
$ rm -rf MSYS
$ mkdir MSYS
$ cd MSYS
and make sure your command shell points to your newly created binary output directory.
General things you can/should try
Is CMake able find and run with any/your default compiler? Run without giving a generator
> cmake ..
-- Building for: Visual Studio 14 2015
...
Perfect if it correctly determined the generator to use - like here Visual Studio 14 2015
What was it that actually failed?
In the previous build output directory look at CMakeFiles\CMakeError.log for any error message that make sense to you or try to open/compile the test project generated at CMakeFiles\[Version]\CompilerIdC|CompilerIdCXX directly from the command line (as found in the error log).
CMake can't find Visual Studio
Try to select the correct generator version:
> cmake --help
> cmake -G "Visual Studio 14 2015" ..
If that doesn't help, try to set the Visual Studio environment variables first (the path could vary):
> "c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat"
> cmake ..
or use the Developer Command Prompt for VS2015 short-cut in your Windows Start Menu under All Programs/Visual Studio 2015/Visual Studio Tools (thanks at #Antwane for the hint).
Background: CMake does support all Visual Studio releases and flavors (Express, Community, Professional, Premium, Test, Team, Enterprise, Ultimate, etc.). To determine the location of the compiler it uses a combination of searching the registry (e.g. at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\[Version];InstallDir), system environment variables and - if none of the others did come up with something - plainly try to call the compiler.
CMake can't find GCC (MinGW/MSys)
You start the MSys bash shell with msys.bat and just try to directly call gcc
$ gcc
gcc.exe: fatal error: no input files
compilation terminated.
Here it did find gcc and is complaining that I didn't gave it any parameters to work with.
So the following should work:
$ cmake -G "MSYS Makefiles" ..
-- The CXX compiler identification is GNU 4.8.1
...
$ make
If GCC was not found call export PATH=... to add your compilers path (see How to set PATH environment variable in CMake script?) and try again.
If it's still not working, try to set the CXX compiler path directly by exporting it (path may vary)
$ export CC=/c/MinGW/bin/gcc.exe
$ export CXX=/c/MinGW/bin/g++.exe
$ cmake -G "MinGW Makefiles" ..
-- The CXX compiler identification is GNU 4.8.1
...
$ mingw32-make
For more details see How to specify new GCC path for CMake
Note: When using the "MinGW Makefiles" generator you have to use the mingw32-make program distributed with MinGW
Still not working? That's weird. Please make sure that the compiler is there and it has executable rights (see also preconditions chapter above).
Otherwise the last resort of CMake is to not try any compiler search itself and set CMake's internal variables directly by
$ cmake -DCMAKE_C_COMPILER=/c/MinGW/bin/gcc.exe -DCMAKE_CXX_COMPILER=/c/MinGW/bin/g++.exe ..
For more details see Cmake doesn't honour -D CMAKE_CXX_COMPILER=g++ and Cmake error setting compiler
Alternatively those variables can also be set via cmake-gui.exe on Windows. See Cmake cannot find compiler
Background: Much the same as with Visual Studio. CMake supports all sorts of GCC flavors. It searches the environment variables (CC, CXX, etc.) or simply tries to call the compiler. In addition it will detect any prefixes (when cross-compiling) and tries to add it to all binutils of the GNU compiler toolchain (ar, ranlib, strip, ld, nm, objdump, and objcopy).
This happened to me after I installed Visual Studio 15 2017.
The C++ compiler for Visual Studio 14 2015 was not the problem. It seemed to be a problem with the Windows 10 SDK.
Adding the Windows 10 SDKs to Visual Studio 14 2015 solved the problem for me.
See attached screenshot.
This works for me in Ubuntu 17.10 (Artful Aardvark):
apt-get update
apt-get install build-essential
I also experienced this error when working with CMake:
No CMAKE_C_COMPILER could be found.
No CMAKE_CXX_COMPILER could be found.
The 'warning' box in the MSDN library article Visual C++ in Visual Studio 2015 gave me the help that I needed.
Visual Studio 2015 doesn't come with C++ installed by default. So, creating a new C++ project will prompt you to download the necessary C++ components.
I ran into this issue while building libgit2-0.23.4. For me the problem was that C++ compiler & related packages were not installed with VS2015, therefore "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" file was missing and Cmake wasn't able to find the compiler.
I tried manually creating a C++ project in the Visual Studio 2015 GUI (C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe)
and while creating the project, I got a prompt to download the C++ & related packages.
After downloading required packages, I could see vcvarsall.bat & Cmake was able to find the compiler & executed successfully with following log:
C:\Users\aksmahaj\Documents\MyLab\fritzing\libgit2\build64>cmake ..
-- Building for: Visual Studio 14 2015
-- The C compiler identification is MSVC 19.0.24210.0
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual
Studio 14.0/VC/bin/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual
Studio 14.0/VC/bin/cl.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
-- Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
-- zlib was not found; using bundled 3rd-party sources.
-- LIBSSH2 not found. Set CMAKE_PREFIX_PATH if it is installed outside of
the default search path.
-- Looking for futimens
-- Looking for futimens - not found
-- Looking for qsort_r
-- Looking for qsort_r - not found
-- Looking for qsort_s
-- Looking for qsort_s - found
-- Looking for clock_gettime in rt
-- Looking for clock_gettime in rt - not found
-- Found PythonInterp: C:/csvn/Python25/python.exe (found version "2.7.1")
-- Configuring done
-- Generating done
-- Build files have been written to:
C:/Users/aksmahaj/Documents/MyLab/fritzing/libgit2/build64
I had the same errors with CMake. In my case, I have used the wrong Visual Studio version in the initial CMake dialog where we have to select the Visual Studio compiler.
Then I changed it to "Visual Studio 11 2012" and things worked. (I have Visual Studio Ultimate 2012 version on my PC). In general, try to input an older version of Visual Studio version in the initial CMake configuration dialog.
For me, this problem went away on Windows when I moved my project to a shallower parent directory, i.e. to:
C:\Users\spenc\Desktop\MyProjectDirectory
instead of
C:\Users\spenc\Desktop\...\MyProjectDirectory.
I think the source of the problem was that MSBuild has a file path length restriction to 260 characters. This causes the basic compiler test CMake performs to build a project called CompilerIdCXX.vcxproj to fail with the error:
C1083: Cannot open source file: 'CMakeCXXCompilerId.cpp'
because the length of the file's path e.g.
C:\Users\spenc\Desktop\...\MyProjectDirectory\build\CMakeFiles\...\CMakeCXXCompilerId.cpp
exceeds the MAX_PATH restriction.
CMake then concludes there is no CXX compiler.
Make sure you have selected the correct version of Visual Studio. This is trickier than it seems because Visual Studio 2015 is actually Visual Studio 14, and similarly Visual Studio 2012 is Visual Studio 11. I had incorrectly selected Visual Studio 15 which is actually Visual Studio 2017, when I had 2015 installed.
After trying out all of the solutions with no luck, I just provided those missing parameter by cmake -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++ ...
Make sure you have installed Windows SDK when you were installing Visual Studio. To add windows SDK you can go to Visual Studio Installer and hit "Modify" and then tick the checkbox of Windows SDK and install it.
None of the solutions here solves my problem - only when I install Windows Update for universal C runtime.
Now CMake is working and no more link hangs from Visual Studio.
Update for Universal C Runtime in Windows
You can also make sure you are the sudo user and you have READ/WRITE access on the directory you are working. I had a similar problem on OS X, and I got it fixed just by entering in sudo mode.
Just in case it helps any one like me in future:
I have had this issue for 24 hours now, on 3 different 64-bit machines(Win7 , Windows 8.1 VM and WIn 8.1 laptop) - whilst trying to build WebKit with VS 2017.
The simple issue here is that the VC++ compiler (i.e cl.exe and it's dependent DLLs) is not visible to CMake. Simple. By making the VC++ folders containing those binaries visible to CMake and your working command prompt(if you're running Cmake from a command prompt), voila! (In addition to key points raised by others , above)
Anyway, after all kinds of fixes - as posted on these many forums- I discovered that it was SIMPLY a matter of ensuring that the PATH variable's contents are not cluttered with multiple Visual Studio BIN paths etc; and instead, points to :
a) the location of your compiler (i.e. cl.exe for your preferred version of Visual Studio ), which in my case(targeting 64-bit platform, and developing on a 64-bit host) is:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.15.26726\bin\Hostx64\x64
b) and in addition, the folder containing a dependent DLL called (which cl.exe is dependent on):
api-ms-win-crt-runtime-l1-1-0.dll - which on my machine is:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\Remote Debugger\x64
These two directories being added to a simplified and CUSTOM System Path variable(working under a Admin priviledged commmand prompt), eliminated my "No CMAKE_C_COMPILER could be found" and "No CMAKE_CXX_COMPILER could be found." errors.
Hope it helps someone.
I get exactly the reported error if ccache is enabled, when using CMake's Xcode generator. Disabling ccache fixed the problem for me. Below I present a fix/check that works for MacOS, but should work similarly on other platforms.
Apparently, it is possible to use CMake's Xcode generator (and others) also in combination with ccache, as is described here. But I never tried it out myself.
# 1) To check if ccache is enabled:
echo $CC
echo $CXX
# This prints something like the following:
# ccache clang -Qunused-arguments -fcolor-diagnostics.
# CC or CXX are typically set in the `.bashrc` or `.zshrc` file.
# 2) To disable ccache, use the following:
CC=clang
CXX=clang++
# 3) Then regenerate the cmake project
cmake -G Xcode <path/to/CMakeLists.txt>
I know this question is about visual studio 2015. I faced this issue with visual studio 2017. When searched on google I landed to this page. After looking at first 2,3 answers I realized this is the problem with vc++ installation. Installing the workload "Desktop development with c++" resolved the issue.
I updated Visual Studio 2015 update 2 to Visual Studio 2015 update 3, and it solved my problem.
I had the same issue with cmake-gui (No CMAKE_CXX_COMPILER could be found.), while running CMake from the command line worked fine. After manually adding the entries
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin
to the PATH environment variable it worked for me.
For me it worked to use the Developer Command Prompt that comes with Visual Studio and then just cd to your/jcef/dir and run cmake -G "Visual Studio 14 Win64" ..
I had the same problem.
I was trying to install dlib on my machine and it gave me this error.
The tutorial mentioned in the question leads to downloading visual studio 2017. I solved this by uninstalling VS 2017 and installing VS 2015
One can install VS 2015 via this stackoverflow thread :
How to download Visual Studio Community Edition 2015 (not 2017)
Look in the Cmakelists.txt if you find ARM you need to install C++ for ARM
It's these packages:
C++ Universal Windows Platform for ARM64 "Not Required"
Visual C++ Compilers and libraries for ARM "Not Required"
Visual C++ Compilers and libraries for ARM64 "Very Likely Required"
Required for finding Threads on ARM
enable_language(C)
enable_language(CXX)
Then the problems
No CMAKE_C_COMPILER could be found.
No CMAKE_CXX_COMPILER could be found.
Might disappear unless you specify c compiler like clang, and maybe installing clang will work in other favour.
You can with optional remove in cmakelists.txt both with # before enable_language if you are not compiling for ARM.
On M1 Mac, add the following config to fix it for me
-DCMAKE_C_COMPILER="${OTHER_CXX_FLAG}" -DCMAKE_C_COMPILER="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -DCMAKE_CXX_COMPILER="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++"
The config result is:
cmake ../build -DCMAKE_C_COMPILER="${OTHER_CXX_FLAG}" -DCMAKE_C_COMPILER="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -DCMAKE_CXX_COMPILER="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++" -DCMAKE_SYSTEM_NAME=Darwin -DCMAKE_TARGET_SYSTEM=mac -GXcode