matlab如何配置xcode,Mac OS10.10 Yosemite(XCode 6)下使用Matlab

以下内容转自:http://www.seaandsailor.com/matlab-xcode6.html

After I upgraded my Mac to Yosemite (10.10), I had a lot of trouble to get MATLAB 2013a working properly. First, I started getting a NullPointerException from Java when trying to start it. Turns out this was a problem with some Java classes used for drawing MATLAB's GUI and Mathworks released some patches for MATLAB versions from R2012b to R2014a (the bug was fixed in R2014b).

Unfortunately, that was not the only issue. Since I also upgraded to XCode 6, I was not able to compile MEX files anymore. I checked the system requirements at the Mathworks websiteand it states that R2013a and R2013b support XCode 4.3 or higher, and R2014a supports either 4.6+ or 5.0. From my previous experience, I know sometimes these are "soft" requirements and I managed to make MATLAB work with unsupported compilers (like different versions of Visual Studio on Windows, or different versions of GCC on Linux). However, on a Mac the command mex -setup only gives you an option to keep your current compiler configuration or copy the default file to your home folder. Here's what I did to make MATLAB work with XCode 6:

Run mex -setup and ask it to copy the default mexopts.sh to my home folder.

Edit /Users/myusername/.matlab/R2013a/mexopts.sh, replacing all instances of 10.8 to10.10 in the section corresponding to Mac 64 bits (i.e., everything after the line maci64)and the end of the file).

After doing this, calling mex worked, but I was still not able to compile my MEX files. The error message I got was the following:

error: unknown typename 'char16_t'

typedef char16_t CHAR16_T;`.

Turns out the compiler that ships with XCode 6 (Clang) does not set char16_t, as explained in this helpful Stack Overflow post. Instead of having to remember to set this to UINT16_Tevery time I compile a MEX file or editing the source, I decided to add this to my mexopts.shfile, which leads us to the third and final step:

Replace the line that reads CFLAGS="$CFLAGS -fexceptions" by CFLAGS="$CFLAGS -fexceptions -Dchar16_t=UINT16_T".

After adding this, MATLAB happily compiled all of the MEX files I tested, even some I had generated with MATLAB Coder.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Xcode 没有比任何时候都可帮助您创建高质量的应用程序。它自动配置您的应用程序以使用最新的苹果服务、 管理统一的资产目录中的图像,并可帮助您设计令人惊叹的接口为 7 的 iOS 和 OS X。它也容易地分析您的代码、 监视性能,并测试您的应用程序,并对持续集成的访问与内置权在中,您的团队可以创建比以往更好的应用程序。 1.在“应用程序”中,右键单击 -- 》 “显示包内容”。 2.依次打开 “contents” --》“Developer” --》 “Platforms” --->>"iPhoneOS.platform"-->>"DeviceSupport". 3.将“10.3 (14E269)”拷贝到 “DeviceSupport”中。收缩 Xcode 6.4 adds support for iOS 8.4 Xcode 6.4 includes Swift 1.2 and SDKs for OS X 10.10 Yosemite and iOS 8.4    Swift 1.2   •增量生成显著提高编译时敏捷项目   •斯威夫特编译器的调试版本和发布版本产生更快的可执行文件   •语言改进`让`和`为`迅速作出更一致和明确的   •标准库增加了强大的功能,包括“设置的数据类型和操作的flatmap   •代码转换器和固定它帮助你迁移到快1.2   在Xcode 6.3的附加功能:   •操场更具吸引力和可读性与丰富的文本格式和显示结果的在线   •操场可以嵌入额外的代码和资源来提高性能和简化共享   •更新OS X SDK包括新的力量触摸板支持   •崩溃的组织者可以很容易地分流和固定崩溃App Store和试飞程序   •苹果LLVM编译器的6.1提高了诊断信息,并增加了C + + 14支持

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值