Update Build Instructions for Windows, perhaps?

Building and customizing Audacity from the source code.
Forum rules
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
rafadess
Posts: 21
Joined: Wed Apr 15, 2020 6:28 pm
Operating System: Windows 10

Update Build Instructions for Windows, perhaps?

Post by rafadess » Sun Feb 28, 2021 4:27 pm

Hello,

The build.txt that is on the repo says you have to use Python 2.7 to build Audacity. But it looks like all python 2 scripts has been updated to python3. Am I right? In that case, the instructions on build.txt might needed to be updated.

Looking foward to 3.0 release!

Thanks!
Rafa

steve
Site Admin
Posts: 81227
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Update Build Instructions for Windows, perhaps?

Post by steve » Sun Feb 28, 2021 5:09 pm

rafadess wrote:
Sun Feb 28, 2021 4:27 pm
The build.txt that is on the repo says you have to use Python 2.7 to build Audacity. But it looks like all python 2 scripts has been updated to python3. Am I right? In that case, the instructions on build.txt might needed to be updated.
Yes you're correct on both points. Audacity has been updated to Python 3 and the instructions need updating.
The instructions are earmarked for an update.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

jademan
Forum Crew
Posts: 1274
Joined: Fri Jul 17, 2009 10:11 pm
Operating System: Please select

Re: Update Build Instructions for Windows, perhaps?

Post by jademan » Mon Mar 01, 2021 1:01 pm

rafadess wrote:
Sun Feb 28, 2021 4:27 pm
Hello,

The build.txt that is on the repo says you have to use Python 2.7 to build Audacity. But it looks like all python 2 scripts has been updated to python3. Am I right? In that case, the instructions on build.txt might needed to be updated.

Looking foward to 3.0 release!

Thanks!
Rafa
See this pull request for updated build.txt instructions: https://github.com/audacity/audacity/pull/745

Please report back on how well this works.

I hope this helps. :D

jademan
Forum Crew
Posts: 1274
Joined: Fri Jul 17, 2009 10:11 pm
Operating System: Please select

Re: Update Build Instructions for Windows, perhaps?

Post by jademan » Mon Mar 01, 2021 1:51 pm

Here is the proposed complete build.txt (there may be 1 warning "Jack" in Cmake which is OK):

Code: Select all

Instructions for building on Windows.

Fuller instructions that include
   * Installing CMake 
   * Portable Settings
   * Building an Installer
can be found on our wiki at http://wiki.audacityteam.org/wiki/Building_On_Windows (not updated yet)


1. MSVC 2019: Download and install Microsoft Visual Studio 2019

  https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=Community&rel=16
  be sure to include the Desktop Development with C++ Workflow
  this build was testing using VS 16.8.5

2. Git: Download and install Git, for example by installing:

  Git for Windows: https://git-scm.com/download/win
  and optionally GitExtensions: http://gitextensions.github.io/

  download and run the .msi installer.  GitExtensions has a GUI interface, includes Git for
  Windows and has a Git bash command line in the bottom panel of the screen.

3. Python

  We no longer use Python 2.7.18 during the build. Instead we must use Python 3.
  You can download Python 3.9.1 from https://www.python.org/downloads/windows/
  Select the Python 3.9.1 Windows Installer (32-bit)

4. wxWidgets:

 a) Clone wxWidgets and checkout 3.1.3 from the Audacity fork of the 
    wxWidgets project: 
       https://github.com/audacity/wxWidgets/

    for example, in the git-bash command line
      mkdir wxWidgets
      git clone --recurse-submodules https://github.com/audacity/wxWidgets/
      
    IF you forgot the --recurse-submodules, you can correct that later by:
      git submodule update --init

    It is instructive to review but do NOT follow the instructions for building at 
    https://github.com/audacity/wxWidgets/blob/audacity-fixes-3.1.3/README-GIT.md
    https://github.com/audacity/wxWidgets/blob/audacity-fixes-3.1.3/docs/msw/install.md
 
 b) We (currently) build the 32 bit DLL version, 
    and Audacity is built 32 bit too.

    Set WXWIN environment variable to the appropriate directory where you installed 
    wxWidgets. This will tell CMake where to find wxWidgets later.

    To set WXWIN, click on Settings (the cogwheel icon from the start menu)
    Then in the 'find a setting' search box type 'env'.
    Choose 'Edit the system environment variables'
    Then the 'Environment Variables' button 
    Then in system variables, for variable and value,  add (for example)     
    ==> WXWIN         C:\aud300\wxWidgets

    You will be building a dll version with MSVC2019 IDE, so...
	==> In Windows File Manager, right-click on ../wxWidgets/build/msw/wx_vc16.sln,
	==> select Visual Studio 2019,
	==> in the solutions configurations drop-down list, change "Debug" to "DLL Release",
	==> then select Build > Build Solution.
	
	When the build completed, you will get the message:
	========= Build: 24 succeeded, 0 failed, 0 up-to-date, 0 skipped ============
	Close Visuual Studio.

