R Xgboost: How to compile xgboost with GPU support on windows 10; can't find Visual Studio [duplicate] - r

When I am trying to install CMake I get the error:
Visual Studio 15 2017 could not find any instance of Visual Studio.
I am using Windows 7 and Visual Studio 2017. The CMakeOutput.log file writes:
The system is: Windows - 6.1.7601 - AMD64
Any ideas?

I ran into the same error and performed the following steps to resolve the issue:
Open Visual Studio
Go to Tools -> Get Tools and Features
In the "Workloads" tab enable "Desktop development with C++"
Click Modify at the bottom right
These steps resulted in the "Visual C++ tools for CMake" feature being installed, but the other optional C++ features included in this workload may also helpful for what you are trying to do.
After the Visual Studio updater finishes installing try re-running the command. You may need to open a new command window.

In my case, I installed Visual Studio, selecting the workloads and modules that I wanted, but I ignored the request to reboot, assuming that shutting down the computer at the end of the day and restarting it the following day would suffice. I was wrong.
The following day I tried a cmake build and got the "could not find any instance of Visual Studio" error. After several attempts to resolve, I re-ran the installer, made no changes to the configuration, and clicked Modify. This time I let it reboot the computer. The reboot took a long time. After which my cmake build worked.

If you have already installed the workload Desktop development with C++ and still getting the following errors while using visual studio 2022 for flutter
Generator
Visual Studio 16 2019
could not find any instance of Visual Studio.
Building Windows application...
Exception: Unable to generate build files"
Solution: Follow these steps,
Edit your_flutter_path\packages\flutter_tools\lib\src\windows\build_windows.dart, and change the constant on line 28 from Visual Studio 16 2019 to Visual Studio 17 2022
Delete flutter_tools.stamp and flutter_tools.snapshot from your_flutter_path\bin\cache\
Run flutter clean in the project

