using a different compiler with macports

Anders F Björklund afb at macports.org
Fri Feb 22 00:48:04 PST 2008


Wes James wrote:

> On Thu, Feb 21, 2008 at 7:29 PM, Rainer Müller  
> <raimue at macports.org> wrote:
>>
>> Wes James wrote:
>>> I'm trying to find the config file in macports to change the CC and
>>> CXX default parameters that configure uses when it is run on each
>>> package.  Can someone help me with this.
>>
>>  Not that easily possible, it is absolutely centered on using gcc.
>>  But there is the port gcc_select which allows you to maintain  
>> certain
>>  symlinks for gcc, g++, etc. Additionally, each port is free to  
>> choose
>>  another compiler subset (because it might require it).
>>
>>  What exactly are you trying to do?
>>
>>  Rainer
>
> I have a professor that is using the pgi compiler
> (http://www.pgroup.com/) and i was trying to find a way to set CC=pgcc
> and CXX=pgcpp and maybe some other things for macport to use for
> compiling as defaults.

You can't change the defaults (no configuration, as they're hardcoded)
but you can set the values CC and CXX passed to configure at runtime:

port build configure.cc=pgcc configure.cxx=pgcpp

If used a lot, a new "configure.compiler=pgi" option could be added to
the current list of presets (such as "gcc-4.0" and "macports-gcc-4.2") ?

Then again, there is no default configuration for that either...
So it would just mean having to set one variable instead of two.

--anders

PS. For us non-academics, the price tag looks a bit steep.
     But it (and the Intel compilers) could be added anyway.

port build configure.cc=icc configure.cxx=icpc




More information about the macports-users mailing list