5. Audacity

 a) Clone Audacity from the Audacity GitHub project.
       https://github.com/audacity/audacity/

    for example, in the git-bash command line
      mkdir audacity
      git clone https://github.com/audacity/audacity/

 b) Open the CMake GUI
     ==> Open VS 2019 > "continue without code" > File > Open > CMake
     ==> Open CMakeLists.txt in root of audacity source folder you cloned
	 ==> Wait for the CMake Overview Pages tab to appear (be patient)
	 ==> Click "Open the CMake Settings Editor" in this new tab
	 ==> Scroll up to the top of the window and settings
	 ==> In the Configurations window, click the green "+", then select x86-Release
	 ==> Set Configuration type: Release
	 ==> Verify Toolset: msvc_86
	 ==> Keep Build Root: ${projectDir}\out\build\${name} (default, you can change it)
	     (this corresponds to CMAKE_BINARY_DIR)
     ==> Click on "Show advanced settings" (scroll down).
	 ==> Change CMake generator: VS 16 2019 (was Ninja)
	 ==> Click "Save and Generate CMake cache to load variables" once, then
	 ==> Click "Save and Generate CMake cache to load variables" a second time
	     or select Project > Generate CMake Cache
	 
  c) Switch to the Ouput tab
     ==> Wait for "CMake generation finished".
	 ==> Check the Error List window:
	     you should have 0 Errors and 0 Warnings.
		 
  d) Return to the CMakeSettings.json window
     ==> Review CMake variables and cache
	 ==> Note that:
	 wxWidgets_LIB_DIR > 'C:/aud300/wxWidgets/lib/vc_dll' (your path may be slightly different)

  e) Build
     ==> Select Build > Build All
     ==> Click on the Output tab and wait for the message "Build All succeeded" 
	 ==> Check the Error List tab.  There should be 0 Errors and 17 Warnings.
     ==> Check the output directory indicated in step 6 to find `../bin/Release/Audacity.exe`
    

rafadess
Posts: 21
Joined: Wed Apr 15, 2020 6:28 pm
Operating System: Windows 10

Re: Update Build Instructions for Windows, perhaps?

Post by rafadess » Mon Mar 01, 2021 3:00 pm

Thank you jademan. Sorry to not check the PR tab on git before asking... :oops:

Let me try the new instruction. It took me two days to be able to compile using the previous one. (I'm forcing myself to understand more C++)

On question: I moved thad setup.h file from msvc/wx to include/wx. Is this still needed? It appears on wxWidgets instruction.
https://github.com/audacity/wxWidgets/b ... sw_install

I'm going to remove all I have from Audacity and try to compile it again following the new instruction. Then I'll give a feedback.

Thank you,
Rafa

rafadess
Posts: 21
Joined: Wed Apr 15, 2020 6:28 pm
Operating System: Windows 10

Re: Update Build Instructions for Windows, perhaps?

Post by rafadess » Mon Mar 01, 2021 3:54 pm

It worked like a charm! Like we say here on Brazil: It was as simple as life should be :lol:

Indeed it gave the warning you mention. Is it something that should be fixed? Or can I just ignore it?

Other thing: I just realised that if I want to debug Audacity using Debug configuration I need to build wxWidgets "DLL Debug" first. It might sounds logic... but for me it wasn't. So MAYBE it would be nice if the instruction includes something about this.

Thanks,
Rafa

jademan
Forum Crew
Posts: 1274
Joined: Fri Jul 17, 2009 10:11 pm
Operating System: Please select

Re: Update Build Instructions for Windows, perhaps?

Post by jademan » Mon Mar 01, 2021 4:12 pm

rafadess wrote:
Mon Mar 01, 2021 3:00 pm
Thank you jademan. Sorry to not check the PR tab on git before asking... :oops:

Let me try the new instruction. It took me two days to be able to compile using the previous one. (I'm forcing myself to understand more C++)
Good, I think the old instructions are a rite of passage thing. They assume that you've done this before a hundred or so times, that you already have a working build, and that you can deal with the new errors as they crop up. ;)
rafadess wrote:
Mon Mar 01, 2021 3:00 pm
On question: I moved thad setup.h file from msvc/wx to include/wx. Is this still needed? It appears on wxWidgets instruction.
https://github.com/audacity/wxWidgets/b ... sw_install

I'm going to remove all I have from Audacity and try to compile it again following the new instruction. Then I'll give a feedback.

Thank you,
Rafa
Yes, no need to move setup.h for Windows.
rafadess wrote:
Mon Mar 01, 2021 3:54 pm
It worked like a charm! Like we say here on Brazil: It was as simple as life should be :lol:

Indeed it gave the warning you mention. Is it something that should be fixed? Or can I just ignore it?

Thanks,
Rafa
Ignore the warning. It's just a case conversion issue that I believe is OS dependent. The full PR gets rid of the warning.

:D Glad to hear that the instructions are working well for you. :D
rafadess wrote:
Mon Mar 01, 2021 3:54 pm
Other thing: I just realised that if I want to debug Audacity using Debug configuration I need to build wxWidgets "DLL Debug" first. It might sounds logic... but for me it wasn't. So MAYBE it would be nice if the instruction includes something about this.
Why not work this out then post another pull request ? It might be simple. ;)

rafadess
Posts: 21
Joined: Wed Apr 15, 2020 6:28 pm
Operating System: Windows 10

Re: Update Build Instructions for Windows, perhaps?

Post by rafadess » Mon Mar 01, 2021 5:24 pm

Why not work this out then post another pull request ? It might be simple. ;)
Sure! That will be my first PR on an open source project. So it might get it wrong in something.

I will wait your PR gets approved then I will send mine.

Rafa

jademan
Forum Crew
Posts: 1274
Joined: Fri Jul 17, 2009 10:11 pm
Operating System: Please select

Re: Update Build Instructions for Windows, perhaps?

Post by jademan » Mon Mar 01, 2021 9:55 pm

rafadess wrote:
Mon Mar 01, 2021 5:24 pm
I will wait your PR gets approved then I will send mine.
:lol:

rafadess
Posts: 21
Joined: Wed Apr 15, 2020 6:28 pm
Operating System: Windows 10

Re: Update Build Instructions for Windows, perhaps?

Post by rafadess » Wed Mar 03, 2021 5:55 pm

Hey jademan,

How about I writing here what I have in mind and then, if you agree, you can incorporate to your PR? It might be simpler, I don't know. Again, this is my first time trying to contribute to an open source program...

It added between /**/ what I was thinking. This is just an idea.

Code: Select all

Instructions for building on Windows.

Fuller instructions that include
   * Installing CMake 
   * Portable Settings
   * Building an Installer
can be found on our wiki at http://wiki.audacityteam.org/wiki/Building_On_Windows (not updated yet)


1. MSVC 2019: Download and install Microsoft Visual Studio 2019

  https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=Community&rel=16
  be sure to include the Desktop Development with C++ Workflow
  this build was testing using VS 16.8.5

2. Git: Download and install Git, for example by installing:

  Git for Windows: https://git-scm.com/download/win
  and optionally GitExtensions: http://gitextensions.github.io/

  download and run the .msi installer.  GitExtensions has a GUI interface, includes Git for
  Windows and has a Git bash command line in the bottom panel of the screen.

3. Python

  We no longer use Python 2.7.18 during the build. Instead we must use Python 3.
  You can download Python 3.9.1 from https://www.python.org/downloads/windows/
  Select the Python 3.9.1 Windows Installer (32-bit)