I had the same issue "could not find any instance of Visual Studio"
but with Visual Studio 2019 (Community Edition) and I just had to configure the VS160COMNTOOLS variable so that CMake correctly detects Visual Studio.
export VS160COMNTOOLS="/c/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/Tools"
(cf https://cmake.org/cmake/help/latest/generator/Visual%20Studio%2016%202019.html)
With Visual Studio 15 2017, the variable you need should be VS150COMNTOOLS.
(cf https://cmake.org/cmake/help/latest/generator/Visual%20Studio%2015%202017.html)
NB: in my case, in a Travis-CI workflow, I installed Visual Studio using the commands (no need to reboot):
choco install visualstudio2019community
choco install visualstudio2019-workload-nativedesktop # required
With only the first package, CMake detection of VS2019 failed.

I was configuring a Jenkins build node and could successfully run CMake GUI manually but command line use or builds using the CMake plugin would fail with:
Visual Studio 16 2019 could not find instance of Visual Studio.
-A x64 parameter was added with no change in result.
The problem was that CMake could not determine the Windows SDK version.
By adding CMAKE_SYSTEM_VERSION parameter CMake was then able to find Visual Studio.
-D CMAKE_SYSTEM_VERSION=10.0.18362.0 (use your windows SDK version)
Environment:
windows 10 system build: 19042
CMAKE 3.19.4
VS 2019 Professional 16.8.4
Jenkins 2.235.1
Full command line that worked:
"C:\Program Files\CMake\bin\cmake" -G "Visual Studio 16 2019" -D CMAKE_BUILD_TYPE=Release -A x64 -D CMAKE_SYSTEM_VERSION=10.0.18362.0

When using VS 2017, be aware that this is really VS 2015, and CMake identified it as VS 2017 2022 which is not the version of VS 2017 I had, that gave me this error. So the conclusion I offer is to try different versions, specifically the 2015 one.

I had a similar issue where installing libzmq in my npm project was throwing the same error and that wasn't getting solved by enabling "msbuild" under "Desktop development with C++" in the Visual Studio installer.
My solution ended up being to reinstall the Windows build tools for npm with the following command.
npm install --global windows-build-tools
Note: Remember to run the command prompt (or whatever terminal you are using) as admin before running this.

If the CMake used to work with the installed Visual Studio and is broken someday, then the problem could be VS requires system reboot to complete some update.
For quick verification, rename HKLM\SOFTWARE\WOW6432Node\Microsoft\VisualStudio\Setup\Reboot to like HKLM\SOFTWARE\WOW6432Node\Microsoft\VisualStudio\Setup\Reboot.bak, then re-run cmake which should succeed. Don't forget to rename the registry back and reboot the system if this is the problem.

In my case, I was selecting different version of visual studio in that configuration dialog box whereas I installed different version.
Do select the same version.

Above solutions did not solve this issue for me. After installing node.js from https://nodejs.org/en/download/ apparently a correct version of windows-build-tools was installed

I reinstalled the Visual Studio 2019(my former one is 2017 version ) with all those settings required(my cmake version is 3.23.0),and it works. So try to install different versions.

In my case, the problem was gone after I deleted the previous cmake result directory and then ran cmake again.

if you have installed two or more Windows 10 SDK, delete them excluding latest one.

Try downloading the windows-build-tools package.
npm install --global --production windows-build-tools --vs2015
This step should be the end-all-be-all solution to fixing node-gyp problems. For most people, that’s true. NPM has a package called windows-build-tools that should automatically install everything you need to get node-gyp working, including the Microsoft build tools, compilers, Python, and everything else required to build native Node modules on Windows.

Related

VSCode Omnisharp server A .NET 6 SDK for x86_64 was not found

Omnisharp does not seem to recognize my installed .NET sdk (version 6.0.408).
I have tried manually adding this path via settings to Omnisharp: SDK path i.e.:
C:\Program Files\dotnet\sdk\6.0.403
I have also tried reinstalling the SDK and even VSCode.
This does not seem to solve the issue however, and I am unable to run my asp.net application on VSCode. Running dotnet run from the terminal is fine.
TLDR: Both .NET SDK versions and Visual Studion versions needed to be x64.
Here was the exact error I was seeing in the Output Window:
[ERROR] A .NET 6 SDK for x86_64 was not found. Please install the
latest x86_64 SDK from
https://dotnet.microsoft.com/en-us/download/dotnet/6.0.
[ERROR] Error: OmniSharp server load timed out. Use the
'omnisharp.projectLoadTimeout' setting to override the default delay
(one minute).
When I realized there was a mismatch between my .NET SDKs and Visual Studio Code in terms of being x86 and x64, I did the following:
Deleted the bin/obj folders and .vscode folders in my VS Code project.
Uninstalled my .NET SDKs via Windows (Setings > Apps).
Uninstalled Visual Studio Code via Windows (Setings > Apps).
Installed .NET 7.0 x64 and .NET 6.0 x64.
Opened PowerShell and ran dotnet --info to make sure my .NET runtime and SDK were appearing correctly.
Installed Visual Studio Code x64.
Used PowerShell and cd'd to my project folder. Did a dotnet restore. Then launched Visual Studio Code using code . command.
I could then use the most current version of the VS Code extension (v1.25.2).
Uninstalling and then installing the VSCode extension C# for Visual Studio Code solved the issue for me.
I had the same problem and just solved it. Copy and pasting this from a Youtube comment I just finished writing, so it might sound funny out of context, but the good bits are in there. Hope it helps.
Installed dotnet 7.0, but then it said dotnet 6 was missing...
So I deleted the script asset, exited Unity, went back to their website and installed Net 6.0.403
Error still happened.
I'll note this seemed to push a script compiling error out to Unity in the inspector window, as well.
Deleted the script asset again, exited Unity again, then uninstalled both dotnet 7 and dotnet 6.
Then I reinstalled dotnet 6.
Into unity, made a new script, opened it, and this time no error message about missing net 6.
I just started yesterday. Literally. So if my solution is trash, I'll laugh with you lol. Best of luck.

"dotnet" command does nothing

I'm trying to install a global package through dotnet cli but the command dotnet does nothing. I don't get an error message that says the command is not found etc. but it also doesn't run.
Between each line, cursor inside the powershell (or command prompt) turns into Working In Background ( ) mode but after just a few seconds, it just gets into the new line without doing anything. During these few seconds, if I move the cursor outside the prompt, it goes back to regular mode. So it's doing something I guess.
What is happening here, and how can I solve this issue?
What have I already tried:
1-) Since my network is behind a proxy, I've added the proxy credentials through NPM configuration commands. (as can be seen here)
(I also set the strict-ssl to false).
2-) Since it didn't do anything, I also used this method and edited the global nuget.config file. But didn't solve any problem.
3-) I tried this too, but setting the environment variable MSBuildSDKsPath seems to do nothing about my problem.
My PATH variable has these:
C:\Program Files\dotnet,
%USERPROFILE%\.dotnet\tools
I also downloaded the latest Dotnet 5.0 SDK and installed it, but nothing.
Only command that works with dotnet is the --list-sdks command which shows this result:
I uninstalled all the .NET SDKs and runtimes, I also removed all the installed modules on both VS 2019 and VS 2022 Preview using the Visual Studio Installer, then restarted my computer.
While installing the SDKs and runtimes from Microsoft's website I checked the .NET version using the command line and command dotnet --version after every installation to see when exactly it starts not working. After installing all the SDK's up to .NET 5, there was no issue. And since I did not really need the .NET 6 SDK I didn't specifically download it thinking VS 2022 Preview would automatically install it anyways.
Using Visual Studio Installer, I installed the necessary components for the dotnet development on the VS 2019 and the previously mentioned command was working on point. Then I proceeded to install the necessary components on the VS 2022 Preview but after installing it, the command started to not work. So there it was, the source of the problem. Something about VS 2022 Preview's installment process just corrupts dotnet cli, but I'm not sure if it's just me.
You also need a restart after all the installments or dotnet cli might show some errors.

