Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#20361 closed defect (fixed)

don't pass -arch to fortran compilers

Reported by: simon@… Owned by: skymoo (Adam Mercer)
Priority: Normal Milestone: MacPorts 1.8.0
Component: base Version: 1.8.0
Keywords: fftw-3 -arch Cc: mamoll (Mark Moll), jmroot (Joshua Root)
Port: fftw-3

Description

While trying to upgrade fftw-3 @3.2.1_2+gcc43 the configure script fails with the following error:

checking for Fortran 77 name-mangling scheme... configure: error: in `/opt/local/var/macports/build/_opt_local_macports-trunk_dports_math_fftw-3/work/fftw-3.2.2':
configure: error: cannot compile a simple Fortran program

config.log shows:

configure:25700: gfortran-mp-4.3 -o conftest -pipe -O2 -arch i386 -L/opt/local/lib -arch i386 conftest.f -lm
f951: error: unrecognized command line option "-arch"
f951: error: unrecognized command line option "-arch"

I have not tested it for other gcc variants and I am aware that this is related to changes in 1.8

Change History (13)

comment:1 Changed 15 years ago by skymoo (Adam Mercer)

Cc: ram@… removed
Owner: changed from macports-tickets@… to ram@…
Status: newassigned

comment:2 Changed 15 years ago by skymoo (Adam Mercer)

I can't reproduce this on my MBP running Leopard and MacPorts-1.7.1. Are you trying to build universally?

comment:3 Changed 15 years ago by simon@…

No, I am not. From 1.8.0 on configure.archflags is being set by base. For example #20280 shows the same behavior for the gcc port itself.

comment:4 Changed 15 years ago by tobypeterson

I believe the port needs to use configure.compiler instead of directly setting the fortran compiler. Should make the check in base work...

comment:5 in reply to:  4 Changed 15 years ago by skymoo (Adam Mercer)

Replying to toby@…:

I believe the port needs to use configure.compiler instead of directly setting the fortran compiler. Should make the check in base work...

How? I thought that using configure.f77 was the correct way of setting which f77 compiler to use, and reading the description of configure.compiler in the guide seems to indicate this as well.

comment:6 Changed 15 years ago by blb@…

Does

configure.compiler   macports-gcc-4.?

work instead of setting just configure.f77?

comment:7 in reply to:  6 Changed 15 years ago by simon@…

Replying to blb@…:

Does

configure.compiler   macports-gcc-4.?

work instead of setting just configure.f77?

I tried to set configure.compiler macports-gcc-4.3 in the gcc43 variant. Now the "-arch error" appears already on checking the C compiler gcc-mp-4.3 .

comment:8 Changed 15 years ago by tobypeterson

Summary: fftw-3: failure during configure phase, compiler does not recognize -arch flag(trunk) fftw-3 +gcc43: failure during configure phase, compiler does not recognize -arch flag

It's possible that the configure.compiler setting gets used earlier, and setting in the variant is too late for the arch_flag_supported check to operate correctly.

comment:9 Changed 15 years ago by tobypeterson

openmpi also affected, #20375

comment:10 Changed 15 years ago by mamoll (Mark Moll)

Cc: mmoll@… added

Cc Me!

comment:11 in reply to:  8 Changed 15 years ago by jmroot (Joshua Root)

Cc: jmr@… added
Milestone: MacPorts 1.8.0

Replying to toby@…:

It's possible that the configure.compiler setting gets used earlier, and setting in the variant is too late for the arch_flag_supported check to operate correctly.

Yeah, configure.archflags gets appended to configure.{c,cxx,f}flags before variants are executed. There are a couple of issues here: first, I don't think any fortran compiler supports -arch, so we should probably always use -m32/-m64 in configure.f*flags. Second, it's probably a bad idea to be appending to those variables at all, since there's really no time you can do it without the potential for getting it wrong. I think the convention just has to be that configure.archflags will be added to the right environment variable during configure, but if you are patching CFLAGS into a Makefile manually or whatever you'll just have to specifically put the archflags in there as well.

comment:12 Changed 15 years ago by jmroot (Joshua Root)

Component: portsbase
Resolution: fixed
Status: assignedclosed
Summary: (trunk) fftw-3 +gcc43: failure during configure phase, compiler does not recognize -arch flagdon't pass -arch to fortran compilers

comment:13 Changed 15 years ago by alakazam@…

The problem was also present in the latest revision of the octave Portfile. r54236 fixes this issue. Thanks !

Note: See TracTickets for help on using tickets.