Is there updated build instructions for compiling Audacity?

I have MacOSx 10.10.5 and xcode version 7.2.
I am trying to install wxWidget 3.0.2 for Audacity project 2.1.2
, but can’t succeed,have spend around 4-5 days but still not able to compile audacity.

I have gone through instructions given in following links :

https://audacity.googlecode.com/svn/audacity-src/trunk/mac/compile.txt
and also gone thru instructions given in build.txt of audacity project.

Errors :
for wxWidget “make” command I am getting this error :

make *** no rule to make target install’. stop.

and therefore while compiling project I am getting erros like

wx/defs.h not found

etc.

Please help me in compiling Audacity with above configurations.

Audacity is no longer using SVN. Please use https://github.com/audacity/audacity/blob/master/mac/Build.txt.

Extra hacks may be needed if you use later than Xcode 7.1.

Gale

Hi Gale, thank you so much for the reply.

I have already followed instructions given at https://github.com/audacity/audacity/blob/master/mac/Build.txt , but no luck.

Can you please describe which kind of extra hacks is needed for later than Xcode 7.1 ?

More on the hacks. As I understand it if you have greater than Xcode 7.1, you should only use the 10.11 SDK which is the minimum allowed. In src\MemoryX.h change

#if !(_MSC_VER >= 1800 || __cplusplus >= 201402L)

to

#if !(_MSC_VER >= 1800 || __cplusplus >=201603L)

(or other value appropriate to your Clang compiler).

Or see https://forums.developer.apple.com/thread/43381.



Gale

Hi Gale, succeed to install wxWidget somehow but now there are 31 errors on compiling audacity like below :

Undefined symbols for architecture i386:
“non-virtual thunk to wxGrid::GetSizeAvailableForScrollTarget(wxSize const&)”, referenced from:
vtable for Grid in Grid.o

I ahev also attached screenshot for issue.

Any solutions/suggestions ? :frowning:

Does these issue

non-virtual thunk to…

related to build settings of Xcode ?

Current Xcode setting of my machine is :-

Compiler for C/C++/Objective-c – Default compiler (Apple LLVM 7.0)
and settings for Apple LLVM 7.0 - Language - C++ section is in attached image.

Please if anybody have any idea about this settings so that error of

non-virtual thunk to…

can be resolved… kindly help me to get rid of this.

Hi
wxWidgets needs building, but not installing.
Once built, put an environment variable in pointing to its directory.
wxWidgets-3.1 is out and very stable.
Be careful if you apply the suggested patches.
Audacity will almost certainly not build with XXode. You mat need to use Xcodebuild on the command line.
You need/must have, earlier SDK’s installed.
It wont build with 10.11.4 + 10.11 SDK

Unless something has changed in the last few days…

Good luck
Robert

Is that officially supported by Audacity? I’d need to check the “compile.txt” file. I’ve been using 3.0.2 which is the latest “stable release” (and definitely IS officially supported by Audacity) Downloads - wxWidgets

For Ma OS X: https://github.com/audacity/audacity/blob/master/mac/Build.txt

  1. Download wxWidgets. We currently require version 3.0.2, which can be downloaded from:

Download wxWidgets-3.0.2.tar.bz2 (wxWidgets)

Hi Steve, Thanks for the reply… :slight_smile:

I followed steps given at https://github.com/audacity/audacity/blob/master/mac/Build.txt , but after running 10th step i.e.

sudo /mac/build_wxwidgets

I am getting this error :

make: *** No rule to make target `install’. Stop.

Again the same error from xcodebuild command is :

Undefined symbols for architecture i386:
“non-virtual thunk to wxGrid::GetSizeAvailableForScrollTarget(wxSize const&)”, referenced from:
vtable for Grid in Grid.o

I am clueless at this point of time now because I have tried same steps many times…but no success till yet. :neutral_face:

This is gleaned from Apple: http://lists.apple.com/archives/unix-porting/2003/Dec/msg00107.html

[A non-virtual thunk is] an internal implementation detail used for C++ class hierarchies that involve multiple inheritance. You aren’t doing anything wrong; this is a compiler bug. We know that we need to fix it. In the mean time, the best workaround we know of is to use the same optimization level for linking against a library that you used to compile the library.

(You might also consider not exporting a C++ interface from a library. We work very hard to make sure that the C and Objective C ABI stays the same from one compiler release to the next, but we make no such promise for C++.)

That’s probably no help, but it is an indication of something deeper. I think you may be building wxWidgets incorrectly???

I just build 3.0.2 to see if it would build. Configured wxWidgets 3.0.2 for `x86_64-apple-darwin15.4.0’

Just FYI, I can compile most of Audacity on my Mac mini with XCodebuild. However - I have wxWidgets compiled and lives in
/Users/robert/src/wxWidgets-3.1.0 with a path variable pointing to it.
I compiled it with xcodebuild.

How I’m getting there - briefly.
I downloaded wxWidgets-3.1.0.
It’s on github - see their docs here.

