Refocus on VS2015 .. continued FYI

Building and customizing Audacity from the source code.

If you require help using Audacity, please post on the forum board relevant to your operating system:
Windows
Mac OS X
GNU/Linux and Unix-like

Refocus on VS2015 .. continued FYI

Permanent link to this post Posted by rachalmers » Sun Apr 10, 2016 9:07 am

FYI:
The raft of errors mentioned in the OSX/VS2015 post previously of mine, are being generated in the lib-src\libnyquist part of the build. If I uncomment that part of the Project Solution - then all of those errors go away. So at least I know now what part is causing that problem, and can deal with it when I can.

There are still others, most notably in the lv2 part of the project. So I'll try turning that off too.

Code: Select all
24>LINK : fatal error LNK1104: cannot open file 'lv2.lib'
========== Rebuild All: 20 succeeded, 3 failed, 1 skipped ======


So anyway, for now, it's not all that difficult to move the whole thing up to VS2015 it seems. A few gotchas' but that's to be expected.

The first problem I encountered, related to libnyquist, was it's falling over the VS file, cstdint.h and it's declarations. Obviously not including the libnyqist in the Build solved nothing, but it did remove the errors from the output being output by that section. Like 3,750 of them give or take.

The second major source of errors that halt the build are in the lv2 part of the Project. So at this point I'm about ready to call a halt for the day myself - it is Sunday here...

So if my discoveries are of any help - well that's good.
rachalmers
 
Posts: 163
Joined: Wed Jan 06, 2016 10:53 am
Operating System: OS X 10.11 El Capitan or later (macOS)

Re: Refocus on VS2015 .. continued FYI

Permanent link to this post Posted by Gale Andrews » Sun Apr 10, 2016 12:44 pm

Thanks.

Would you find it easier to create a page about VS2015 and Audacity on http://wiki.audacityteam.org/wiki/? It might be easier to edit as you go along than a string of forum posts, and there is a talk page for draft or older material and full editing history.

If you go that route you can send me a Private Message and I can give you a Wiki account.


Gale
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual
Gale Andrews
Quality Assurance
 
Posts: 26094
Joined: Fri Jul 27, 2007 12:02 am
Operating System: Windows 10

Re: Refocus on VS2015 .. continued FYI

Permanent link to this post Posted by rachalmers » Thu Apr 14, 2016 3:25 pm

Gale,
Did you get my PM? re the Wiki. It may be useful.

That snprintf bit has me temporarily stumped. Nothing turns that sucker off.
However, I'm down to only 655 errors, 558 warnings. .... :-)

All but 3 parts building.
It really seems to be a conflict between C and C++ code being mixed together. and who knows what else.

Code: Select all
22>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1925): warning C4005: 'snprintf': macro redefinition
22>  C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1925): note: command-line arguments:  see previous definition of 'snprintf'
22>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1927): fatal error C1189: #error:  Macro definition of snprintf conflicts with Standard Library function declaration


and so on ad nauseam ..
rachalmers
 
Posts: 163
Joined: Wed Jan 06, 2016 10:53 am
Operating System: OS X 10.11 El Capitan or later (macOS)

Re: Refocus on VS2015 .. continued FYI

Permanent link to this post Posted by Gale Andrews » Thu Apr 14, 2016 6:03 pm

rachalmers wrote:Gale,
Did you get my PM? re the Wiki. It may be useful.

Yes I got round to that now. A randomly generated password for Rachalmers has been sent to your e-mail address. The password for this new account can be changed on the Change password page upon logging in.

As it is obscure how to create a new page on Wiki, I started a new page for you here: http://wiki.audacityteam.org/wiki/Building_Audacity_on_Visual_Studio_2015.

rachalmers wrote:That snprintf bit has me temporarily stumped. Nothing turns that sucker off.
However, I'm down to only 655 errors, 558 warnings. .... :-)

Have you tried right-click over "Audacity" in Solution Explorer > Properties. Then expand "Configuration Properties" and click "General". Set "Platform Toolset" to "Visual Studio 2013 (v120)". At least, that is where you change it in VS2013. It works for others, so they say.


Gale
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual
Gale Andrews
Quality Assurance
 
Posts: 26094
Joined: Fri Jul 27, 2007 12:02 am
Operating System: Windows 10

Re: Refocus on VS2015 .. continued FYI

Permanent link to this post Posted by rachalmers » Thu Apr 14, 2016 8:14 pm

Gale Andrews wrote:
rachalmers wrote:Gale,
Did you get my PM? re the Wiki. It may be useful.

Yes I got round to that now. A randomly generated password for Rachalmers has been sent to your e-mail address. The password for this new account can be changed on the Change password page upon logging in.

