-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows 11, Visual Studio build, QGIS.exe built, but will not run #59249
Comments
I looked at your other issues and, in my opinion, your build environment is kind a mess 😄 You should proceed step by step. If you encounter an error, report it (make sure this is a real issue, double check your cmake command, etc...) |
@nicogodet It was initially a clean system following the build instructions but I've had to add things that were missing to get past build issues as there are gaps in the documentation. Literally, this was a completely clean system before I started and I started with the install.md instructions but those did not work. I finally have a build and @m-kuhn has been helping get through some issues. |
This is wrong. I try to build locally too and I assumed that Install.md is perfect and everything is correct. I just followed the steps and reported errors when I found some :
I believe this is the correct way to proceed instead of locally install missing things... |
Currently, with fixes, I can follow Install.md steps without errors when building dependencies locally (I expect bigobj to raise an error soon) |
Successful build fix bigobj workaround (waiting for automoc) |
>I believe this is the correct way to proceed instead of locally install missing things...
@nicogodet , I agree with you here and have a thread open working with m-kuhn as we go along. Please keep in mind that I am primarily a windows guy, and not really familiar with python, but coming up to speed.. So, there was a lot of things I was learning and picking up on the fly.
I did follow the instructions, and even added missing parameters to the cmake for the missing flex and bison parameters that in the command, so intentions were good, I just didn't know what I didn't know.
So, after the build worked, do you think it's basically the missing .env file causing most of the issues with it not being able to run? That's my thought, but I am not 100% sure I can align everything in the installed environment file vs. what's in the sdk. That, I'll need some help with and some guidance.
Also, my plan is going to go back from square one and see if I can get a repeatable build and run process, that's the goal.
Please let me know about what you find with getting the built .exe to run.
…________________________________
From: Nicolas Godet ***@***.***>
Sent: Tuesday, October 29, 2024 12:58 PM
To: qgis/QGIS ***@***.***>
Cc: danodom-tcb ***@***.***>; Author ***@***.***>
Subject: Re: [qgis/QGIS] Windows 11, Visual Studio build, QGIS.exe built, but will not run (Issue #59249)
Successful build fix bigobj workaround (waiting for automoc)
Need to figure out .env file now...
—
Reply to this email directly, view it on GitHub<#59249 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/BMHU5DYNKESRA4HZCX4XIJTZ56A7FAVCNFSM6AAAAABQXVPRK6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINBUGE2DKMBWGA>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
@nicogodet , Also, could provide me with what all needs to be installed, currently the instructions say Visual Studio 2022 and then the SDK and basically that's it.
What else needs to be installed as I am going to be working on getting a clean system to use for starting this from scratch again?
From the outside looking in, the install.md can be a tad confusing on what's required based on which method you are using.
________________________________
From: Daniel Odom ***@***.***>
Sent: Tuesday, October 29, 2024 3:20 PM
To: qgis/QGIS ***@***.***>; qgis/QGIS ***@***.***>
Cc: Author ***@***.***>
Subject: Re: [qgis/QGIS] Windows 11, Visual Studio build, QGIS.exe built, but will not run (Issue #59249)
>I believe this is the correct way to proceed instead of locally install missing things...
I agree with you here and have a thread open working with m-kuhn as we go along. Please keep in mind that I am primarily a windows guy, and not really familiar with python, but coming up to speed.. So, there was a lot of things I was learning and picking up on the fly.
I did follow the instructions, and even added missing parameters to the cmake for the missing flex and bison parameters that in the command, so intentions were good, I just didn't know what I didn't know.
So, after the build worked, do you think it's basically the missing .env file causing most of the issues with it not being able to run? That's my thought, but I am not 100% sure I can align everything in the installed environment file vs. what's in the sdk. That, I'll need some help with and some guidance.
Also, my plan is going to go back from square one and see if I can get a repeatable build and run process, that's the goal.
Please let me know about what you find with getting the built .exe to run.
…________________________________
From: Nicolas Godet ***@***.***>
Sent: Tuesday, October 29, 2024 12:58 PM
To: qgis/QGIS ***@***.***>
Cc: danodom-tcb ***@***.***>; Author ***@***.***>
Subject: Re: [qgis/QGIS] Windows 11, Visual Studio build, QGIS.exe built, but will not run (Issue #59249)
Successful build fix bigobj workaround (waiting for automoc)
Need to figure out .env file now...
—
Reply to this email directly, view it on GitHub<#59249 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/BMHU5DYNKESRA4HZCX4XIJTZ56A7FAVCNFSM6AAAAABQXVPRK6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINBUGE2DKMBWGA>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
(side note: Best would be to answer on github directly instead of email which tends to break message format)
You only need visual studio and you need to compile dependencies yourself as SDK is broken (see #59231). Cmake command looks like: cmake -S . `
-B build `
-D WITH_VCPKG=ON `
-D BUILD_WITH_QT6=ON `
-D WITH_QTWEBKIT=OFF `
-D VCPKG_TARGET_TRIPLET=x64-windows-release `
-D VCPKG_HOST_TRIPLET=x64-windows-release `
-D CMAKE_BUILD_TYPE=RelWithDebInfo `
-D WITH_DESKTOP=ON `
-D WITH_3D=ON `
-D WITH_BINDINGS=ON `
-D ENABLE_TESTS=OFF `
-D USE_CCACHE=ON `
-D CMAKE_C_COMPILER_LAUNCHER="C:\ccache\ccache.exe" `
-D CMAKE_CXX_COMPILER_LAUNCHER="C:\ccache\ccache.exe" `
-D VCPKG_INSTALL_OPTIONS="--x-buildtrees-root=C:\vcpkg\src" `
-D FLEX_EXECUTABLE="C:\Flex_bison\win_flex.exe" `
-D BISON_EXECUTABLE="C:\Flex_bison\win_bison.exe" `
-D CREATE_ZIP=ON |
@m-kuhn I'm able to confirm a successful build on windows with below steps:
|
🎉
where did that come from? |
CMake tries to install icons in default install dir (C:/Program Files (x86)) without admin rights |
@nicogodet @m-kuhn , so I don't need to install python or anything else, only Visual Studio 2022? |
@nicogodet @m-kuhn and do not build from within VS 2022 (debug or release)? |
and flex and bison
I would avoid doing so in a first step (just to avoid problems); but it should also work |
Assume the link to winflexbison in the install.md is appropriate for these? |
Yes |
@nicogodet is this the root path to the QGIS source code? -D VCPKG_INSTALL_OPTIONS="--x-buildtrees-root=C:\vcpkg\src" ` |
No. My QGIS src are in D:\QGIS_src and all commands from #59249 (comment) are executed within this folder. -D VCPKG_INSTALL_OPTIONS="--x-buildtrees-root=C:\vcpkg\src" allows you to specify where vcpkg will store sources of downloaded dependencies. I think you can safely omit this option. |
This is there to avoid "long paths". Windows has a limitation (of 260?) chars and with some build paths this can cause problems. Or spaces in the path. You can try without, but it may cause issues |
Indeed. Even with long path modification in regedit I recall build failure because of too long path. |
@m-kuhn @nicogodet so, do I need to use this or not? if so, it looks like I need to also download the current SDK. fyi, I have a net new server and starting the process of getting vs and other things installed to start/test the build/execute process. |
you should set it, it needs to be a short path (not sure exactly, fewer than 10 chars or so) which is writable for you. |
@m-kuhn . but isn't this the path to the SDK? or maybe I am misinterpreting -D VCPKG_INSTALL_OPTIONS="--x-buildtrees-root=C:\vcpkg\src" |
Is this a local that will be created and written to, I can add it in but want to make sure I provision correctly, if any is needed. |
Is this something I need to download or an option for the visual studio install (but I didn't see it)?
I don't have a ccache folder and the exe is not anywhere in the VS installed location tree.. |
This should point to an empty directory where your user can create folders and files
You can remove this option. |
@nicogodet , I found it and went ahead and downloaded it, trying to follow as close to exact as I can .. I've started the first cmake to build everything out... wish me luck :) |
@nicogodet @m-kuhn I received errors on the first cmake, I'll post the manifest. |
CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:112 (message): |
@nicogodet , @m-kuhn , I ran into at least one issue during the first cmake Here are the files with the error information : Here is the command (yes, I know there is a typo, but files were populated there) :) |
@nicogodet , |
ccache is not mandatory Link for long path could be added indeed |
@nicogodet , How is ccache.exe used when it's included? |
@nicogodet @m-kuhn , I have to admit, this is the first time I've seen a reference to fortran.. Also, how long does this step take in the process as it's just been sitting here for like 10+ minutes. |
prepare for hours |
It took between 1 and 2 hours on an AMD Threadripper 32C/64T. |
first step completed in 169 minutes... no errors thankfully.. |
@m-kuhn @nicogodet I got a ton of errors on the last step
This looks like maybe some sort of path issue as it looks like it failed adding every file into the cpack. tons of these : CMake Error at C:/QGIS/QGIS/build/src/auth/esritoken/cmake_install.cmake:39 (file): CUSTOMBUILD : CPack error : Error when generating package: qgis [C:\QGIS\QGIS\build\bundle.vcxproj] |
It seems it picks up |
I'm not confident it would work |
@nicogodet @m-kuhn , everything has worked so far up till Step 4 above in this thread.
|
@nicogodet @m-kuhn , It is a path issue... check this out.. this is the first error running the last step
CMake is referencing it in "Release" but the file is located in "RelWithDebInfo" |
@nicogodet is there a good way to pass in the actual path here, or is something hardcoded? I know it's a hack, but I could copy the RelWithDebInfo -> Release folders as I think that might work.. Albeit not the preferred method. |
This is something configured by CMake. |
@nicogodet not completely following.. Are you saying I need to go back and rerun the first couple of steps. This is the initial command that I ran. Not sure what you are requesting I do, but am hoping it's something with the last step where I don't have to do a complete rebuild.
|
Well I can't help much... If CMake target looks for files in Release folder it means that you run with Release at some point. Indeed completely delete build folder and rebuild is a solution. |
These are what I followed. |
@nicogodet |
@nicogodet @m-kuhn , so for grins and giggles, I did the copy/paste for the RelWithDebInfo folder -> release, and step 3 ran... AND... I am able to run QGIS using the last command.. my guess is that there's something in that initial cmake that is hardcoded to release in some cases, but not all. IDK.. I am happy to help debug/triage this as it feels like the process refinements you guys have made are VERY, VERY close to beginning to end. |
@m-kuhn @nicogodet , just bumping this in case you have any ideas or if this needs to be reported as a separate issue. |
I solved this issue by cleaning my build folder and retry. So it looks like a local issue rather than a real one... |
@nicogodet , did you change anything on the command that you ran (see above)? I ran from a clean system that had just been built out, so there wasn't any residual data/items floating around. |
I think this is about running from the build folder vs running from a bundled zip. |
@m-kuhn @nicogodet I am thinking that we can close this if you guys concur. The only issue is the last step in building the artifacts and an issue of where it's trying to find them. Leave this open to track, or close? Either way, a huge thank you to you both for getting this almost to the finish line. |
@m-kuhn @nicogodet I did rerun a build and it looks like there are only 3 of the n-number of folders that need to be renamed from "RelWithDebInfo" to "Release", so this looks like it may be isolated to a subset of the dependent folders for the pack process. The issue seems possibly isolated to these paths : |
Here is an approach that solves some of the issues for this scenario: kadas-albireo/kadas-albireo2#179 |
Mark, I occurred this issue also. |
What is the bug or the crash?
I have successfully built QGIS.exe with Visual Studio with some great assistance from @m-kuhn (thank you). However, I cannot get the .exe to run in Windows from the bin folder. QGIS goes to startup, and I can see something like "Starting Python" and then the window just goes away..
Also, I can take the built .exe and put it in the "QGIS Install Folder from the Installer", create an .env file in the bin folder, and it works. So, the executable is good, but there appears to be a few things missing. I am betting it needs the .env file, which I started, but there appears to be gaps in what's in the install folder vs what's in the SDK or some things might be the same, but referenced by a different name. .
I am running Windows 11, with Visual Studio 2022, SDK(vcpkg-export-20241015-154141).
Steps to reproduce the issue
see above.
Versions
Close to latest version of source, post install.md update referencing the SDK
Supported QGIS version
New profile
Additional context
No response
The text was updated successfully, but these errors were encountered: