Problems building on Mac

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

Problems building on Mac

Permanent link to this post Posted by grav » Mon Mar 30, 2009 9:35 pm

OS 10.5.6

wxWidgets 2.8.9, local install, compiled using --enable-unicode --disable-shared, had to copy lib/wx/config/mac-unicode-release-static-2.8 to /usr/local/lib/wx/config in order for wx-config to find it.

If I try building the Active Target Configure in Xcode, I get:

*** missing separator. Stop
*** missing separator. Stop

If I do, I get:
xcodebuild -target Audacity -configuration "Release Static"

** BUILD FAILED **

The following build commands failed:
Configure:
PhaseScriptExecution "/Users/grav/repositories/audacity/mac/build/Audacity.build/Release Static/Configure.build/Script-17072E8C0988BD85008541CC.sh"
libsndfile:
CompileC "build/Audacity.build/Release Static/libsndfile.build/Objects-normal/ppc/sndfile.o" /Users/grav/repositories/audacity/mac/../lib-src/libsndfile/src/sndfile.c normal ppc c com.apple.compilers.gcc.4_0
Audacity:
Preprocessing "/Users/grav/repositories/audacity/mac/build/Audacity.build/Release Static/Audacity.build/Preprocessed-Info.plist" Info.plist
ProcessPCH++ /var/folders/cM/cMyd95CnFh8Z0+nKIvSIr++++TI/-Caches-/com.apple.Xcode.501/SharedPrecompiledHeaders/AudacityHeaders-ezlkvjbsqepcprafmdlhwhypewaq/AudacityHeaders.h.gch ../src/AudacityHeaders.h normal i386 c++ com.apple.compilers.gcc.4_0
ProcessPCH++ /var/folders/cM/cMyd95CnFh8Z0+nKIvSIr++++TI/-Caches-/com.apple.Xcode.501/SharedPrecompiledHeaders/AudacityHeaders-guntcpppmypexggfrxkvcpznassr/AudacityHeaders.h.gch ../src/AudacityHeaders.h normal ppc c++ com.apple.compilers.gcc.4_0
(5 failures)


Any ideas?
grav
 
Posts: 5
Joined: Wed Mar 25, 2009 3:15 pm
Operating System: Please select

Re: Problems building on Mac

Permanent link to this post Posted by bcox » Tue Mar 31, 2009 8:07 am

Hi Grav,

I don't have enough experience building apps on OS X to figure out what's going wrong from the error's you're getting, however, I downloaded and compiled audacity for the first time 2 days ago and got it up and running tonight. From my experience, I have a strong feeling that you've configured wxWindows incorrectly. Especially since you're having to move various items around in your system. That's never a good thing.

Here's what I did to get it to work:

MySetup:
OS X: 10.5.6
XCode 3.1.2
I'm not building universal binaries...
Downloaded wxMac 2.8.10
Downloaded audacity 1.3.8 from cvs

wxWindows was configured with the following switches
./configure --disable-shared --enable-static --enable-unicode --disable-dependency-tracking --disable-monolithic --prefix=/Users/bcox/Development/audacity/wx/

Note that I've changed the default location for wxWindows. I think it's best not to install it into /usr/local/.

make
sudo make install

OK, wxWindows should be installed and OK.

Next I fired up the audacity XCode file

1. Change WX_PREFIX (in the User Defined section) to the location of your wx install. For me that's /Users/bcox/Development/audacity/wx

2. I don't have a libwx_expat.a but I do have a libexpat.a in /usr/local/lib/ so I modified WX_LDFLAGS to point to that instead

I also had to comment out line 1365 of ProcessDialog.cpp because of a problem with wxSound(...). I need to look into it but you could also change it to read:
s.Create((wxChar)beep, sizeof(beep)); That *might* work. Or it might crash things when your process dialog sends out a beep.
bcox
 
Posts: 3
Joined: Tue Mar 31, 2009 5:44 am
Location: San Francisco, CA
Operating System: Please select

Re: Problems building on Mac

Permanent link to this post Posted by grav » Tue Mar 31, 2009 12:03 pm

wxWindows was configured with the following switches
./configure --disable-shared --enable-static --enable-unicode --disable-dependency-tracking --disable-monolithic --prefix=/Users/bcox/Development/audacity/wx/


Yep, this took care of a lot of problems - now wx-config seems to look for the config files the right place.

Next I fired up the audacity XCode file

1. Change WX_PREFIX (in the User Defined section) to the location of your wx install. For me that's /Users/bcox/Development/audacity/wx

2. I don't have a libwx_expat.a but I do have a libexpat.a in /usr/local/lib/ so I modified WX_LDFLAGS to point to that instead

