# Selecting the compiler



## sprock (Oct 15, 2015)

Hello,

I'm working on adding POCL to FreeBSD.  The developers recommend using clang36 & clang++36.  I installed those and was able to compile POCL in my home directory using this invocation of configure:


```
../pocl/configure --enable-debug --prefix=/opt CC=/usr/local/bin/clang36 CXX=/usr/local/bin/clang++36
```

I have tried various ways to set the compilers to use in the Makefile for the port, which currently consists of:


```
# $FreeBSD$

PORTNAME=   pocl
PORTVERSION=   0.12
CATEGORIES=   devel
MASTER_SITES=   http://portablecl.org/docs/html/

MAINTAINER=   rmason@mun.ca
COMMENT=   An implementation of the Open Computing Language

# Does not work:
# CC=  ${LOCALBASE}/bin/clang36
# CXX=  ${LOCALBASE}/bin/clang++36

# Does not work either:
CONFIGURE_ARGS="CC=/usr/local/bin/clang36"
CONFIGURE_ARGS+="CXX=/usr/local/bin/clang++36"
GNU_CONFIGURE=1

.include <bsd.port.mk>
```

The result is that configure always finds the wrong compiler:


```
config.status: executing libtool commands

=======================================================================

Using LLVM version 3.3 from /usr/local/llvm33
```

How should I set the compilers to use?

Thanks,
sprock


----------



## talsamon (Oct 15, 2015)

`CC= ${LOCALBASE}/bin/clang36`  works. Maybe /usr/local/bin is not in the `$PATH`?


----------



## tobik@ (Oct 16, 2015)

There is this line in the output of `./configure --help`:

```
LLVM_CONFIG Program used to retrieve LLVM options and binaries
```
 Maybe use CONFIGURE_ENV+=   LLVM_CONFIG=${LOCALBASE}/bin/llvm-config36


----------



## sprock (Oct 16, 2015)

Thank you talsamon and tobik.  Setting LLVM_CONFIG did the trick.

sprock


----------

