portaudio on osx 10.11 - matlab

I would like to install portaudio on OSX El Capitan 10.11.
I have downloaded the latest snapshot and tried to install, and I got something about frameworks not being available. I hacked the configure script to help xcodebuild find the framework for 10.11 and now I get: 1
src/hostapi/coreaudio/pa_mac_core_utilities.c:152:10: error: 'kAudioUnitErr_IllegalInstrument' is deprecated [-Werror,-Wdeprecated-declarations]
case kAudioUnitErr_IllegalInstrument:
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/AudioUnit.framework/Headers/AUComponent.h:1633:2: note:
'kAudioUnitErr_IllegalInstrument' has been explicitly marked deprecated here
kAudioUnitErr_IllegalInstrument = -10873,
^
src/hostapi/coreaudio/pa_mac_core_utilities.c:155:10: error: 'kAudioUnitErr_InstrumentTypeNotFound' is deprecated [-Werror,-Wdeprecated-declarations]
case kAudioUnitErr_InstrumentTypeNotFound:
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/AudioUnit.framework/Headers/AUComponent.h:1634:2: note:
'kAudioUnitErr_InstrumentTypeNotFound' has been explicitly marked deprecated here
kAudioUnitErr_InstrumentTypeNotFound = -10872,
^
2 errors generated.
make: *** [src/hostapi/coreaudio/pa_mac_core_utilities.lo] Error 1
I now understand that is because carbon is no longer available in 10.11.
Is there any way around this, or any way to install the previous frameworks? Or should I be using something else. I want portaudio to work so that I can install playrec and get duplex audio on matlab on a mac.

Related

How can I remove or ignore arguments from the swift compiler

Im trying to use an older xcode toolchain (3.1) with my latest xcode version (10).
Starting with a blank project and trying to build I get the following error.
<unknown>:0: error: unknown argument: '-enable-batch-mode'
<unknown>:0: error: unknown argument: '-enforce-exclusivity=checked'
<unknown>:0: error: unknown argument: '-index-store-path'
Command CompileSwiftSources failed with a nonzero exit code
When I look at the compiler output I can clearly see these parameters being passed (cropped for brevity).
/Library/Developer/Toolchains/swift-3.1-RELEASE.xctoolchain/usr/bin/swiftc **-incremental -module-name MyTestApp -Onone -enable-batch-mode -enforce-exclusivity=checked** -DDEBUG -sdk
Is it possible to tell the compiler to ignore these parameters or remove them somehow?
I had considered building with CLI and cobbling the buuild command together but I need the source to be running in xcode so I can debug an issue with a legacy project.
In the end I just downloaded an older version of xcode and also downloaded device support for my new ios device..... which the older xcode didnt support.

Swift 3.1.1 compile error: unknown key 'SwiftImportAsNonGeneric'

Some time after upgrading to Xcode 9, I discovered that I was no longer able to build a Kitura-based project with the Swift 3.1.1 snapshot (which I have installed via swiftenv).
When I ran swift build, some time into the build I would get:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes:8:28: error: unknown key 'SwiftImportAsNonGeneric'
SwiftImportAsNonGeneric: true
^
<unknown>:0: error: could not build Objective-C module 'Foundation'
It seems that there is a dependency between Swift and Xcode, and Xcode 9 is no longer fully compatible with Swift 3.1.1 (or earlier) snapshots. I believe it may be because my project uses Foundation, and Foundation on Mac is provided as part of Xcode, whereas on Linux it is part of the Swift snapshot (via swift-corelibs-foundation).
I did find a solution to this problem: If I keep a copy of Xcode 8.3.3 around (eg. in /Applications/Xcode8.3.3.app) then I can use sudo xcode-select -s /Applications/Xcode<version>.app/Contents/Developer to select the appropriate one prior to building with SPM, and I can then build both Swift 3.1.1 and 4.0 projects on the same system.
However, this feels a bit clunky. Each time I build a project with the 'other' Swift version, I have to make sure I run xcode-select, or the build will fail. Is having multiple versions of Xcode the right solution in this case, or am I missing a trick with Xcode 9?
note that if, like me, you upgraded Xcode via the App Store, previous versions of Xcode are still available from https://developer.apple.com/download/more/

installing libsvm on Mac (OSX 10.9.2)