I also had to comment out line 1365 of ProcessDialog.cpp because of a problem with wxSound(...). I need to look into it but you could also change it to read:
s.Create((wxChar)beep, sizeof(beep)); That *might* work. Or it might crash things when your process dialog sends out a beep.


This expat-thing gave me problems as well. I don't have a libexpat.a in /usr/local/lib/ either, but I did find one in another project.

However, I still get 89 errors of this sort:
Code: Select all
Undefined symbols:
  "_mktime$UNIX2003", referenced from:
      wxDateTime::SetFromDOS(unsigned long)in libwx_base_carbonu-2.8.a(baselib_datetime.o)
      wxDateTime::Set(tm const&) in libwx_base_carbonu-2.8.a(baselib_datetime.o)
      wxDateTime::Set(unsigned short, unsigned short, unsigned short, unsigned short)in libwx_base_carbonu-2.8.a(baselib_datetime.o)
      wxDateTime::GetWeekDayName(wxDateTime::WeekDay, wxDateTime::NameFlags)in libwx_base_carbonu-2.8.a(baselib_datetime.o)
      wxGetLocalTime()     in libwx_base_carbonu-2.8.a(baselib_stopwatch.o)
  "_XML_GetErrorCode", referenced from:
      XMLFileReader::Parse(XMLTagHandler*, wxString const&) in XMLFileReader.o
  "_write$UNIX2003", referenced from:
      wxFile::Write(void const*, unsigned long)in libwx_base_carbonu-2.8.a(baselib_file.o)
      wxSingleInstanceCheckerImpl::CreateLockFile()       in libwx_base_carbonu-2.8.a(baselib_unix_snglinst.o)
      __tiffWriteProc in libwxtiff-2.8.a(wxtiff_tif_unix.o)
  "_select$UNIX2003", referenced from:
      wxPipeInputStream::CanRead() const in libwx_base_carbonu-2.8.a(baselib_utilsunx.o)
      GSocket::Output_Timeout()      in libwx_base_carbonu_net-2.8.a(netlib_unix_gsocket.o)
      GSocket::Input_Timeout()      in libwx_base_carbonu_net-2.8.a(netlib_unix_gsocket.o)
      GSocket::Select(int)  in libwx_base_carbonu_net-2.8.a(netlib_unix_gsocket.o)


Any advice?
grav
 
Posts: 5
Joined: Wed Mar 25, 2009 3:15 pm
Operating System: Please select

Re: Problems building on Mac

Permanent link to this post Posted by grav » Tue Mar 31, 2009 2:18 pm

Hmm, could it be that I've built wxWidgets for 10.5 but I am trying to build Audacity for 10.4? I've tried compiling Audacity for 10.5 instead, but this gives other errors. So if the problem is indeed that wxWidgets needs to be compiled for 10.4, how do I do that on a 10.5 machine?

Edit: and by the way, thanks for your first assistance, bcox :-)

Edit: also tried using compiler flag -mmacosx-version-min=10.4 (while compiling for 10.4) without any luck.
grav
 
Posts: 5
Joined: Wed Mar 25, 2009 3:15 pm
Operating System: Please select

Re: Problems building on Mac

Permanent link to this post Posted by bcox » Wed Apr 01, 2009 7:26 am

I got similar linker errors the first time around as well. Under the build settings I changed the "Base SDK" and "Deployment Target" settings to be "Mac OS X 10.5" and the errors went away. I just tested it again with 10.4 as the Base SDK and I get the same errors (although there are only 20 errors).

The change should help with most of those linker errors. If all the standard c linker errors go away (write, mktime, etc.) and you're still getting XML linker errors, you'll need to build a copy of the expat library. libwxexpat.a should be able to be built by looking in wxMac-2.8.10/src/expat/. You can build it without building the rest of wxWindows. I think that's where I got the copy that's in my /usr/local/lib/ folder from.

I think you're really close to a successful build. Let me know if you get it working.
bcox
 
Posts: 3
Joined: Tue Mar 31, 2009 5:44 am
Location: San Francisco, CA
Operating System: Please select

Re: Problems building on Mac

Permanent link to this post Posted by grav » Thu Apr 02, 2009 8:06 pm

bcox wrote:
I think you're really close to a successful build. Let me know if you get it working.


Well, I got rid of the $UNIX2003 - I think it had something to do with building wx for 10.5. Anyways, now I build wxWidgets using this:

../configure --disable-compat26 --with-expat=builtin --with-zlib=builtin --with-regex=builtin --enable-universal_binary=yes --enable-static=yes --enable-shared=no --enable-unicode=yes --enable-debug=no --prefix=/Users/grav/audacity/wx/
make clean
make -j 7
make -j 7 install

This is inspired by Leland of the Audacity Team, but I still get the XML-parser related errors below when compiling Audacity via Xcode.

I am currently in contact with Leland via the developer list also, but if you can assist with anything, I'd be grateful :-)


