reupen / columns_ui

Alternative UI for the foobar2000 audio player
https://yuo.be/columns-ui
GNU Lesser General Public License v3.0
525 stars 32 forks source link

Compilation flag for VS 2015 #49

Closed MAxonn closed 7 years ago

MAxonn commented 7 years ago

I tried to build it with VS 2015 community edition and it crashed due to insufficient virtual memory. It asked me to include this additional compiler argument: /Zm111

After including it, the compilation was successful. Should I make a pull request and upload my .sln file?

reupen commented 7 years ago

Hi,

I have seen that error before, but not recently and I believe it was with an old version of VS.

Could you confirm the following:

You can also see the log for the latest build on AppVeyor here: https://ci.appveyor.com/project/reupen/columns-ui/branch/master

Thanks

zao commented 7 years ago

It tends to be reasonably easy to hit the stock heap size for the compiler when building the foobar2000 SDK, particularly if PCHs are involved. I've had personal projects where I've needed heap sizes of up to 400 megabytes.

I recommend bumping the amount needed for this component by a healthy amount, it's rather normal to have happen.

MAxonn commented 7 years ago

Hey guys :). Thanks for answering.

reupen commented 7 years ago

Thanks – it was a debug build I saw the problem with, but under VS2013 or similar. Additionally, I recall the /Zm value suggested varying, and the one it suggested not working.

The docs for /Zm (VS2015, VS2017) state the value is a percentage. The problem is, it does not state how the value represented by 100% (the default precompiled header buffer size) is calculated – it only gives 75 MB as an example. I can only surmise that it differs for your system and the ones I've run compilations on.

However, some other interesting points to note are that:

What OS are you using, and how much RAM does your PC have? I'd like to see if I can reproduce this in a VM. It'd also be useful if you could give VS2017 or VS2015 Update 3 a try. (For VS2017 you'd need to upgrade the platform toolset for the projects in the solution.)

(For reference, I'm on Windows 10, VS2015 Update 3 and have 32 GB RAM.)

MAxonn commented 7 years ago

Hey Reupen, thanks for answering again and thank you for creating everything that you did, supporting and nourishing the project!

I'm on Windows 7, x64, 8 GB of RAM. My laptop is W10, also 8 GB of RAM.

I am installing Update 3 now :). I'd rather not install VS 2017 just yet.

I guess adding /Zm120 would prevent such issues but then again it might cause undesired behavior since you mentioned that sometimes it fails. Perhaps just add this as a "good to know" in the readme.md?

reupen commented 7 years ago

Thanks! If you're still seeing it with Update 3, then yep I'll add something like /Zm125 (for debug builds – I take it release ones were OK?)

MAxonn commented 7 years ago

Great success!!! :D. After upgrading to Update 3, it didn't ask me for /Zm111 anymore!

...

It asked me for /Zm112 :D. I guess that accounts for some extra kitten parsing that they've added in the new CL that is probably costing me a few more MB off my 2011-era still decent PC :D.

Release builds are fine, yes! :)

reupen commented 7 years ago

I tried VMs of various configurations, but had no luck reproducing it. Still, I've added /Zm125 to debug builds, so you should be fine now.

Thanks

reupen commented 7 years ago

This article is also relevant: https://blogs.msdn.microsoft.com/vcblog/2017/07/13/precompiled-header-pch-issues-and-recommendations/

They actually say there not to use /Zm.

MAxonn commented 7 years ago

Hey Reupen :). Thanks for the article. Hopefully the Foobar SDK will soon advance to VS 2017 where they say they fixed some of these compiler issues.

reupen commented 7 years ago

No problem.

I think it's unlikely that there'll be an official switch to VS 2017 any time soon, but I will be switching as I'm starting to encounter compiler bugs with VS 2015 that don't happen with VS 2017.