New Ticket     Wiki     Browse Source     Timeline     Roadmap     Ticket Reports     Search

Ticket #20361 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

don't pass -arch to fortran compilers

Reported by: simon@… Owned by: ram@…
Priority: Normal Milestone: MacPorts 1.8.0
Component: base Version: 1.8.0
Keywords: fftw-3 -arch Cc: mmoll@…, jmr@…
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

  Changed 3 years ago by ram@…

  • status changed from new to assigned
  • owner changed from macports-tickets@… to ram@…
  • cc ram@… removed

  Changed 3 years ago by ram@…

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

  Changed 3 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.

follow-up: ↓ 5   Changed 3 years ago by toby@…

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

in reply to: ↑ 4   Changed 3 years ago by ram@…

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.

follow-up: ↓ 7   Changed 3 years ago by blb@…

Does

configure.compiler   macports-gcc-4.?

work instead of setting just configure.f77?

in reply to: ↑ 6   Changed 3 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 .

follow-up: ↓ 11   Changed 3 years ago by toby@…

  • summary changed from fftw-3: failure during configure phase, compiler does not recognize -arch flag to (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.

  Changed 3 years ago by toby@…

openmpi also affected, #20375

  Changed 3 years ago by mmoll@…

  • cc mmoll@… added

Cc Me!

in reply to: ↑ 8   Changed 3 years ago by jmr@…

  • cc jmr@… added
  • milestone set to 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.

  Changed 3 years ago by jmr@…

  • status changed from assigned to closed
  • resolution set to fixed
  • component changed from ports to base
  • summary changed from (trunk) fftw-3 +gcc43: failure during configure phase, compiler does not recognize -arch flag to don't pass -arch to fortran compilers

  Changed 3 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.