How can I remove '-arch x86_64' during configure

Konis Kjell kjell.konis at epfl.ch
Thu Mar 31 10:10:00 PDT 2011


Thanks for your reply and sorry it's taken me so long to get back to this.
 I finally got around to installing MacPorts from trunk and trying

configure.compiler macports-llvm-gcc-4.2

It uses -m64 which gets me past the first problem. But later on, configure
is not able to 'determine how to obtain linking information' from the
llvm-gcc C and Fortran compilers (output below). I can work around the
problem by adding

configure.ldflags-append "-L${prefix}/lib/llvm-gcc42 -lgfortran"

but it seems strange that I only need to do this when MacPorts runs the
configure script. If I run the configure command from my first email by
hand everything works. I poked around a little bit but I'm really a
beginner when it comes to debugging things like this.

Cheers,
Kjell

Here is the configure output from 'port -v configure':
<...>
checking whether we can compute C Make dependencies... yes, using
/MacPorts/bin/llvm-gcc-4.2 -std=gnu99 -MM
checking whether /MacPorts/bin/llvm-gcc-4.2 -std=gnu99 supports -c -o
FILE.lo... yes
checking how to get verbose linking output from
/MacPorts/bin/llvm-gfortran-4.2... configure: WARNING: cannot determine
how to obtain linking information from /MacPorts/bin/llvm-gfortran-4.2

checking for Fortran 77 libraries of /MacPorts/bin/llvm-gfortran-4.2...
checking how to get verbose linking output from /MacPorts/bin/llvm-gcc-4.2
-std=gnu99... configure: WARNING: cannot determine how to obtain linking
information from /MacPorts/bin/llvm-gcc-4.2 -std=gnu99

checking for C libraries of /MacPorts/bin/llvm-gcc-4.2 -std=gnu99...
checking for dummy main to link with Fortran 77 libraries... none
checking for Fortran 77 name-mangling scheme... lower case, underscore, no
extra underscore
checking whether /MacPorts/bin/llvm-gfortran-4.2 appends underscores to
external names... yes
checking whether /MacPorts/bin/llvm-gfortran-4.2 appends extra underscores
to external names... no
checking whether mixed C/Fortran code can be run... configure: WARNING:
cannot run mixed C/Fortran code
configure: error: Maybe check LDFLAGS for paths to Fortran libraries?
<...>



And here is the same output when I run configure by hand:
<...>
checking whether we can compute C Make dependencies... yes, using
/MacPorts/bin/llvm-gcc-4.2 -std=gnu99 -MM
checking whether /MacPorts/bin/llvm-gcc-4.2 -std=gnu99 supports -c -o
FILE.lo... yes
checking how to get verbose linking output from
/MacPorts/bin/llvm-gfortran-4.2... -v
checking for Fortran 77 libraries of /MacPorts/bin/llvm-gfortran-4.2...
-L/MacPorts/lib -L/MacPorts/lib/llvm-gcc42/gcc/x86_64-apple-darwin10/4.2.1
-L/MacPorts/lib/llvm-gcc42/gcc/x86_64-apple-darwin10/4.2.1/../../../x86_64-
apple-darwin10/4.2.1
-L/MacPorts/lib/llvm-gcc42/gcc/x86_64-apple-darwin10/4.2.1/../../..
-lgfortranbegin -lgfortran
checking how to get verbose linking output from /MacPorts/bin/llvm-gcc-4.2
-std=gnu99... -v
checking for C libraries of /MacPorts/bin/llvm-gcc-4.2 -std=gnu99...
-lcrt1.10.6.o -L/MacPorts/lib
-L/MacPorts/lib/llvm-gcc42/gcc/x86_64-apple-darwin10/4.2.1
-L/MacPorts/lib/llvm-gcc42/gcc/x86_64-apple-darwin10/4.2.1/../../../x86_64-
apple-darwin10/4.2.1
-L/MacPorts/lib/llvm-gcc42/gcc/x86_64-apple-darwin10/4.2.1/../../..
-lSystem
checking for dummy main to link with Fortran 77 libraries... none
checking for Fortran 77 name-mangling scheme... lower case, underscore, no
extra underscore
checking whether /MacPorts/bin/llvm-gfortran-4.2 appends underscores to
external names... yes
checking whether /MacPorts/bin/llvm-gfortran-4.2 appends extra underscores
to external names... no
checking whether mixed C/Fortran code can be run... yes
checking whether /MacPorts/bin/llvm-gfortran-4.2 and
/MacPorts/bin/llvm-gcc-4.2 -std=gnu99 agree on int and double... yes
checking whether /MacPorts/bin/llvm-gfortran-4.2 and
/MacPorts/bin/llvm-gcc-4.2 -std=gnu99 agree on double complex... yes
<...>







On 3/15/11 7:54 PM, "Joshua Root" <jmr at macports.org> wrote:

>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.cc, 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