Edit: oh, I just noticed what you wrote regarding XML errors. I'll try building expat and report back!

Code: Select all
    cd /Users/grav/repositories/audacity/mac
    /Developer/usr/bin/g++-4.0 -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk "-L/Users/grav/repositories/audacity/mac/build/Release Static" "-L/Users/grav/repositories/audacity/mac/build/Debug Static" "-F/Users/grav/repositories/audacity/mac/build/Release Static" -filelist "/Users/grav/repositories/audacity/mac/build/Audacity.build/Release Static/Audacity.build/Objects-normal/i386/Audacity.LinkFileList" -mmacosx-version-min=10.4 -keep_private_externs -L/Users/grav/audacity/wx/lib /Users/grav/audacity/wx/lib/libwx_macu_xrc-2.8.a /Users/grav/audacity/wx/lib/libwx_macu_qa-2.8.a /Users/grav/audacity/wx/lib/libwx_macu_html-2.8.a /Users/grav/audacity/wx/lib/libwx_macu_adv-2.8.a /Users/grav/audacity/wx/lib/libwx_macu_core-2.8.a /Users/grav/audacity/wx/lib/libwx_base_carbonu_xml-2.8.a /Users/grav/audacity/wx/lib/libwx_base_carbonu_net-2.8.a /Users/grav/audacity/wx/lib/libwx_base_carbonu-2.8.a /Users/grav/audacity/wx/lib/libwxregexu-2.8.a /Users/grav/audacity/wx/lib/libwxtiff-2.8.a /Users/grav/audacity/wx/lib/libwxjpeg-2.8.a /Users/grav/audacity/wx/lib/libwxpng-2.8.a -framework OpenGL -framework QuickTime -framework IOKit -framework Carbon -framework Cocoa -framework System -framework WebKit -framework CoreAudio -framework AudioUnit -framework AudioToolbox -lz -lpthread -liconv -lFLAC++ -lFLAC -lvorbis -lportsmf -lid3tag -lmad -lnyquist -logg -lportmixer -lresample -lsndfile -lsoundtouch -lFLAC++ -lFLAC -lportaudio -ltwolame -lvamp -lscorealign -llibsbsms -ltaglib -prebind -o "/Users/grav/repositories/audacity/mac/build/Release Static/Audacity.app/Contents/MacOS/Audacity"
Undefined symbols:
  "_XML_GetCurrentLineNumber", referenced from:
      XMLFileReader::Parse(XMLTagHandler*, wxString const&) in XMLFileReader.o
  "_XML_ErrorString", referenced from:
      XMLFileReader::Parse(XMLTagHandler*, wxString const&) in XMLFileReader.o
  "_XML_ParserCreate", referenced from:
      XMLFileReader::XMLFileReader()in XMLFileReader.o
  "_XML_ParserFree", referenced from:
      XMLFileReader::~XMLFileReader()in XMLFileReader.o
      XMLFileReader::~XMLFileReader()in XMLFileReader.o
      XMLFileReader::~XMLFileReader()in XMLFileReader.o
  "_XML_GetErrorCode", referenced from:
      XMLFileReader::Parse(XMLTagHandler*, wxString const&) in XMLFileReader.o
  "_XML_SetElementHandler", referenced from:
      XMLFileReader::XMLFileReader()in XMLFileReader.o
  "_XML_SetUserData", referenced from:
      XMLFileReader::XMLFileReader()in XMLFileReader.o
  "_XML_Parse", referenced from:
      XMLFileReader::Parse(XMLTagHandler*, wxString const&) in XMLFileReader.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
grav
 
Posts: 5
Joined: Wed Mar 25, 2009 3:15 pm
Operating System: Please select

Re: Problems building on Mac

Permanent link to this post Posted by grav » Thu Apr 02, 2009 9:15 pm

Ok, I finally managed to get it to build by:

Applying the patch in the mac-dir on wxWidgets 2.8.9

Code: Select all
cd /path/to/wxMac-2.8.9

# I think this takes care of some wx sound probs
patch -p1 < /path/to/audacityrepos/mac/wxMac-2.8.9.patch

./configure --disable-compat26 --with-expat=builtin --with-zlib=builtin --with-regex=builtin --enable-universal_binary=yes --enable-static=yes --enable-shared=no --enable-unicode=yes --enable-debug=no --prefix=/where/to/install/wxwidgets
make clean
make -j 7
make -j 7 install



Only other thing to do is to change Xcode WX_PREFIX variable to /where/to/install/wxwidgets

Thanx to bcox and Leland!
grav
 
Posts: 5
Joined: Wed Mar 25, 2009 3:15 pm
Operating System: Please select


Return to Compiling Audacity



Who is online

Users browsing this forum: No registered users and 1 guest