How can I remove '-arch x86_64' during configure

Joshua Root jmr at
Tue Mar 15 11:54:53 PDT 2011

On 2011-3-16 01:49 , Konis Kjell wrote:
> Hello,
> R port maintainer here. I am trying to build the R port using the
> compilers in the llvm-gcc42 port (since I believe this is the only set of
> compilers that includes Fortran and is compatible with Xcode). If I run
> ./configure by hand everything works, e.g.
>   CFLAGS=-I/MacPorts/include \
>   LDFLAGS=-L/MacPorts/lib \
>   CC=/MacPorts/bin/llvm-gcc-4.2 \
>   CXX=/MacPorts/bin/llvm-g++-4.2 \
>   OBJC=/MacPorts/bin/llvm-gcc-4.2 \
>   F77=/MacPorts/bin/llvm-gfortran-4.2 \
>   FC=/MacPorts/bin/llvm-gfortran-4.2 \
>   ./configure --prefix=/u/smat/konis/Desktop/R-2.12.2
> --without-recommended-packages
>   make
>   make install
> does what I want. However, when I set this up in MacPorts, '-arch x86_64'
> gets added to the arguments passed to the C and Fortran compilers and
> -arch is not supported by llvm-gcc-4.2. How can I remove the '-arch
> x86_64' during the configure phase?

Normally in this sort of situation you should set configure.compiler.
This not only sets up, configure.cxx and so forth for you,
but it also sets configure.cc_archflags, which is where the -arch x86_64
is coming from, to something the selected compiler suite will understand.

However, configure.compiler macports-llvm-gcc-4.2 is only in trunk at
the moment. So you need to DIY. Easiest way is probably to set
'configure.compiler macports-gcc-4.2' or something, then set
configure.{cc,cxx,...} to the right values.

There will never be -arch in FFLAGS, F90FLAGS or FCFLAGS BTW. If they
end up being passed to the fortran compiler it must be the build system
incorrectly using CFLAGS or something.

- Josh

More information about the macports-dev mailing list