As it is obscure how to create a new page on Wiki, I started a new page for you here: http://wiki.audacityteam.org/wiki/Building_Audacity_on_Visual_Studio_2015.

rachalmers wrote:That snprintf bit has me temporarily stumped. Nothing turns that sucker off.
However, I'm down to only 655 errors, 558 warnings. .... :-)

Have you tried right-click over "Audacity" in Solution Explorer > Properties. Then expand "Configuration Properties" and click "General". Set "Platform Toolset" to "Visual Studio 2013 (v120)". At least, that is where you change it in VS2013. It works for others, so they say.


Gale


Thanks, yes, I'm aware of the toolset thing, but it's the purist approach I'm taking with this. Learning a lot in the process.
Thanks
Robert
rachalmers
 
Posts: 163
Joined: Wed Jan 06, 2016 10:53 am
Operating System: OS X 10.11 El Capitan or later (macOS)

Re: Refocus on VS2015 .. continued FYI

Permanent link to this post Posted by henric » Sat Apr 16, 2016 9:13 pm

rachalmers wrote:Gale,
Did you get my PM? re the Wiki. It may be useful.

That snprintf bit has me temporarily stumped. Nothing turns that sucker off.
However, I'm down to only 655 errors, 558 warnings. .... :-)

All but 3 parts building.
It really seems to be a conflict between C and C++ code being mixed together. and who knows what else.

Code: Select all
22>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1925): warning C4005: 'snprintf': macro redefinition
22>  C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1925): note: command-line arguments:  see previous definition of 'snprintf'
22>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1927): fatal error C1189: #error:  Macro definition of snprintf conflicts with Standard Library function declaration


and so on ad nauseam ..


Those errors are from some compatibility files that conflict with Microsoft's own files (IIRC, stdint.h and inttypes.h). Now that MS has them, overriding those existing system header files is asking for trouble. Look for the change "Switch to VS2015 (v140)" change I made for VS2015 support here: https://github.com/henricj/audacity/commits/vs2015
I rebase that tree every once in a while since carrying a bunch of changes way behind HEAD is a pain and (AFAIK) no one else is tracking that branch. It is a little behind the official Audacity master since that tree was broken last I tried to update. Hmmm... It is still borked (as I type this): https://travis-ci.org/audacity/audacity/builds

I got both x86 and x64 building in VS2015 and the resulting binary works for what I've tested. I started trying to get the upstream nyquist to support 64 Windows, but then I ran into a perfectly evil issue with the sockets stuff (winsock uses "SOCKET" instead of "int" and those are different on Windows x64 since "SOCKET" is 64-bits wide whereas "int" is only 32 bits). This couldn't shouldn't be relevant for Audacity, but it did get me to make a head-shaped dent in the wall. That incomplete work is here: https://github.com/henricj/nyquist/tree/x64

I don't recall if it caused problems with the VS2015 part or only with x64 builds, but the portaudio-v19 project has some command line stuff for building the ASIO and other files and re-linking after the normal MSBuild compile/link. I changed it to use MSBuild for everything. This avoids weird things happening if one, for example, changes build options or preprocessor defines in the UI and then forgets to edit the project file to make the same changes to command-line extra build stuff. It also means that the relevant files are not hidden and show up in the VS Solution Explorer.

Most of that is in portaudio-v19.vcxproj (there were some changes to the .filters file as well) and look something like this:
Code: Select all
    <UseWdmks>
    </UseWdmks>
    <UseWasapi>true</UseWasapi>
    <UseWmme>true</UseWmme>
    <UseDs>true</UseDs>
    <UseAsioSdk Condition=" '$(ASIOSDK_DIR)' != '' And Exists('$(ASIOSDK_DIR)')">$(ASIOSDK_DIR)</UseAsioSdk>
    <UseJackSdk Condition=" '$(JACKSDK_DIR)' != '' And Exists('$(JACKSDK_DIR)')">$(JACKSDK_DIR)</UseJackSdk>
