I was using vcpkg in classic mode. Then I found about vcpkg manifests, I placed a vcpkg.json file on my project folder and fired cmake. And the following happened:
-- Building for: Visual Studio 16 2019
-- Found Git: C:/Program Files/Git/cmd/git.exe (found version "2.29.1.windows.1")
-- Bootstrapping vcpkg before install
-- Bootstrapping vcpkg before install - failed
CMake Error at C:/Users/user/project/src/vcpkg/scripts/buildsystems/vcpkg.cmake:850 (message):
vcpkg install failed. See logs for more information:
C:\Users\user\project\src\mylib\x64\vcpkg-bootstrap.log
Call Stack (most recent call first):
C:/Qt/Tools/CMake_64/share/cmake-3.21/Modules/CMakeDetermineSystem.cmake:121 (include)
CMakeLists.txt:6 (project)
-- Configuring incomplete, errors occurred!
Microsoft (R) Build Engine version 16.11.0+0538acc04 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
MSBUILD : error MSB1009: Project file does not exist.
Switch: ALL_BUILD.vcxproj
C:\Users\user\project\src\mylib
done
It tells me to check vcpkg-bootstrap.log but it is empty.
So, am I messing with something or it's not really supported to use vcpkg in manifest mode after it has been used in classic mode?
Or, in other words, do I need a fresh vcpkg git clone to use manifests?
I am newbie in using C++ and I have hard times to compile the io2d with CMake. I am currently using Windows, and I have used vcpkg to download the io2d packages, cairo packages and graphicsmagick packages. Everything are downloaded by both x64 and x86 windows.
The way I follow through on the installation work is from the Buildings Steps in Cairo/Win32 on Windows:
https://github.com/cpp-io2d/P0267_RefImpl/blob/master/BUILDING.md
However, when I build with cmake -G "Visual Studio 16 2019" --config Debug "-DCMAKE_BUILD_TYPE=Debug" "-DCMAKE_TOOLCHAIN_FILE=c:/source/vcpkg/scripts/buildsystems/vcpkg.cmake" "-DVCPKG_TARGET_TRIPLET=x64-windows" ..\. , it appears the following error. And I have looked for online but seems cannot find a solution with windows system.
Happy to get any opinions and help on this issue.
PS C:\Users\samue\OneDrive\桌面\Udacity\CppND-Route-Planning-Project\P0267_RefImpl\Debug> cmake -G "Visual Studio 16 2019" --config Debug "-DCMAKE_BUILD_TYPE=Debug" "-DCMAKE_TOOLCHAIN_FILE=c:/source/vcpkg/scripts/buildsystems/vcpkg.cmake" "-DVCPKG_TARGET_TRIPLET=x64-windows" ..\.
-- Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.18363.
Default IO2D backend was not specified, choosing automatically...
Found Windows, using CAIRO_WIN32.
CMake Error at C:/Program Files/CMake/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:218 (message):
Could NOT find Cairo (missing: CAIRO_INCLUDE_DIRS CAIRO_LIBRARIES)
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:577 (_FPHSA_FAILURE_MESSAGE)
cmake/FindCairo.cmake:102 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
P0267_RefImpl/P0267_RefImpl/cairo/CMakeLists.txt:5 (find_package)
-- Configuring incomplete, errors occurred!
I have tried another way to compile, but also does not work which yield to another problem. The location of my entire project folder is in the following address: C:\Users\samue\OneDrive\桌面\Udacity\CppND-Route-Planning-Project.
When I tried to build the project, firstly I cd to the address above.
Then use mkdir build and cd build
Then run cmake ..
But, it appears the error code in finding the io2d configuration files. I have no idea how to let CMake to find the required files. The error is located as belows:
PS C:\Users\samue\OneDrive\桌面\Udacity\CppND-Route-Planning-Project\build> cmake ..
-- Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.18363.
CMake Error at C:/source/vcpkg/scripts/buildsystems/vcpkg.cmake:622 (_find_package):
By not providing "Findio2d.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "io2d", but
CMake did not find one.
Could not find a package configuration file provided by "io2d" with any of
the following names:
io2dConfig.cmake
io2d-config.cmake
Add the installation prefix of "io2d" to CMAKE_PREFIX_PATH or set
"io2d_DIR" to a directory containing one of the above files. If "io2d"
provides a separate development package or SDK, be sure it has been
installed.
Call Stack (most recent call first):
CMakeLists.txt:15 (find_package)
-- Configuring incomplete, errors occurred!
when build c-driver libbson, I have a CMake error
C:\mongo-c-driver-1.15.0\src\libbson>cmake -DCMAKE_INSTALL_PREFIX=C:\mongo-c-driver -G "Visual Studio 14 2015 Win64"
CMake Warning:
No source or binary directory provided. Both will be assumed to be the
same as the current working directory, but note that this warning will
become a fatal error in future CMake releases.
-- Selecting Windows SDK version 10.0.14393.0 to target Windows 10.0.17134.
libbson version (from VERSION_CURRENT file): 1.15.0
-- struct timespec found
CMake Error at C:/Program Files/CMake/share/cmake-3.15/Modules/CMakePackageConfigHelpers.cmake:265 (message):
Variable LIBRARY_INSTALL_DIRS does not exist
Call Stack (most recent call first):
build/cmake/BSONPackage.cmake:10 (configure_package_config_file)
build/cmake/BSONPackage.cmake:26 (install_package_config_file)
CMakeLists.txt:378 (include)
and LIBRARY_INSTALL_DIRS is in BSONPackage.cmake
set (INCLUDE_INSTALL_DIRS ${BSON_HEADER_INSTALL_DIR})
set (LIBRARY_INSTALL_DIRS ${CMAKE_INSTALL_LIBDIR})
set (PACKAGE_LIBRARIES bson-1.0)
How can i build it?
I had the same CMake error when running this command inside the libbson folder C:\mongo-c-driver-1.15.0\src\libbson. Can you try running it in the C driver folder instead:
C:\mongo-c-driver-1.15.0>cmake -DCMAKE_INSTALL_PREFIX=C:\mongo-c-driver -G "Visual Studio 14 2015 Win64"
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
I need to compile boost 1.39.0 library which on this version, don't provide installer in order to run a Visual Studio 2008 solution. The Cmake throw this exception.
-- Building for: Visual Studio 9 2008
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt: 28 (project):
No CMAKE_C_COMPILER could be found.
No CMAKE_CXX_COMPILER could be found.
I couldn't figure out how could i specify where it could find visual studio compiler.
I'm using boost 1.39.0 with CMake 3.0.0
Kind regards.
I usually build Boost with the bjam:
Run bootstrap.bat (it's the root directory of boost sources). This creates a bjam.exe.
Run bjam. Use this parameters (for 64 bit):
bjam toolset=msvc-9.0 --build-type=complete address-model=64 stage
You will find all built binaries in the stage directory.
See this for more info.