How to install clang 3.1 using macports? (OSX, snow leopard)

ぃ、小莉子 提交于 2019-12-05 08:23:58

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.

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.

Just specify the version number: port list clang-3.1

Worked fine for me. I'm on Lion, but I don't see why that would make a difference.

Since the macports repository appears to not have the latest clang, I suggest building clang from source and then proceeding to make a new macports package.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!