...
    <SdkPreprocessorDefinitions Condition=" '$(UseWdmks)' != '' ">PA_USE_WDMKS=1;$(SdkPreprocessorDefinitions)</SdkPreprocessorDefinitions>
    <SdkPreprocessorDefinitions Condition=" '$(UseWasapi)' != '' ">PA_USE_WASAPI=1;$(SdkPreprocessorDefinitions)</SdkPreprocessorDefinitions>
    <SdkPreprocessorDefinitions Condition=" '$(UseWmme)' != '' ">PA_USE_WMME=1;$(SdkPreprocessorDefinitions)</SdkPreprocessorDefinitions>
    <SdkPreprocessorDefinitions Condition=" '$(UseDs)' != '' ">PA_USE_DS=1;$(SdkPreprocessorDefinitions)</SdkPreprocessorDefinitions>
    <SdkPreprocessorDefinitions Condition=" '$(UseJackSdk)' != '' ">PA_USE_JACK=1;PA_DYNAMIC_JACK=1;$(SdkPreprocessorDefinitions)</SdkPreprocessorDefinitions>
    <SdkPreprocessorDefinitions Condition=" '$(UseAsioSdk)' != '' ">PA_USE_ASIO=1;$(SdkPreprocessorDefinitions)</SdkPreprocessorDefinitions>
...
    <ClCompile Include="..\..\..\lib-src\portaudio-v19\src\hostapi\asio\iasiothiscallresolver.cpp">
      <ExcludedFromBuild Condition="'$(UseAsioSdk)'==''">true</ExcludedFromBuild>
      <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(UseAsioSdk)\common;$(UseAsioSdk)\host;$(UseAsioSdk)\host\pc</AdditionalIncludeDirectories>
    </ClCompile>
    <ClCompile Include="..\..\..\lib-src\portaudio-v19\src\hostapi\asio\pa_asio.cpp">
      <ExcludedFromBuild Condition="'$(UseAsioSdk)'==''">true</ExcludedFromBuild>
      <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(UseAsioSdk)\common;$(UseAsioSdk)\host;$(UseAsioSdk)\host\pc</AdditionalIncludeDirectories>
    </ClCompile>
    <ClCompile Include="$(UseAsioSdk)\common\asio.cpp">
      <ExcludedFromBuild Condition="'$(UseAsioSdk)'==''">true</ExcludedFromBuild>
      <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(UseAsioSdk)\common;$(UseAsioSdk)\host;$(UseAsioSdk)\host\pc</AdditionalIncludeDirectories>
    </ClCompile>
    <ClCompile Include="$(UseAsioSdk)\host\asiodrivers.cpp">
      <ExcludedFromBuild Condition="'$(UseAsioSdk)'==''">true</ExcludedFromBuild>
      <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(UseAsioSdk)\common;$(UseAsioSdk)\host;$(UseAsioSdk)\host\pc</AdditionalIncludeDirectories>
    </ClCompile>
    <ClCompile Include="$(UseAsioSdk)\host\pc\asiolist.cpp">
      <ExcludedFromBuild Condition="'$(UseAsioSdk)'==''">true</ExcludedFromBuild>
      <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(UseAsioSdk)\common;$(UseAsioSdk)\host;$(UseAsioSdk)\host\pc</AdditionalIncludeDirectories>
    </ClCompile>
henric
 
Posts: 29
Joined: Sun Jan 17, 2016 9:12 pm
Operating System: Windows 10

Re: Refocus on VS2015 .. continued FYI

Permanent link to this post Posted by rachalmers » Sun Apr 17, 2016 7:29 am

henric wrote:Those errors are from some compatibility files that conflict with Microsoft's own files (IIRC, stdint.h and inttypes.h). Now that MS has them, overriding those existing system header files is asking for trouble. Look for the change "Switch to VS2015 (v140)" change I made for VS2015 support here: https://github.com/henricj/audacity/commits/vs2015
I rebase that tree every once in a while since carrying a bunch of changes way behind HEAD is a pain and (AFAIK) no one else is tracking that branch. It is a little behind the official Audacity master since that tree was broken last I tried to update. Hmmm... It is still borked (as I type this): https://travis-ci.org/audacity/audacity/builds

I got both x86 and x64 building in VS2015 and the resulting binary works for what I've tested. I started trying to get the upstream nyquist to support 64 Windows, but then I ran into a perfectly evil issue with the sockets stuff (winsock uses "SOCKET" instead of "int" and those are different on Windows x64 since "SOCKET" is 64-bits wide whereas "int" is only 32 bits). This couldn't shouldn't be relevant for Audacity, but it did get me to make a head-shaped dent in the wall. That incomplete work is here: https://github.com/henricj/nyquist/tree/x64

I don't recall if it caused problems with the VS2015 part or only with x64 builds, but the portaudio-v19 project has some command line stuff for building the ASIO and other files and re-linking after the normal MSBuild compile/link. I changed it to use MSBuild for everything. This avoids weird things happening if one, for example, changes build options or preprocessor defines in the UI and then forgets to edit the project file to make the same changes to command-line extra build stuff. It also means that the relevant files are not hidden and show up in the VS Solution Explorer.

Most of that is in portaudio-v19.vcxproj (there were some changes to the .filters file as well) and look something like this:




