简体   繁体   English

如何在Mac OS X 10.6上将clang更新为3.3

[英]How can I update clang to 3.3 on Mac OS X 10.6

I'm running Mac OS X 10.6 and want to install TextMate 2, which is for Mac OS X 10.7+. 我正在运行Mac OS X 10.6并想安装TextMate 2,适用于Mac OS X 10.7+。 But all what it needs is a newer version of clang (LLVM), which is included in Lion and Mountain Lion. 但它所需要的只是更新版的clang(LLVM),它包含在Lion和Mountain Lion中。 I read before here I can do that with MacPorts. 我之前读到过我可以用MacPorts做到这一点。 So I used port install clang and MacPorts updated to clang-2.9, then clang-3.2 and finally clang-3.3. 所以我使用了port install clang和MacPorts更新到clang-2.9,然后是clang-3.2,最后是clang-3.3。 I thought, its updated now and I checked the version: clang --version . 我想,它现在更新了,我检查了版本: clang --version And it's not updated: 它没有更新:

 Apple clang version 2.0 (tags/Apple/clang-139) (based on LLVM 2.9svn)
 Target: x86_64-apple-darwin10
 Thread model: posix

So I copied the new clang file in this path ( /opt/local/libexec/llvm-3.3/bin ) to /usr/bin`. So I copied the new clang file in this path ( /opt/local/libexec/llvm-3.3/bin ) to So I copied the new clang file in this path ( ) to / usr / bin`。 But now there's a fail :( : 但现在有一个失败:(:

dyld: Library not loaded: @executable_path/../lib/libLLVM-3.3svn.dylib 
Referenced from: /usr/bin/clang   
Reason: image not found Trace/BPT trap

The libLLVM-3.3svn.dylib is at /opt/local/libexec/llvm-3.3/lib . libLLVM-3.3svn.dylib位于/opt/local/libexec/llvm-3.3/lib What can I do now, that it runs clang-3.3? 我现在能做什么,它运行clang-3.3? Sorry for my not perfect english ;) Thank you! 抱歉我的英语不完美;)谢谢!

If you run clang from /usr/bin , it will be looking for the LLVM library in /usr/bin/../lib/libLLVM-3.3svn.dylib , ie, /usr/lib/libLLVM-3.3svn.dylib (at least that's what the dynamic loader is telling you). 如果从/usr/bin运行clang ,它将在/usr/bin/../lib/libLLVM-3.3svn.dylib查找LLVM库,即/usr/lib/libLLVM-3.3svn.dylib (至少那是动态加载器告诉你的东西)。 You could try to copy the lib file into /usr/lib . 您可以尝试将lib文件复制到/usr/lib

Alternatively, you can just download a more recent official build of Clang here: http://llvm.org/releases/download.html 或者,您可以在此处下载最新的Clang官方版本: http//llvm.org/releases/download.html

As far as I know, these builds are self-contained and do not need any dynamic libraries. 据我所知,这些构建是自包含的,不需要任何动态库。 However, it could be necessary to copy Apple's ARC libraries into a certain directory. 但是,可能需要将Apple的ARC库复制到某个目录中。 If you run into trouble, please ask again. 如果您遇到麻烦,请再次询问。

Another approach is to build Clang and LLVM from source. 另一种方法是从源代码构建Clang和LLVM。 You can find the repository URLs and instructions here: http://clang.llvm.org/get_started.html 您可以在此处找到存储库URL和说明: http//clang.llvm.org/get_started.html

This should also build Clang with the LLVM libraries statically linked. 这也应该构建Clang与LLVM库静态链接。

3.3, by the way, has not been officially released, so I would recommend using 3.2 unless you need any specific new features. 3.3,顺便说一下,还没有正式发布,所以我建议使用3.2,除非你需要任何特定的新功能。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM