Building Portaudio on OSX 10.7.5 Using SDK10.6 or 10.7 Failed

I still cannot create the Portaudio library on my system, that is, OSX 10.7.5 with Xcode 4.3.2, with installed command line tools and having SDK10.6 and SDK10.7 under

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/ 

I describe briefly (also for others who are facing the same problem) what I have done so far (following the various solutions that I found on the Internet).

1) I downloaded "Portaudio" / pa _stable_v19_20111121.tgz (latest stable release):

www.portaudio.com/download.html

2) I read the instructions for creating Portaudio here:

www.portaudio.com/docs/v19-doxydocs/compile_mac_coreaudio.html

and tried to compile from the terminal window using the proposed command:

./configure && make

This led (not so surprisingly) to a lot of errors ending in:

llvm-gcc-4.2: the error tries to execute exec '/usr/bin/../llvm-gcc-4.2/bin/powerpc-apple-darwin11-llvm-gcc-4.2': execvp: there is no such file or directory lipo: impossible open the input file: /var/folders/1_/xkp08ky561jg02zjjrpsxg940000gn/T//ccPxCTrJ.out (There is no such file or directory) make: * [src / hostapi / coreaudio / pa_mac_core.lo] Error 1

This is because "ppc" is no longer supported with OSX 10.5. In addition, the Developer folder does not exist in OSX 10.7, and everything that was in the developer folder moved to

  /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/ 

3) I downloaded the patch (mac_configure_patch.txt) to fix the "configure" from:

https://www.assembla.com/spaces/portaudio/tickets/216#/activity/ticket :

and copied it to the portaudio directory and applied it by typing in a terminal:

$ patch <mac_configure_patch.txt

The confirmation message says:

configure.in patch file

So everything seems beautiful. But still Portaudio is trying to build for "ppc".

4) Now I install ARCHFLAGS, CFLAGS, LDFLAGS only for the i386 architecture for assembly (disabling universal assembly):

$ MACOSX_DEPLOYMENT_TARGET = "10.7" ARCHFLAGS = "- arch i386" CFLAGS = "- O2 -g -Wall -isysroot / Applications / Xcode.app / Contents / Developer / Platforms / MacOSX.platform / Developer / SDKs / MacOSX10. 7.sdk -arch i386 -mmacosx-version-min = 10.7 "LDFLAGS =" - isysroot / Applications / Xcode.app / Contents / Developer / Platforms / MacOSX.platform / Developer / SDKs / MacOSX10.7.sd -arch i386 - mmacosx-version -min = 10.7 ". / configure --disable-mac-universal

5) Further, I found that:

A): "#include AudioToolbox.h" in ".include / pa_mac_core.h" should be REQUIRED

B): you need to remove "-wError" from the "Makefile" (not Makefile.in).

according to: http://www.fluxforge.com/blog/building-portaudio-under-os-x-107-lion

6) Now I'm trying to build (using: "sudo make"), compilation starts, but with an error:

ld: framework not found CoreAudio

collect2: ld returned 1 exit status

make: * [lib / libportaudio.la] Error 1

7) So, I'm trying to point to the framework using "-F / System / Library / Frameworks -framework CoreAudio"

leading to the following terminal command:

$ MACOSX_DEPLOYMENT_TARGET = "10.7" ARCHFLAGS = "- arch i386" CFLAGS = "- O2 -g -Wall -isysroot / Applications / Xcode.app / Contents / Developer / Platforms / MacOSX.platform / Developer / SDKs / MacOSX10. 7.sdk -arch i386 -mmacosx-version-min = 10.7 "LDFLAGS =" - isysroot / Applications / Xcode.app / Contents / Developer / Platforms / MacOSX.platform / Developer / SDKs / MacOSX10.7.sd -arch i386 - mmacosx-version -min = 10.7 -F / System / Library / Frameworks -framework CoreAudio ". / configure --disable-mac-universal

which apparently fixes the CoreAudio kernel problem, but leads to another error:

ld: library not found for -lSystem

collect2: ld returned 1 exit status

make: * [lib / libportaudio.la] Error 1

I'm stuck now. Has anyone experienced the same problems when trying to build Portaudio on OSX 10.7 using SDK10.6 or SDK10.7. Has anyone found a solution on how to build Portaudio from a terminal? I am very grateful for any tips !!! Thanks in advance!

+4
source share
3 answers

OK, finally, I solved the problem. Hope the solution helps others as well. I just forgot to add the path to the CoreAudio framework to CFLAGS. Here is the final configure / build command to build portaudio on OSX 10.7.5 using SDK10.7 for the i386 and x86_64 architectures:

Open a terminal window in the portaudio directory and enter:

MACOSX_DEPLOYMENT_TARGET = "10.7" ARCHFLAGS = "- arch i386" CFLAGS = "- O2 -g -Wall -isysroot / Applications / Xcode.app / Contents / Developer / Platforms / MacOSX.platform / Developer / SDKs / MacOSX10.7.sdk - arch i386 -mmacosx-version-min = 10.7 -F / System / Library / Frameworks -framework CoreAudio "LDFLAGS =" - isysroot / Applications / Xcode.app / Contents / Developer / Platforms / MacOSX.platform / Developer / SDKs / MacOSX10. 7.sdk -arch i386 -mmacosx-version-min = 10.7 -F / System / Library / Frameworks -framework CoreAudio ". / configure --disable-mac-universal

If this ends, you need to edit the Makefile and change the mention of -Werror to -Wall .

Then:

to do

Voila. There you have "libportaudio.la" in the portaudio / lib directory. Now you can enter

sudo make install

(you will be asked to confirm with a password)

to put the library in the system directory.

Finally, you can mess with Portaudio! Enjoy!

+2
source

Try the latest version of svn. If this does not work right off the bat, you may need to discard some flags.

for example, in the configure.in file:

  • change -Werror to -Wall
  • add -Wno-deprecated (you do not need this, but just in case)

then run

 ./configure --disable-mac-universal 

and do as usual.

+4
source

Tried your instructions on Mac OSX Mountain Lion (10.8), and it made a lot of progress in compiling, but then it didn't execute with:

 In file included from ./test/patest_sine_channelmaps.c:53: ./include/pa_mac_core.h:100:1: error: unknown type name 'AudioDeviceID' AudioDeviceID PaMacCore_GetStreamInputDevice( PaStream* s ); ^ ./include/pa_mac_core.h:109:1: error: unknown type name 'AudioDeviceID' AudioDeviceID PaMacCore_GetStreamOutputDevice( PaStream* s ); ^ 2 errors generated. make: *** [bin/patest_sine_channelmaps] Error 1 

However, I realized that you can just use Homebrew (apt-like package manager for OSX) and it will do the dirty work like a charm. Find binaries and headers in the specified installation directory :)

 $ brew install portaudio Warning: It appears you have MacPorts or Fink installed. Software installed with other package managers causes known problems for Homebrew. If a formula fails to build, uninstall MacPorts/Fink and try again. ==> Downloading http://www.portaudio.com/archives/pa_stable_v19_20111121.tgz ######################################################################## 100.0% ==> Downloading patches ######################################################################## 100.0% ==> Patching patching file include/pa_mac_core.h ==> ./configure --prefix=/usr/local/Cellar/portaudio/19.20111121 --enable-mac-un ==> make install /usr/local/Cellar/portaudio/19.20111121: 8 files, 316K, built in 20 seconds 
0
source

Source: https://habr.com/ru/post/1445068/


All Articles