Visual Studio: attribute 'nodiscard' requires compiler flag '/std:c++17'

Im following this guide: https://www.azerothcore.org/wiki/Installation
I am trying to compile build 6a95e61 with no additional modules under win64 and get 439 identical errors. They point to different files after like half a minute when selecting build/build solution in Visual Studio:
C2429 attribute 'nodiscard' requires compiler flag '/std:c++17' (compiling source file C:\Azerothcore\azerothcore\src\server\shared\DataStores\DBCDatabaseLoader.cpp) shared c:\azerothcore\azerothcore\src\common\datastores\dbcfileloader.h 38
A full wipe and starting over from git-bash yields the same results, so i guess im making mistakes in the process, any suggestion is appreciated.
Big thanks to the guys on azerothcore discord!
Steps which solved it for me:
Uninstalling Visual Studio 2017 and cMake 3.8.2
Installing Visual Studio 2019 with all dependancies in "Desktop Development with C++" and
Installing cMake 3.19.2
re-Built with cMake (as in the official guide)
Build/Build Solution in Visual Studio (as in the official guide)

No option for "Add Client Side Library" on Visual Studio Mac 2019

Can't see any option to add client side library on Visual Studio for Mac 2019 (Version 8.3.3).
Seems to be supported as I seen a few tutorials on a Mac for it but can't seem to find the option myself.
You have to run the following command to install libman on your macOS:
dotnet tool install -g Microsoft.Web.LibraryManager.Cli
After running the above command try:
libman --version
If you get the error Command not found: libman
Then also run the following command:
export PATH="$PATH:/Users/username/.dotnet/tools"
where username would be your macOS user.
There is a separate Library Manager extension you can install which adds support for LibMan in Visual Studio for Mac.
Otherwise you can install the libman global tool and use the command line.
dotnet tool install -g Microsoft.Web.LibraryManager.Cli
Go to Menu Visual Studio, Extensions, Gallery, add library manager, restart Visual studio, and in the Add client-said Library solution, that's it

Installation of Qt 5.6.1 MSVC 2015 Update 3

I have encountered the following problem during a routine Qt 5 installation combined with Visual Studio 2015:
I did these steps:
Installed visual studio 2015 enterprise
Updated it to Update 3 (recent)
Installed X64 Debuggers And Tools-x64_en-us + 32bit
Installed Qt 5.6
I inspected the automatic detection of compiler, debuggers and the build environment comparing it to another machine, and all look OK.
Created new test projects using empty console application, Qt quick.
All fail during compilation step, with exactly 20 errors:
20 compile errors
I noted that the errors appears in code files of VC++ include path
for example in the code file xtr1common (first error in the picture).
I installed and used Qt with MSVC including MSVC Update 2 many times before but not with Update 3. What went wrong? How do I fix the problem?
Just go to windows updates and remove the visual studio update 3. This will return visual studio to original status including the C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE folder.
I hope there is a better answer than this because I needed the visual studio update 3 for other purposes than Qt. But what to do if the Qt 5.6.1 is not compatible with Visual Studio 2015 update 3. If someone have a better answer please hit me.

Resources