Switching to newer version of Clang

Andrew Berg aberg010 at my.hennepintech.edu
Thu Jul 31 10:05:35 UTC 2014


On 2014.07.30 21:01, Brian Wood wrote:
> I did a make install in
> 
> /usr/ports/devel/llvm34
> 
> After it finished
> 
> clang -v
> 
> still says 3.3.  Do I have to reboot or try something
> different?  Thanks.
> 
First, you need to install lang/clang34 (clang depends on llvm, not the other
way around).

You can have multiple compilers (and multiple versions of compilers) installed
at the same time. Anything installed from ports will *never* overwrite anything
in base. You're looking for clang34 (/usr/local/bin/clang34). Similarly, gcc
installed from ports would be the same: gcc 4.7, for example, would be
/usr/local/bin/gcc47. If you want to build ports with an alternate compiler,
you'll need something like this in make.conf:

CC=clang34
CPP=clang-cpp34
CXX=clang++34


More information about the freebsd-questions mailing list