如何使用macports安装clang 3.1? (OSX,雪豹) [英] How to install clang 3.1 using macports? (OSX, snow leopard)

查看:77
本文介绍了如何使用macports安装clang 3.1? (OSX,雪豹)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用macports安装最新的clang(3.1)编译器(我使用emacs而不是xcode,并且xcode随附的clang版本仍然较旧). macports似乎具有gcc的最新版本,但是当我输入"port list clang"时,显示的唯一版本是2.9.我使用的是C ++ 11功能,因此我想使用最新版本.

I'd like to install the latest clang (3.1) compiler using macports (I use emacs rather than xcode, and the version of clang that comes with xcode is older anyway). macports seems to have the latest versions of gcc, but when I enter "port list clang" the only version that shows up is 2.9. I use the C++11 features, so I want to use the latest version.

我在MBP上跑雪豹.

推荐答案

Clang在MacPorts上提供了几种不同的版本:

Clang has several different versions available on MacPorts:

$ port search clang

clang @2.9 (lang)
    C, C++, Objective C and Objective C++ compiler

clang-2.9 @2.9 (lang)
    C, C++, Objective C and Objective C++ compiler

clang-3.0 @3.0 (lang)
    C, C++, Objective C and Objective C++ compiler

clang-3.1 @3.1-r154872 (lang)
    C, C++, Objective C and Objective C++ compiler

clang-devel @3.0 (lang)
    C, C++, Objective C and Objective C++ compiler

clang_select @0.1 (sysutils)
    common files for selecting default clang version

Found 6 ports.

因此,如果您仅安装clang端口,它将安装版本2.9.如果需要3.1,请安装clang-3.1端口.您还可以安装clang_select,这是一个实用程序,可让您轻松地在多个Clang安装之间进行切换.如果没有它,则必须每次手动指定所需的Clang二进制版本.

So if you just install the clang port, it'll install version 2.9. If you want 3.1, install the clang-3.1 port. You can also install clang_select, which is a utility that allows you to easily switch between multiple installations of Clang; without it, you have to manually specify the version of the Clang binary you want each time.

这篇关于如何使用macports安装clang 3.1? (OSX,雪豹)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