Opened 4 years ago

Closed 4 years ago

#59989 closed defect (fixed)

gdal +gcc: configure: error: C compiler cannot create executables

Reported by: TheLastLovemark Owned by: Veence (Vincent)
Priority: Normal Milestone:
Component: ports Version: 2.6.2
Keywords: haspatch Cc:
Port: gdal

Description

main and config logs attached

Attachments (2)

grass+gcc9_main.log (17.6 KB) - added by TheLastLovemark 4 years ago.
grass+gcc9_config.log (13.4 KB) - added by TheLastLovemark 4 years ago.

Download all attachments as: .zip

Change History (7)

Changed 4 years ago by TheLastLovemark

Attachment: grass+gcc9_main.log added

Changed 4 years ago by TheLastLovemark

Attachment: grass+gcc9_config.log added

comment:1 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

Summary: gdal +gcc build failuregdal +gcc: configure: error: C compiler cannot create executables

The main.log says:

configure: error: C compiler cannot create executables

And the config.log says the reason for this is:

gcc-mp-9: error: unrecognized command line option '-stdlib=libc++'

I explained in comment:ticket:59976:20 why this is happening and how to fix it.

comment:2 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: Veence removed
Owner: set to Veence
Status: newassigned

comment:3 Changed 4 years ago by nhchan

Just to echo the same issue, without the +grass variant indicated by the main.log and config.log files uploaded by the original reporter (i.e., with only the +gcc9 variant). The errors are identical as far as I can tell from the corresponding log files on my machine.

I looked at comment:ticket:59976:20 and the comments above, but must regretfully admit that I did not follow everything... Based on whatever I was able to gather in that ticket, however, my temporary solution of forcing an installation of gdal without gcc9 (overriding the +gcc9 in my variants.conf file) appears to be working for now:

$ sudo port uninstall gdal
$ sudo port clean gdal
$ sudo port install gdal -gcc9
Last edited 4 years ago by nhchan (previous) (diff)

comment:4 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

Keywords: haspatch added

While I'm still unclear about why this port needs gcc variants at all, I've submitted a PR to fix them.

comment:5 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: assignedclosed

In b5705597236f14f1c6379a5e60978134a462ae8e/macports-ports (master):

gdal: Don't add -stdlib flag until pre-configure

This port has gcc variants (which change the chosen compiler) so wait
until pre-configure time to inspect the compiler value.

Closes: #59989

Note: See TracTickets for help on using tickets.