The install.txt that is needed to be followed is in wxWidgets-3.1.0/docs/osx/install.txt in your Widgets src code folder. Probably the same in 3.0.2
You need to follow its instruction, what ever your version. You also don’t need to INSTALL it. Just make it. and point to the folder in your path.

It’s too simple. Like this.

After Xcode is installed, download wxWidgets-{version}.tar.bz2 and then
double-click on it to unpack it to create a wxWidgets directory.

Next use Terminal (under Applications, Utilities, Terminal) to access a command
prompt. Use cd to change directories to your wxWidgets directory and execute
the following sets of commands from the wxWidgets directory.


mkdir build-cocoa-debug
cd build-cocoa-debug
…/configure --enable-debug
make

Build the samples and demos

cd samples; make;cd …
cd demos; make;cd …


After the compilation completes, use Finder to run the samples and demos
Go to build-cocoa-debug/samples to experiment with the Cocoa samples.
Go to build-cocoa-debug/demos to experiment with the Cocoa demos.
Double-click on the executables which have an icon showing three small squares.
The source code for the samples is in wxWidgets/samples
The source code for the demos is in wxWidgets/demos

My Audacity soruce code is in /Users/robert/src/AudacityMASTER - a git pull from Audacity.

Now remember - I’m NOT using the “supported” build elements. Neither wxWidgts, not XCode. I’m using XCode 7.3, with MacOSX10.11.sdk, on OSX 10.11.4.
… so I know it wont build all the way yet. I’m working on it… :slight_smile:

But I do get most of the way with.

codebuild -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk clean -configuration Release 2>&1 | tee clean.log
xcodebuild -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -configuration Release install 2>&1 | tee release.log

Can I shorten this ?
I believe you are possibly not building wxWidgets correctly in the first place. See above.
Your errors are wxWidget errors - not Audacity errors.

oh and yes, I know it all builds and works if I use the “supported” parts of the equation. I’ve done it. I’m working a little ahead of that though…

I hope I am helping and not just making matters worse …
let us know how you get on.
Robert

Hi Robert, Thanks for these useful details… I’ll go through it and will check if it works.
Although while building wxWidget I got the result

Configured wxWidgets 3.0.2 for `x86_64-apple-darwin14.5.0’

:confused:

I wonder what do you mean by

I have wxWidgets compiled and lives in
/Users/robert/src/wxWidgets-3.1.0 with a path variable pointing to it.

, I have no idea how to set path variable ?

also I am curious to know what these commands do ( copied from your answer) ?

codebuild -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk clean -configuration Release 2>&1 | tee clean.log
xcodebuild -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -configuration Release install 2>&1 | tee release.log

Let me describe shortly how I am building wxWidget/audacity :

  1. Downloaded wxWidgets-3.0.2.tar.bz2 from Downloads - wxWidgets
  2. Run tar xf wxWidgets-3.0.2.tar.bz2 to untar it.
  3. cd wxWidgets-3.0.2
  4. mkdir build-cocoa-debug
    5 .cd build-cocoa-debug
  5. …/configure --enable-debug
  6. make
    success till 7th step.

Also I verified list the installed configurations via wx-config --list
which gives the result :

Default config is osx_cocoa-unicode-3.0
Default config will be used for output

Path of wxWidget folder is /Volumes/data/Downloads/wxWidgets-3.0.2
Downloaded Audacity version 2.1.2 from this link :- GitHub - audacity/audacity: Audio Editor

  1. patch -p0 -i /mac/wxMac_additions/wxMac-3.0.2-fixes.patch , where path to audacity source in my case is /Users/richabhawsar/Desktop/Audacity/audacity-master
  2. sudo /mac/build_wxwidgets , at this step issue of make: *** No rule to make target `install’. Stop. is arriving.

Please let me know where I am doing wrong, or missing any command or something which is necessary, also I wonder if any build setting has to be modified in xcodeproj to make it compile.

I am sorry for asking too many questions, but I am stuck on these issues badly, just want to get rid of.

Thanks,
Richa

Ok,

Firstly - you shouldn’t be using sudo. Everything will build as your own user name, so long as you stay out of system directories.


