Opened 5 years ago

Closed 5 years ago

#59976 closed defect (duplicate)

gdal @3.0.2_1 +cfitsio +gcc9 +ecw +grass +grib +hdf5 +jasper +libkml +lta +lzma +mysql8 +native +netcdf +openjpeg +perf +poppler +postgresql11 +xerces build failure

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

Description (last modified by TheLastLovemark)

I know... me and my variants.

This debug message caught my attention:

configure: WARNING: unrecognized options: --without-bsb
checking build system type... x86_64-apple-darwin17.7.0
checking host system type... x86_64-apple-darwin17.7.0
checking for gcc... /opt/local/bin/gcc-mp-9
checking whether the C compiler works... no
configure: error: in `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_gdal/gdal/work/gdal-3.0.2/gdal':
configure: error: C compiler cannot create executables
See `config.log' for more details
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_gdal/gdal/work/gdal-3.0.2/gdal" && ./configure --prefix=/opt/local --with-local=yes --with-libz=yes --with-zstd=yes --with-png=yes --with-libtiff=internal --with-geotiff=internal --with-jpeg=internal --with-charls=yes --with-gif=yes --with-proj=/opt/local/lib/proj6 --with-qhull=yes --with-pam --with-sqlite3=/opt/local --with-spatialite=/opt/local --with-curl=/opt/local/bin/curl-config --with-geos=/opt/local/bin/geos-config --with-expat=/opt/local --without-libgrass --without-ogdi --without-fme --without-hdf4 --without-kakadu --without-mrsid --without-jp2mrsid --without-msg --without-bsb --without-oci --with-mysql=/opt/local/lib/mysql8/bin/mysql_config --without-ingres --without-odbc --without-idb --without-sde --without-opencl --without-perl --without-python --mandir=/opt/local/share/man --with-libjson-c=internal --with-cpp14 --with-liblzma=yes --with-libkml=/opt/local --with-libkml-inc=/opt/local/include --with-libkml-lib=/opt/local/lib --with-grass=/opt/local/share/grass76 --with-ecw=/opt/local/lib/ECW --with-hdf5=/opt/local --with-netcdf=/opt/local --with-jasper=/opt/local/include --with-openjpeg=/opt/local/include/openjpeg-2.3 --with-xerces=/opt/local --with-pg=/opt/local/lib/postgresql11/bin/pg_config --with-poppler=/opt/local --with-cfitsio 
Exit code: 77
Error: Failed to configure gdal, consult /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_gdal/gdal/work/gdal-3.0.2/gdal/config.log
Error: Failed to configure gdal: configure failure: command execution failed
DEBUG: Error code: NONE
DEBUG: Backtrace: configure failure: command execution failed
    while executing
"$procedure $targetname"
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_gdal/gdal/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets to report a bug.
Error: Processing of port gdal failed

It made me think this is related to my other ticket here: #59973

But it could also be related to manually installing ECW in /opt/local/lib/ECW as instructed by:

DEBUG: configure phase started at Thu Jan 16 19:56:12 EST 2020
--->  Configuring gdal
DEBUG: Preferred compilers: clang macports-clang-9.0 macports-clang-8.0 macports-clang-7.0 macports-clang-6.0 macports-clang-5.0 macports-gcc-9 macports-gcc-8 macports-gcc-7 macports-gcc-6
DEBUG: Using compiler 'Xcode Clang'
DEBUG: Executing proc-pre-org.macports.configure-configure-0
DEBUG: Found Dependency: path: /opt/local/lib/libgcc filename: libgcc_s.1.dylib regex: ^libgcc_s.1.dylib$
DEBUG: Active variants check for source-type install considers depends_fetch depends_extract depends_lib depends_build depends_run: zlib zstd libpng giflib proj6 qhull sqlite3 spatialite curl charls libgcc9 lzma libkml hdf5 netcdf jasper openjpeg xercesc3 postgresql11 mysql8 poppler cfitsio bash-completion pkgconfig gcc9
DEBUG: Executing proc-pre-org.macports.configure-configure-1
DEBUG: compilers.enforce_c list: 
DEBUG: compilers.enforce_fortran list: 
DEBUG: compilers.enforce_some_fortran list: 
DEBUG: Executing proc-pre-org.macports.configure-configure-2
DEBUG: Executing proc-pre-org.macports.configure-configure-3
DEBUG: Found Dependency: path: /opt/local/lib/libgcc filename: libgcc_s.1.dylib regex: ^libgcc_s.1.dylib$
DEBUG: Active variants check for source-type install considers depends_fetch depends_extract depends_lib depends_build depends_run: zlib zstd libpng giflib proj6 qhull sqlite3 spatialite curl charls libgcc9 lzma libkml hdf5 netcdf jasper openjpeg xercesc3 postgresql11 mysql8 poppler cfitsio bash-completion pkgconfig gcc9
DEBUG: Executing proc-pre-org.macports.configure-configure-4
DEBUG: Executing proc-pre-org.macports.configure-configure-5
DEBUG: Executing proc-pre-org.macports.configure-configure-6
Error: 
****
* The Intergraph ECW SDK version 5.1.1 is needed to
* compile gdal with the ecw variant. It must be installed separately.
* Please download the macOS version of the SDK
* 'ERDAS ECW/JP2 SDK v5.1.1 (MacOSX)' from
* http://download.intergraph.com/
* Choose to install it in /opt/local/lib/ECW.
* Then try to install GDAL again.
****
Error: Failed to configure gdal: ECW SDK 5.1.1 not installed.
DEBUG: Error code: NONE
DEBUG: Backtrace: ECW SDK 5.1.1 not installed.
    while executing
