简体   繁体   中英

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+. But all what it needs is a newer version of clang (LLVM), which is included in Lion and Mountain Lion. I read before here I can do that with MacPorts. So I used port install clang and MacPorts updated to clang-2.9, then clang-3.2 and finally clang-3.3. I thought, its updated now and I checked the 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`. 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 . What can I do now, that it runs 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). You could try to copy the lib file into /usr/lib .

Alternatively, you can just download a more recent official build of Clang here: 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. If you run into trouble, please ask again.

Another approach is to build Clang and LLVM from source. You can find the repository URLs and instructions here: http://clang.llvm.org/get_started.html

This should also build Clang with the LLVM libraries statically linked.

3.3, by the way, has not been officially released, so I would recommend using 3.2 unless you need any specific new features.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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