Long time Linux user diving into Windows 11 dev, looking for suggestions #1068
Replies: 21 comments 24 replies
-
- Use Microsoft Visual Studio 2022 (not VS Code)
- Use CMake for Windows and generate MSVC solution files. I do not use
the built-in cmake integration. Any regeneration of the solution files,
automatically reloads in the IDE.
- To install 3rd party packages such as assimp, utilize vcpkg. I am
really hoping vsg and vsgcs switch to using vcpkg. Once you use vcpkg to
install 3rd party libraries, you can point the CMake Build to the toolchain
vcpkg/scripts/buildsystems/vcpkg.cmake (all 3rd party libraries will now be
available).
Install WSL2. I have not run vulkan on wsl2 but am sure that is possible
with NVIDIA drivers.
Good luck.
…On Wed, Jan 10, 2024 at 3:04 PM Robert Osfield ***@***.***> wrote:
Hi All,
I have bought myself a Windows 11 desktop system that I plan to use for
development purposes and would like suggestions from the community about
what tools are worth installing to make the experience for a long time
unix/linux user more harmonious.
I'll need to build the OSG, VSG, Qt and various standard developer
libraries, as well as add on libraries like vsgCs. I will need to use CMake
as well as Microsoft dev tools. I have used them all before but I'm pretty
rusty and not up to date with the latest versions of these tools.
Tomorrow I'll have a bash at install the main dev tools and libraries and
set about build the OSG and VSG, and hopefully avoid the usual frustration
I get fighting with Microsoft's OS and development tools.
Thanks for your assistance,
Robert,
—
Reply to this email directly, view it on GitHub
<#1068>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHWFHIJUR3B2ENJLCUV4R63YN3X33AVCNFSM6AAAAABBVLQKTWVHI2DSMVQWIX3LMV43ERDJONRXK43TNFXW4OZWGA2TOMZVHE>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
--
S <https://www.nodein.com/>uresh K. Kannan, Ph.D.,
Chief Scientist, Nodein
https://www.nodein.com
|
Beta Was this translation helpful? Give feedback.
-
Thanks, install Visual Studio 2022 installing right now, Will next look at installing vcpkg. As for VSG support for it, I have no experience with it so will have to defer to the community to make this happen. For vsgCs you'll need to see if @timoore can do this or help implement yourself/with other members of the community. Will also look into WSL2. However I do need to manager how much new stuff I need to learn and setup right away as I already have the OS, VS and vcpkg to get to grips with. |
Beta Was this translation helpful? Give feedback.
-
After installing Visual Studio I followed the suggestion for checking out a github repo so I cloned VulkanSceneGraph but was shocked that it put it in a C:/Users/rober directory. Had I made a typo is setting up my user account on this new machine?? After looking into this problem it turns that Microsoft truncats usernames by default to 5 characters without telling you. WTF? First bit of stupid Microsoft dumb decision to deal with. So OK now how to fix it... I came across and followed the instructions on this page: https://www.elevenforum.com/t/change-name-of-user-profile-folder-in-windows-11.2133/ The instructions worked but hell, this is appallingly bad UI and OS design. How to f*ck does stuff like this get included in a modern OS? Are there trolls in the basement at Microsoft HQ that hold on to their domain and don't allow it advanced past what MS were doing in the early 80's? |
Beta Was this translation helpful? Give feedback.
-
I don't see it mentioned yet, I find the Git for Windows download absolutely essential. Based on Msys, it provides a very familiar bash plus git command line experience. I usually build the whole VSG family in Debug and Release modes with a bash script that invokes cmake... even though I generate VSStudio projects. Then I debug in Visual Studio. As an aside, I have been using Gnu Emacs for 35 years and am helpless in any other editor. Emacs on Windows, and in particular the magic Git subsystem, work very well. There is some weirdness in that the subshell is cmd and not bash, but I grit my teeth and just deal with it. I think WSL2 is cool, but really it is just a really good Linux VM on Windows with good, but not great, access to the Windows filesystem. I have experimented with Microsoft's Vulkan-on-DirectX12 contribution to Mesa to the point of getting the Vulkan cube running in WSL2. Vcpkg is the way to go on Windows, and I see that the rocky project has some vcpkg stuff for pulling in VSG, IIUC. I am looking at it for vsgCs, but cesium-native is a formidable challenge with tons of external dependencies that are brought into its own source tree, so I would probably have to do some vcpkg integration for it first. I simply ignore the username breakage 🤪 Tim |
Beta Was this translation helpful? Give feedback.
-
Fwiw, I am just using Git for Windows from https://git-scm.com/download/win and then open the terminal via right-clicking in the Explorer and then 'Git Bash Here'. In general, I am trying to stay away from Windows specific things so that I don't get annoyed like you experienced already... I don't like 'being helped' by Windows and tools. |
Beta Was this translation helpful? Give feedback.
-
I'm still fighting with the OS having screwed after me trying to fixing the originally broken username. I am appalled at how bad the user experience is, I just can't understand why Microsoft would user a 5 character name policy for user directories and not provide any support for fixing it. I've spent the whole morning trying to fix things and am getting nowhere. Things I try to fix the OS breaks it again. |
Beta Was this translation helpful? Give feedback.
-
Thanks for all the suggestions. As an update, I've had to start from scratch and reinstall Windows 11, and am back to waiting on the Visual Studio Installer downloading all it needs to. Once that's installed I'll follow the vckpg guidelines to install it. That will probably take to the end of the working day and will have to look at Git For Windows etc. tomorrow. |
Beta Was this translation helpful? Give feedback.
-
I'm using VS2022 (the free community edition), with its built-in git/cmake support (I try to get away with having as few additional tools as possible, though I think for 'more advanced' uses cases having stand-along tools is still the way to go, sadly). Agree on using vcpkg for 3rd-party libraries though it can be pretty overwhelming what with the constant updates and (as far as I know, which doesn't amount to much) inability to (at least easily) NOT live on the bleeding edge, especially if many libraries are being used |
Beta Was this translation helpful? Give feedback.
-
I think I'm making a bit of progress. I have Visual Studio, vcpkg and VulkanSK installed, and have used Visual Studio's integrated Github support to clone VulkanSceneGraph and somehow configured CMake and it builds the VSG and when I install it places it in a local VulkanSceneGraph/out/install directory. I have then tried to get it to use CMAKE_INSTALL_PREFIX=C:/Program Files/VSG, a directory that I already created as this is what we suggest in the VulkanSceneGraph/INSTALL.md for Windows (I didn't write this part of the INSTALL.md) but when I try to install now I get the error: CMake Error at src/vsg/cmake_install.cmake:36 (file):
file INSTALL cannot make directory "C:/Program Files/VSG/include/vsg": No Is this because Program Files is system path? I used power shell with administrative privileges to create the C:/Program Files/VSG so perhaps this is the problem, or is it that I have to escalate the the install privileges of the Visual Studio install? |
Beta Was this translation helpful? Give feedback.
-
No; you might want to add C:\dev\vsg\bin to your path so that other projects can find the VSG dlls. VSG programs installed to C:\dev\vsg\bin will find the necessary dlls because (I think!) the directory of the executable is always searched for dlls, barring other shenanigans. What you will need to do is add C:\dev\vsg to the CMAKE_PREFIX_PATH of other projects that don't install to C:\dev\vsg.
@LeeRiva has the Visual Studio solution. I personally do that with a bash script that invokes cmake --build with the different targets. |
Beta Was this translation helpful? Give feedback.
-
yes, I'd like to backup Tim, that's how I use it too. That's what I meant when I said earlier to avoid such built-in tooling, to be in full control and avoid hassle. |
Beta Was this translation helpful? Give feedback.
-
On Linux I just install all my locally built projects to /home/robert/Install and set my CMAKE_INSTALL_PREFIX to this value and LD_LIBRARY_PATH and PATH vars to bin and lib directories. Things work pretty well for CMake projects with this approach. Would the same approach work fine for Windows11+VisualStudio 22? I'm thinking something like a C:/install directory or C:/Users/rober/install but frankly that later just rubs salt in the wound that has been created by Microsoft incompetence so inclined to go with C:/install. As an experiment I tried setting the CMAKE_INSTALL_PREFIX as an env var but Visual Studio's inbuilt CMake support just ignores this and looks to use it's own prefix, I believe based in the file: ........\AppData\Local\Microsoft\VisualStudio\17.0_3f215859\OpenFolder\CMakeSettings_schema.json {
"configurations": [
{
"name": "x64-Debug",
"generator": "Ninja",
"configurationType": "Debug",
"inheritEnvironments": [ "msvc_x64_x64" ],
"buildRoot": "${projectDir}\\out\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "",
"ctestCommandArgs": ""
}
]
} Would it be OK to just change installRoot to "C:\install" ? Or should I just manually override this each time, or just ditch Visual Studio for cmake configure and build like others are doing? I'd like to get familiar with the basics of Visual Studio 22 dev so that when users encounter similar problems I can understand where they are coming from. Slightly longer term I will want to automate far more like I have under Linux with a simple bash script configuring, building and installing all the VSG projects for me. |
Beta Was this translation helpful? Give feedback.
-
I am looking for a way to tell Visual Studio's CMake configure what value of CMAKE_INSTALL_PREFIX to use by default. Setting the CMAKE_INSTALL_PREFIX doesn't look to have any effect. Editing the CMakeSettings_schema.json just helps the project where I edit it, not the next project I build. Any suggestions? |
Beta Was this translation helpful? Give feedback.
-
You can do that. C:\dev is a good place because other things, like vckpg and the project you will be working on, already assume that as the "root" directory.
I vote for that. It will be most familar as a Linux refugee. It's cool that Visual Studio has support for CMake and git these days, but I haven't found any added value for the stuff I do. As for what other users do, there are a lot of development environments out there...
You can do all that with the bash that's in Git for Windows. Professional CMake describes some ways to automate setting up projects that use the same install prefix, etc. I was just skimming it on the airplane, but I think "CMake presets" are the way to set these up. |
Beta Was this translation helpful? Give feedback.
-
Hi Robert,
As @timoore mentioned, we usually clone repos under C:\Dev. |
Beta Was this translation helpful? Give feedback.
-
In case it helps, here's a PowerShell script I use to get and build VSG updates: https://gist.github.com/AnyOldName3/5e35690efa07c6e3daa783405358eed3 It doesn't really cover ground that's not been discussed by other posts as the key stuff is just calling It's PowerShell because CMD is truly awful (not a controversial statement) and I find Bash is more hassle than PowerShell (probably a pretty controversial statement, but I don't think it would be productive to have a debate around this). For someone who's got plenty of Bash experience, it's most likely going to be easiest to keep using Bash, either via the cut-down MSYS2 environment that ships with Git for Windows as Git Bash, or via full MSYS2. Just avoid CMD wherever possible, or it really will feel like Microsoft have done nothing to improve anything since the 80s. Personally, I've set up the VSG without vcpkg managing the deps - there aren't many deps for VSG, so it would have been more hassle than it was worth (freetype and curl have Windows binaries, and assimp is easy to build). I'd recommend against making vcpkg be the only way to build the VSG on Windows for basically the same reason as I'd recommend against it being the only way on any other platform (it's a cross-platform tool, not just for Windows, just like pip, npm or nuget), but it's a good tool to have in the box, especially when it's officially supported. The biggest disadvantages are that it works best when all your dependencies use it, when not everything, especially proprietary libraries, work with it at all, and that different libraries are managed in a single monolithic git repo, so if you don't want to use a combination of versions that existed in a single commit, you may need to maintain your own fork. I'm told that's not as horrible as it sounds, as some effort's gone into making that viable, but it it's not hassle-free. Also, as everything's built from source, it's not the fastest or most disk-space-efficient option. If you handle your dependencies yourself, it's basically a matter of putting them somewhere, and then making sure that that/those location(s) are listed in the
I suspect that some of the confusion with build types is that CMake's got two ways of doing things:
For reasons, if you configure a CMake project through Visual Studio, it defaults to single-config Ninja. If you do, then the dropdown will only have whatever I think this is all the stuff I have to infodump for now. I'll just leave you with the final thought that it's helpful to remember that Windows isn't, and has never been, Unix or a Unix clone. If you've not been using it, there's a lot of stuff that'll be different in surprising ways. Plenty will seem mad, but usually it's something that seemed like a reasonable idea a long time ago back when there were things other than Windows and Unix. There are some good reasons why Windows is the only mainstream non-Unix OS to survive. |
Beta Was this translation helpful? Give feedback.
-
And once I post it, the one I thought I'd sent yesterday that didn't appear when I refreshed the page decides to materialise. |
Beta Was this translation helpful? Give feedback.
-
I have been away from getting my Windows PC setup for a few days as I have been doing office admin and changing the hardware configuration of my new Intel iCore7 Windows 11 PC and pre-existing AMD5700G Kubuntu 22.04 system. I finally have the hardware side locked in and working well so am jumping back to Windows dev environment setup. I have followed @MauFranco suggestions and created a create a C:/dev directory, moved vcpkg to there and installed libcurl, assimp and freetype, I see VSG and vsgXchange are available already too, though I'll obviously rolling that myself. I have cloned the main VSG projects into the C:/dev directory to sit alongside vcpkg and now looking the trying PowerShell out for running cmake and doing the build. I don't yet have cmake installed separately, so far I've only used the cmake integration that is found in VisualStudio 2022, I can't find a dedicated cmake executable, should I install Cmake separately? What will happen with the cmake version integrated with VisualStiudio? Chirs's script looks like a neat way to build all the VSG projects so will play with that once I got a bit further. @AnyOldName3 with line of the script $buildDirs = "VulkanSceneGraph\build", "vsgXchange", "vsgImGui", "vsgExamples", "vsgTutorial" You have the \build appended to the end of VulkanScenegraph but not the other projects, is this intended? |
Beta Was this translation helpful? Give feedback.
-
I'm currently trying to learn use of powershell and thought I'd try out @anyoldname's UpdateAll-VsgRepos.ps1 scri[t. I have created a C:/dev/install/bin directory and put the script in there, but when I attempt to run this from powershell I get: PS C:\dev\install\bin> .\updateall.ps1
.\updateall.ps1 : File C:\dev\install\bin\updateall.ps1 cannot be loaded because running scripts is disabled on this
system. For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ .\updateall.ps1
+ ~~~~~~~~~~~~~~~
+ CategoryInfo : SecurityError: (:) [], PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess So I'm now looking how one sets permissions of scripts, doesn't look like it's a straight forward as unix where the permission is local file permission.... Did a quick search across the MS docs: Is this what I need to read through? is there a short cut like unix's chmod? |
Beta Was this translation helpful? Give feedback.
-
Thanks to everyone's suggestions I'm making progress. I've tinkered with scripts, learned stuff about powershell and windows in general, come across problems and resolved a few as well. One of the gotcha that was tripping me up today was simple vsg examples like vsgdraw and vsgcompute that only depended upon the VSG library worked great, but running vsgviewer or other examples that links to vsgXchange were failing. When running within the powershell vsgviewer and other examples would just silently fail in the console without any warning. When I tried out Git Bash console I at least got a warning about shared library not being found, without any name of the shared library that was not found. I turned out that my Path env variable didn't include the path to the C:\dev\vcpkg\installed\x64-windows\bin directory. Adding the vcpkg to my path fixed these problems and I'm now able to build vsg, vsgXchange, vsgPoints, vsgImGui and vsgExamples. I'm surprised that vcpkg didn't add itself to my Path variable, perhaps it did I am accidently overwrote it at some point without realizing - very much the noob. Next up I'll install Qt and see how if I can get vsgQt to build and run. I'm see quite a few warnings about float/double, these are pretty benign but annoying for users to trawl through so I'll look to resolve these this week. To the updateall.ps1 script to work I had to make a few tweaks, such as fixing paths so they are all consistent and to add the -j 24 so I can build using all the cores on this machines Intel iCore7. $rootDir = "C:\dev\"
$installDir = "C:\dev\vsg"
$vcpkg = "C:\dev\vcpkg\vcpkg.exe"
$buildDirs = "VulkanSceneGraph\build", "vsgXchange\build", "vsgImGui\build", "vsgPoints\build", "vsgExamples\build"
&$vcpkg upgrade assimp:x64-windows
&$vcpkg upgrade curl:x64-windows
&$vcpkg upgrade freetype:x64-windows
$buildDirs | ForEach-Object {
New-Item -ItemType Directory -Force -Path "$rootDir\$_"
Push-Location "$rootDir\$_"
try {
$branch = git branch --show-current
if ($branch -ne "master") {
Write-Warning "$_ is on branch $branch"
}
git pull --ff-only
if ($LASTEXITCODE -ne 0) {
throw "Exited with code $LASTEXITCODE"
}
git submodule update --init --recursive
if ($LASTEXITCODE -ne 0) {
throw "Exited with code $LASTEXITCODE"
}
cmake .. -DCMAKE_PREFIX_PATH="$installDir" -DCMAKE_TOOLCHAIN_FILE=C:/Dev/vcpkg/scripts/buildsystems/vcpkg.cmake -DBUILD_SHARED_LIBS=ON
cmake --build . --config Release -j 24
if ($LASTEXITCODE -ne 0) {
throw "Exited with code $LASTEXITCODE"
}
cmake --build . --config Debug -j 24
if ($LASTEXITCODE -ne 0) {
throw "Exited with code $LASTEXITCODE"
}
cmake --build . --config RelWithDebInfo -j 24
if ($LASTEXITCODE -ne 0) {
throw "Exited with code $LASTEXITCODE"
}
cmake --install . --config Release --prefix $installDir
if ($LASTEXITCODE -ne 0) {
throw "Exited with code $LASTEXITCODE"
}
cmake --install . --config Debug --prefix $installDir
if ($LASTEXITCODE -ne 0) {
throw "Exited with code $LASTEXITCODE"
}
cmake --install . --config RelWithDebInfo --prefix $installDir
if ($LASTEXITCODE -ne 0) {
throw "Exited with code $LASTEXITCODE"
}
}
finally {
Pop-Location
}
} I have other variants of this script now, including one that I pass optional parameters. I am still mostly doing stuff to learn about how powershell etc. work so not worrying too much about a refined set of scripts for building everything I'll need in course of development. If I come up with something sensible then I'll post it here, or perhaps somewhere else within the VSG code base/website. When experimenting I also noticed that vsg::Trackball doesn't throw like it does under X11, this is a bit of clunky difference so at some point I'll look into how to detect a moving button release in Win32_Window.cpp. |
Beta Was this translation helpful? Give feedback.
-
Just came across another little oddity - when running vsgviewer fullscreen using the --fs command line option that model wasn't cantering in the middle of the screen, turned out that when I changed the System > Display > Scale to 125% something funky was happening to the resize of the window/ViewprtState. I haven't looked into what is happening with Win32_Window.cpp or what part of the Win32 API we'll need to add to handle this resize but it's something that I'll need to look at some point. I came across this issue with vsgQt/Qt integration so resolved it there so would guess something similar would need to be done within Win32_Window.cpp, essentially the Window says it's one size (the "scaled" size) and the Vulkan swapchain says another size - the actual display device size. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi All,
I have bought myself a Windows 11 desktop system that I plan to use for development purposes and would like suggestions from the community about what tools are worth installing to make the experience for a long time unix/linux user more harmonious.
I'll need to build the OSG, VSG, Qt and various standard developer libraries, as well as add on libraries like vsgCs. I will need to use CMake as well as Microsoft dev tools. I have used them all before but I'm pretty rusty and not up to date with the latest versions of these tools.
Tomorrow I'll have a bash at install the main dev tools and libraries and set about build the OSG and VSG, and hopefully avoid the usual frustration I get fighting with Microsoft's OS and development tools.
Thanks for your assistance,
Robert,
Beta Was this translation helpful? Give feedback.
All reactions