Ok, great. Now - is this to become part of the main git repository? or will it stay on your branch? Could have saved me hours, days even ... if I"d known about it :-)
At the moment, I'm pulling directly from your git repos, via the VS2015 interface. I originally did a git clone, but now can use it directly - so if you make changes, I should see them directly. nice

Thanks for the heads up. Really appreciated.
Robert
rachalmers
 
Posts: 163
Joined: Wed Jan 06, 2016 10:53 am
Operating System: OS X 10.11 El Capitan or later (macOS)

Re: Refocus on VS2015 .. continued FYI

Permanent link to this post Posted by Gale Andrews » Sun Apr 17, 2016 12:56 pm

Thanks, Henric. Robert had started a page on Audacity Wiki http://wiki.audacityteam.org/wiki/Building_Audacity_on_Visual_Studio_2015 about building with VS2015.

Is what I have written about your fork in the green div at the top of that page accurate?

Are you saying you have produced 64-bit builds of Audacity, or just solved problems building 32-bit builds of Audacity on 64-bit Windows?


Gale
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual
Gale Andrews
Quality Assurance
 
Posts: 26094
Joined: Fri Jul 27, 2007 12:02 am
Operating System: Windows 10

Re: Refocus on VS2015 .. continued FYI

Permanent link to this post Posted by rachalmers » Sun Apr 17, 2016 4:21 pm

Just having a look through henricj's code on his github page, shown in the link posted just before, and am really happy to see that I was on the right track. A bit slower getting there but that's ok. The one part I hadn't yet looked into was the .vcxproj files. One or two others, but now I know I was on the right track.

Robert
rachalmers
 
Posts: 163
Joined: Wed Jan 06, 2016 10:53 am
Operating System: OS X 10.11 El Capitan or later (macOS)

Re: Refocus on VS2015 .. continued FYI

Permanent link to this post Posted by henric » Sun Apr 17, 2016 5:42 pm

Gale Andrews wrote:Thanks, Henric. Robert had started a page on Audacity Wiki http://wiki.audacityteam.org/wiki/Building_Audacity_on_Visual_Studio_2015 about building with VS2015.

Is what I have written about your fork in the green div at the top of that page accurate?

Are you saying you have produced 64-bit builds of Audacity, or just solved problems building 32-bit builds of Audacity on 64-bit Windows?


Gale


Yes, I believe what you put on that page is correct. The only thing I might hesitate about is that there was a typo in the portaudio-v19 project file where ASIO_SDK was AISO_SDK (or something to that effect) that was fixed in a later commit.

As for 64-bit: yes, they are x64-targeted builds of Audacity that run as 64-bit processes and worked well enough for me to do my "rand()" ranting related testing back in February. Both the x64 release and debug builds worked fine for what I tested. Unfortunately, the gigantic change for 64-bit support is a) indeed gigantic (particularly in some libraries) and b) includes things that it turned out weren't necessary. The first thing that comes to mind is that one shouldn't mix Unicode and Multi-byte projects (not that MBCS should be used anymore); given that they are mixed, it is safer to use directly use the *A and *W variants of calls and structs and char/wchar_t (instead of TCHAR). That way, the code always means the same thing, regardless of the Unicode/MBCS settings. I tried to change things to always specify the types explicitly. However, it turned out that those changes were probably not required for x64 to not blow up when run.

Note that I used the v140_xp build only for Win32/Release and v140 for everything else. I figured there were never all that many WinXP x64 installs to begin with, and the folks asking for that kind of bleeding edge trouble would not be the ones sticking on XPx64 when later versions of Windows became available. wxWidgets's master branch--and then wxWidgets 3.1.0 when it was released--were used since that's when they added VS2015 support.

Be aware that the vs2015 branch adds a .gitattributes to specify EOL behavior. I'm no git expert, but I was having trouble between Windows and Ubuntu when testing. That does mean there are some EOL differences between master (which is identical to the official Audacity master branch) and the vs2015 branch. (Stuff like "git merge --strategy=recursive --strategy-option=renormalize master" seems to sort it out properly.)

One good thing about some of the changes: MS has been trying improve their standards support and many changes remove work-arounds for previous MSisms that are now no longer needed (e.g., they now provide stdint.h and inttypes.h).

TL;DR: Yes Audacity x64 platform binaries run, but some of the changes in the x64 commit are not required and others are quite intrusive (e.g., libnyquist).
henric
 
Posts: 29
Joined: Sun Jan 17, 2016 9:12 pm
Operating System: Windows 10

Next

Return to Compiling Audacity



Who is online

Users browsing this forum: No registered users and 1 guest