Looks like Step 7 is ok.
If the make completed as
Configured wxWidgets 3.0.2 for `x86_64-apple-darwin14.5.0’
So wxWidgets is ok.

Now, the next step.

Once that is done, and you have applied the patches. (Which you don’t have to do unless you need them)
Set the PATH. The ‘new/dir/location’ should be where you built your wxWidgets.

export PATH=$PATH:/new/dir/location1

See a tutorial here.

The next step is to do this.

cd Audacity/mac

xcodebuild clean -configuration Release 2>&1 | tee config.log
then
xcodebuild -configuration Release install 2>&1 | tee release.log

These two log files are good to be able to look at for solutions if you need them… but

The above should work. This will build Audacity, and put it in a build directory WITHIN your Audacity source code directory. Look for Audacity.app, or read the tail of the log file.

If you want to build the Debug versions - change the word Release above to Debug

try that :slight_smile: and don’t stress …
Robert

@Richa

Can I offer a little further advice? To get you off the desktop. No longer need sudo.

I think you have a Data drive attached called Downloads, or simply ‘data’ ? yes? no?
I see it in /Volumes/data unless you have some other setup.

Path of wxWidget folder is /Volumes/data/Downloads/wxWidgets-3.0.2

Downloaded Audacity version 2.1.2 from this link :- > GitHub - audacity/audacity: Audio Editor >

and you have Audacity sources on your desktop…

However, you can keep everything off your desktop with Git by this command for Audacity.

Assuming your Downloads directory is on your “data” drive, … do you have git installed ? Just type git at a terminal prompt.

If you don’t have git, the program, then you probably need to get it. It’s very common, and very useful.
Even if you don’t have it - move your Desktop folder of Audacity to /Downloads.

$git
and press enter. If you get a message other than ‘command not found’ you have it.
then exactly.

cd /Volumes/data/Downloads
git clone https://github.com/audacity/audacity AudacitySRC

Once it finishes you will have all your new Audacity source code in a directory called AudacitySRC, in your Downloads folder.

I put everything under /Users/robert/src - makes it easy to find. Like in /Users/Richa/src ??? :slight_smile:

Robert

No, categorically it is not supported. Even if it works now, we may make some code change that breaks with wxWidgets 3.1.x. While it would be useful for us to know if that happens, if you don’t want added trouble, build with the supported wx3.0.2. :wink:


Gale

@Robert, Thank you so much for these answers, let me try your solutions if it works, hopefully it will. :slight_smile:

Hi, interesting.

I also note that your step 9 above, step 10 in the Audacity docs doesn’t have the “.” at the end… It should be of course …

  1. Apply the following fixes to wxWidgets:

cd wxWidgets-3.0.2
patch -p0 -i /mac/wxMac_additions/wxMac-3.0.2-fixes.patch .

  1. And finally build/install wxWidgets:

sudo /mac/build_wxwidgets .
…| see full stop there.

Very important !!!
You should now be able to build Audacity using either the Xcode application or the
xcodebuild command line tool.


cheers
Robert

Oh my bad. :frowning: :blush:
Thanks so much again for such important point…

Hi Robert,

I am using full stop for patch command, and here is the output :

1st attempt :

richa76s-iMac:wxWidgets-3.0.2 ambujshukla$ patch -p0 -i /Users/richabhawsar/src/AudacitySRC/mac/wxMac_additions/wxMac-3.0.2-fixes.patch .
patch: **** File . is not a regular file – can’t patch

2nd attempt :

****> richa6s-iMac:wxWidgets-3.0.2 richabhawsar$ patch -p0 -i /Users/richabhawsar/src/AudacitySRC/mac/wxMac_additions/wxMac-3.0.2-fixes.patch.
patch: **** Can’t open patch file /Users/richabhawsar/src/AudacitySRC/mac/wxMac_additions/wxMac-3.0.2-fixes.patch. : No such file or directory

However when I wrote this command without . , it successfully ran.

Also step 10,

richa76s-iMac:wxWidgets-3.0.2 richabhawsar$ sudo /Users/richabhawsar/src/AudacitySRC/mac/build_wxwidgets .
giving the result :-

checking for gcc… gcc -arch i386 -DMAC_OS_X_VERSION_MAX_ALLOWED=1060 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk/ -mmacosx-version-min=10.6
checking whether the C compiler works… no
configure: error: in /Users/richabhawsar/src/wxWidgets-3.0.2/bld_release': configure: error: C compiler cannot create executables See config.log’ for more details
make: *** No targets specified and no makefile found. Stop.
~/src/wxWidgets-3.0.2
~/src/wxWidgets-3.0.2/bld_debug ~/src/wxWidgets-3.0.2
make: *** No rule to make target install'. Stop. ~/src/wxWidgets-3.0.2 ~/src/wxWidgets-3.0.2/bld_release ~/src/wxWidgets-3.0.2 make: *** No rule to make target install’. Stop.
~/src/wxWidgets-3.0.2

What is this error -

make: *** No rule to make target `install’. Stop.

?

:neutral_face:

Ok, sorry, I see that ‘stop’ now. and of course it isn’t necessary.
So that’s good. the Patch worked. I didn’t use the patch actually - I commented out the Accessibility bit that uses it. My build was never going to be used by others, and I don’t need that ability in the software.

So, I just did the patch, and it processed fine.
Ok, next bit. Compiling wxWidgets-3.0.2

Do you have the XCode command line tools installed? It won’t work with out them installed.

I’m compiling this version now as I type this, and it’s proceeding fine here.

It actually tells you there, “checking whether the C compiler works… no” and to check your config.log

=============
This is the successful result of my build ==========


The installation of wxWidgets is finished. On certain
platforms (e.g. Linux) you’ll now have to run ldconfig
if you installed a shared library and also modify the
LD_LIBRARY_PATH (or equivalent) environment variable.

wxWidgets comes with no guarantees and doesn’t claim
to be suitable for any purpose.

Read the wxWindows Licence on licencing conditions.


~/src/wxWidgets-3.0.2
zeus:wxWidgets-3.0.2 robert$

cheers
Robert