4. wxWidgets:

 a) Clone wxWidgets and checkout 3.1.3 from the Audacity fork of the 
    wxWidgets project: 
       https://github.com/audacity/wxWidgets/

    for example, in the git-bash command line
      mkdir wxWidgets
      git clone --recurse-submodules https://github.com/audacity/wxWidgets/
      
    IF you forgot the --recurse-submodules, you can correct that later by:
      git submodule update --init

    It is instructive to review but do NOT follow the instructions for building at 
    https://github.com/audacity/wxWidgets/blob/audacity-fixes-3.1.3/README-GIT.md
    https://github.com/audacity/wxWidgets/blob/audacity-fixes-3.1.3/docs/msw/install.md
 
 b) We (currently) build the 32 bit DLL version, 
    and Audacity is built 32 bit too.

    Set WXWIN environment variable to the appropriate directory where you installed 
    wxWidgets. This will tell CMake where to find wxWidgets later.

    To set WXWIN, click on Settings (the cogwheel icon from the start menu)
    Then in the 'find a setting' search box type 'env'.
    Choose 'Edit the system environment variables'
    Then the 'Environment Variables' button 
    Then in system variables, for variable and value,  add (for example)     
    ==> WXWIN         C:\aud300\wxWidgets

    You will be building a dll version with MSVC2019 IDE, so...
	==> In Windows File Manager, right-click on ../wxWidgets/build/msw/wx_vc16.sln,
	==> select Visual Studio 2019,
	==> in the solutions configurations drop-down list, change "Debug" to "DLL Release",
	==> then select Build > Build Solution.
	
	/*************
	Additionally, if you want to later debug Audacity, you have to build wxWidgets Debug dll.
	==> in the solutions configurations drop-down list, change "DLL Release" to "DLL Debug",
	==> then select Build > Build Solution
	***************/
	
	When the build completed, you will get the message:
	========= Build: 24 succeeded, 0 failed, 0 up-to-date, 0 skipped ============
	Close Visual Studio.

5. Audacity

 a) Clone Audacity from the Audacity GitHub project.
       https://github.com/audacity/audacity/

    for example, in the git-bash command line
      mkdir audacity
      git clone https://github.com/audacity/audacity/

 b) Open the CMake GUI
     ==> Open VS 2019 > "continue without code" > File > Open > CMake
     ==> Open CMakeLists.txt in root of audacity source folder you cloned
	 ==> Wait for the CMake Overview Pages tab to appear (be patient)
	 ==> Click "Open the CMake Settings Editor" in this new tab
	 ==> Scroll up to the top of the window and settings
	 ==> In the Configurations window, click the green "+", then select x86-Release
	 ==> Set Configuration type: Release
	 ==> Verify Toolset: msvc_86
	 ==> Keep Build Root: ${projectDir}\out\build\${name} (default, you can change it)
	     (this corresponds to CMAKE_BINARY_DIR)
     ==> Click on "Show advanced settings" (scroll down).
	 ==> Change CMake generator: VS 16 2019 (was Ninja)
	 ==> Click "Save and Generate CMake cache to load variables" once, then
	 ==> Click "Save and Generate CMake cache to load variables" a second time
	     or select Project > Generate CMake Cache
	 
  c) Switch to the Ouput tab
     ==> Wait for "CMake generation finished".
	 ==> Check the Error List window:
	     you should have 0 Errors and 0 Warnings.
		 
  d) Return to the CMakeSettings.json window
     ==> Review CMake variables and cache
	 ==> Note that:
	 wxWidgets_LIB_DIR > 'C:/aud300/wxWidgets/lib/vc_dll' (your path may be slightly different)

  e) Build
     ==> Select Build > Build All
     ==> Click on the Output tab and wait for the message "Build All succeeded" 
	 ==> Check the Error List tab.  There should be 0 Errors and 17 Warnings.
     ==> Check the output directory indicated in step 6 to find `../bin/Release/Audacity.exe`
 
 /********
  f) Build Debug Version
     If you want to do further developments on Audacity you will need to build the Debug version
     You can use the same instructions above (Steps 'a' to 'e') but changing to this configurations on step 'b':
     ==>  In the Configurations window, click the green "+", then select x86-Debug instead of x86-Release
     ==> Set Configuration type: Debug instead of Release
     
     Then check the output directory to find the Audacity solution. Probably 'C:/aud300/out/'
 **********/
    

Post Reply