I have tried to install the libsvm package with
mex -setup
(since "make" resulted in an error). This was followed by one choice for a compiler, so I chose "1".
Afterwards I typed in "make" got the following error though:
xcrun: error: SDK "macosx10.7" cannot be located
clang: warning: no such sysroot directory: '-mmacosx-version-min=10.7'
libsvmread.c:1:10: fatal error: 'stdio.h' file not found
#include <stdio.h>
^
1 error generated.
mex: compile of ' "libsvmread.c"' failed.
If make.m fails, please check README about detailed instructions.
What can I do?
I think the following answer from the matlab support might be helpful (http://www.mathworks.com/matlabcentral/answers/103904-can-i-use-xcode-5-as-my-c-or-c-compiler-in-matlab-8-1-r2013a-or-matlab-8-2-r2013b):
The Mac OS X 10.7 SDK, available in Xcode 4.1 through 4.6, is used by
MEX and related capabilities. This SDK is no longer available in Xcode
5, resulting in errors similar to the following when compiling:
xcodebuild: error: SDK "macosx10.7" cannot be located.
xcrun: error: unable to find utility "clang", not a developer tool or
in PATH
The simplest solution is to avoid updating Xcode to version 5 if you
are using R2013a or R2013b. If you need Xcode 5, or you have already
irreversibly upgraded to it, you can update MEX to use the 10.8 SDK:
In the MATLAB Command Window, execute the following commands:
cd(matlabroot)
cd bin
edit mexopts.sh
Save a backup copy of this file somewhere in case you make a mistake and you need to revert your changes.
Scroll down to the Mac (“maci64”) section of this file, beginning around line 120.
Replace all instances of 10.7 with 10.8; there are four of these in all (a fifth may be found in comments only)
Save the file, then execute the following command in the MATLAB Command Window:
mex -setup
Please note that this workaround links MEX files with a different SDK
than with which MATLAB was tested. Although there are no known
compatibility issues, support may be limited.

Performance API on mac 10.8

Anyone tried to install papi(performance API) version 5.1.0 on the mac os 10.8 ? I am getting following errors on the make command.
zero_attach.c: In function ‘main’:
zero_attach.c:84: error: ‘PTRACE_ATTACH’ undeclared (first use in this function)
zero_attach.c:84: error: (Each undeclared identifier is reported only once
zero_attach.c:84: error: for each function it appears in.)
zero_attach.c:84: warning: passing argument 4 of ‘ptrace’ makes integer from pointer without a cast
zero_attach.c:117: error: ‘PTRACE_CONT’ undeclared (first use in this function)
The INSTALL.txt doesnt say anything on the mac os. Just says it can be installed no procedure given so i tried just the standard procedure mentioned.
On the main page of papi -> platform supported, it doesnt say about anything about mac os.
Do i need to install some drivers for this ? any help will be great..
I just installed the latest version of PAPI (5.3.0) on OS X v 10.9.1.
Following the instructions in the install file did the trick too!
wget http://icl.cs.utk.edu/projects/papi/downloads/papi-5.3.0.tar.gz
tar -xvf papi-5.3.0.tar.gz
cd papi-5.3.0/src
./configure
make
The only problem I encountered was with an undefined malloc.h, this is easily
fixed by either making a dummy malloc.h stub with
touch malloc.h
or copying a good malloc.h into the src directory
cp /System/Library/Frameworks/Kernel.framework/Versions/A/Headers/sys/malloc.h .
Then you should be fine with:
make
./run_tests.sh
make install
Happy performance counting!
p.s. I did this with gcc-4.7.3 (installed with homebrew).

GCC 4.7 on OS X Lion: cannot compute suffix of object files

I know this issue already discussed (include there), and no one time. But, unfortunately, I cannot solve this problem.
So, I have OS X Lion, i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1, and I try to build gcc-4.7.0.
First of all, I've already built this compiler on Debian GNU/Linux, so I was sure any problems will not be...
So, I read this GCC manual and I did all exactly as described:
cd gcc-4.7.0
./contrib/download_prerequisites
cd ..
mkdir gcc_build
cd gcc_build
/Users/dshevchenko/Downloads/gcc-4.7.0/configure --prefix=/Users/dshevchenko/Tools/GCC
make
So, MPC, MPFR and GMP was successfully downloaded, and ./configure was OK. But after few minutes after make I get this error:
checking for suffix of object files... configure: error:
in `/Users/dshevchenko/Downloads/gcc_build/x86_64-apple-darwin11.4.0/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.
As I understand this can't be due error of dynamic linking with MPFR, MPC or GMP, because these libs was built inside of GCC source code tree.
In my ~/.bash_profile:
export DYLD_LIBRARY_PATH=/Users/dshevchenko/Tools/GCC/lib
Help me please, I'll be grateful for any advice.
Be sure you have the latest Xcode (4.4 at the time of this writing). There is a bug in the llvm compiler in some versions of Xcode (including 4.1, which I had). For Xcode 4.4, the command line tools must be downloaded from the Xcode preferences.
the follow solution helped me out:
$ export CC="gcc -D_FORTIFY_SOURCE=0”
$ $srcdir/configure ...
$ make
source: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50342