"$pre $targetname"
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_gdal/gdal/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets to report a bug.
Error: Processing of port gdal failed

(Logically this happened first)

Although the URL has changed, (it is now available at: https://download.hexagongeospatial.com/downloads/ecw/erdas-ecw-jp2-sdk-v5-1-macosx) installing this was simple.

The installed files are where they should be:

sh-3.2# cd /opt/local/lib/ECW/
sh-3.2# ls
.ERDASEcwJp2SDKChoices		ERDAS_ECW_JPEG2000_SDK.pdf	Licenses			apidoc				lib
.Repository			Examples			TestData			etc				redistributable
.Uninstall.sh			Frameworks			Uninstall			include

log file attached

Attachments (3)

gdal+variants_main.log (195.3 KB) - added by TheLastLovemark 5 years ago.
gdal_config.log (13.6 KB) - added by TheLastLovemark 5 years ago.
gdal_no-gcc-variant_main.log (192.4 KB) - added by TheLastLovemark 5 years ago.

Download all attachments as: .zip

Change History (24)

Changed 5 years ago by TheLastLovemark

Attachment: gdal+variants_main.log added

comment:1 Changed 5 years ago by TheLastLovemark

Description: modified (diff)

comment:2 Changed 5 years ago by jmroot (Joshua Root)

Cc: Veence removed
Owner: set to Veence
Status: newassigned
Summary: build fail: port -vd install gdal +cfitsio +gcc9 +ecw +grass +grib +hdf5 +jasper +libkml +lta +lzma +mysql8 +native +netcdf +openjpeg +perf +poppler +postgresql11 +xercesgdal @3.0.2_1 +cfitsio +gcc9 +ecw +grass +grib +hdf5 +jasper +libkml +lta +lzma +mysql8 +native +netcdf +openjpeg +perf +poppler +postgresql11 +xerces build failure

Please attach the config.log as well.

comment:3 Changed 5 years ago by TheLastLovemark

There wasn't one in the build folder with main.log. I made sure to look

And I've already cleaned the port.

I will run it again, is it possible I looked in the wrong place?

comment:4 Changed 5 years ago by TheLastLovemark

Found it...

Attached.

Changed 5 years ago by TheLastLovemark

Attachment: gdal_config.log added

comment:5 Changed 5 years ago by kencu (Ken)

for a start, make sure your gcc9 compiler works at all, with a simple "hello, world" test.c.

comment:6 Changed 5 years ago by TheLastLovemark

It seems to work:

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/opt/local/libexec/gcc/x86_64-apple-darwin17/9.2.0/lto-wrapper
Target: x86_64-apple-darwin17
Configured with: /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc9/gcc9/work/gcc-9.2.0/configure --prefix=/opt/local --build=x86_64-apple-darwin17 --enable-languages=c,c++,objc,obj-c++,lto,fortran --libdir=/opt/local/lib/gcc9 --includedir=/opt/local/include/gcc9 --infodir=/opt/local/share/info --mandir=/opt/local/share/man --datarootdir=/opt/local/share/gcc-9 --with-local-prefix=/opt/local --with-system-zlib --disable-nls --program-suffix=-mp-9 --with-gxx-include-dir=/opt/local/include/gcc9/c++/ --with-gmp=/opt/local --with-mpfr=/opt/local --with-mpc=/opt/local --with-isl=/opt/local --enable-stage1-checking --enable-lto --enable-libstdcxx-time --with-build-config=bootstrap-debug --with-as=/opt/local/bin/as --with-ld=/opt/local/bin/ld --with-ar=/opt/local/bin/ar --with-bugurl=https://trac.macports.org/newticket --disable-tls --with-pkgversion='MacPorts gcc9 9.2.0_1+universal'
Thread model: posix
gcc version 9.2.0 (MacPorts gcc9 9.2.0_1+universal) 
$ gcc hello_world.c -o test
$ ./test
Hello Lovemark
$ 
Last edited 5 years ago by TheLastLovemark (previous) (diff)

comment:7 Changed 5 years ago by kencu (Ken)

OK. Looking through your config.log, the error appears to be this:

84	configure:3890: checking whether the C compiler works
85	configure:3912: /opt/local/bin/gcc-mp-9 -pipe -Os -arch x86_64 -I/opt/local/include -L/opt/local/lib -Wl,-headerpad_max_install_names -stdlib=libc++ -arch x86_64 conftest.c  >&5
86	gcc-mp-9: error: unrecognized command line option '-stdlib=libc++'

now to figure out why that -stdlib=libc++ is being passed to gcc...

comment:8 Changed 5 years ago by kencu (Ken)

probably this <https://github.com/macports/macports-ports/blob/35e611d9bc3b61b3fa0b9def910977fd53db153e/gis/gdal/Portfile#L46>.

I'm not sure why that was really needed, or why there is a gcc9 build variant at all.

Why don't you delete the gcc9 variant and try like that?

comment:9 Changed 5 years ago by TheLastLovemark

Tried this: port -vd install gdal +cfitsio +ecw +grass +grib +hdf5 +jasper +libkml +lta +lzma +mysql8 +native +netcdf +openjpeg +perf +poppler +postgresql11 +xerces

It still failed.

new log attached.

Changed 5 years ago by TheLastLovemark

comment:10 Changed 5 years ago by kencu (Ken)

that's a broken grass variant now. There are some notes in the portfile about what you're supposed to do to fix it. dunno why the automated test is not giving you the error just now...

Last edited 5 years ago by kencu (Ken) (previous) (diff)

comment:11 Changed 5 years ago by kencu (Ken)

A more effective way for you to get these fixed would be to isolate them to individual tickets for individual broken variants, rather than these massive messes with all kinds of issues mixed into one ticket like this...

comment:12 Changed 5 years ago by TheLastLovemark

I'm not experienced in identifying which specific variant is causing a problem. Is it a trial and error process? Or something else? It's often hit or miss for me when reading main.log

Last edited 5 years ago by TheLastLovemark (previous) (diff)

comment:13 Changed 5 years ago by kencu (Ken)

This last one, configure log errors with:

info:configure checking for G_asprintf in -lgrass_gis... no
2447	:info:configure configure: error: --with-grass=/opt/local/share/grass76 requested, but libraries not found!

comment:14 Changed 5 years ago by TheLastLovemark

Why didn't I get a prompt to install the dependency?

comment:15 Changed 5 years ago by TheLastLovemark

#59943 and #58943 seem to identify the problem.

comment:16 Changed 5 years ago by TheLastLovemark

I'm not sure how to move forward with this

comment:17 Changed 5 years ago by kencu (Ken)

sudo port -v install gdal

should hopefully get you going.

if that works, but perhaps you discover that you need a variant for something, you can then try reinstalling the port with the variants you need like this:

sudo port -v upgrade --enforce-variants gdal +mywonderfulnewvariant

when you discover a broken variant, please open a ticket specific to that port and variant, so it can be worked on and closed individually.

It is perhaps not great to have ports with three dozen variants that are not routinely tested... perhaps we might head more toward fewer variants in the future.

comment:18 Changed 5 years ago by TheLastLovemark

I followed your suggestion with cfitsio and ecw. Both installed with no problem.

The next variant I tried was gcc9. That failed. But we knew that from comments 7 and 8.

I checked config.log, it's the same as before. Any idea on how to fix that particular issue?

Moving to the next variants.

comment:19 Changed 5 years ago by TheLastLovemark

Grass variant failed. We knew this from comments 9 & 10.

Creating individual tickets for these two variants now and will keep going.

comment:20 in reply to:  8 Changed 5 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to kencu:

probably this <https://github.com/macports/macports-ports/blob/35e611d9bc3b61b3fa0b9def910977fd53db153e/gis/gdal/Portfile#L46>.

Yes, there's definitely a problem there: it's checking what the compiler is on line 46, but then on line 59 the compiler might be changed due to blacklisting, and this port also uses the mpi portgroup which uses the compilers portgroup and we've already discovered a couple days ago that one or both of those portgroups might change the compiler later, so if a port must use those portgroups then it must not look at what the compiler is until a pre-configure block.

comment:21 Changed 5 years ago by kencu (Ken)

Resolution: duplicate
Status: assignedclosed

Let's close this ticket, as the issues (so far) have been split off into independent tickets for resolution.

Note: See TracTickets for help on using tickets.