1

I get the following error when attempting to build gdal 2.3.0 on an AWS ec2 AMI - more specifically when attempting to make the directory:

[ec2-user@ip-172-31-7-225 gdal-2.3.0]$ make -j4
(cd port; make)
(cd gcore; make generate_gdal_version_h)
rm -f gdal.pc
echo 'CONFIG_VERSION='`cat ./VERSION`'' >> gdal.pc
echo 'CONFIG_INST_PREFIX=/usr/local' >> gdal.pc
make[1]: Entering directory `/tmp/gdal-2.3.0/port'
/bin/sh /tmp/gdal-2.3.0/libtool --mode=compile --silent --tag=CXX g++ -std=c++11 -I/tmp/gdal-2.3.0/port -I/tmp/gdal-2.3.0/gcore -I/tmp/gdal-2.3.0/alg -I/tmp/gdal-2.3.0/ogr -I/tmp/gdal-2.3.0/ogr/ogrsf_frmts -I/tmp/gdal-2.3.0/gnm -I/tmp/gdal-2.3.0/apps -Wold-style-cast -DHAVE_AVX_AT_COMPILE_TIME -DHAVE_SSSE3_AT_COMPILE_TIME -DHAVE_SSE_AT_COMPILE_TIME -g -O2  -Wall -Wextra -Winit-self -Wunused-parameter -Wformat -Werror=format-security -Wno-format-nonliteral -Wlogical-op -Wshadow -Werror=vla -Wdate-time -Wnull-dereference -Wduplicated-cond -Wfloat-conversion -Wmissing-declarations -Wnon-virtual-dtor -Woverloaded-virtual -fno-operator-names -Wzero-as-null-pointer-constant  -DGNM_ENABLED -I/tmp/gdal-2.3.0/port -I/usr/include  -DGDAL_COMPILATION    -I/tmp/gdal-2.3.0/ogr/ogrsf_frmts/geojson/libjson  -DINST_DATA=\"/usr/local/share/gdal\" -DHAVE_CURL -DHAVE_LIBZ -I/usr/include/libxml2 -DHAVE_LIBXML2 -DUSE_ONLY_CRYPTODLL_ALG -DHAVE_OPENSSL_CRYPTO -c -o cpl_conv.lo cpl_conv.cpp
/bin/sh /tmp/gdal-2.3.0/libtool --mode=compile --silent --tag=CXX g++ -std=c++11 -I/tmp/gdal-2.3.0/port -I/tmp/gdal-2.3.0/gcore -I/tmp/gdal-2.3.0/alg -I/tmp/gdal-2.3.0/ogr -I/tmp/gdal-2.3.0/ogr/ogrsf_frmts -I/tmp/gdal-2.3.0/gnm -I/tmp/gdal-2.3.0/apps -Wold-style-cast -DHAVE_AVX_AT_COMPILE_TIME -DHAVE_SSSE3_AT_COMPILE_TIME -DHAVE_SSE_AT_COMPILE_TIME -g -O2  -Wall -Wextra -Winit-self -Wunused-parameter -Wformat -Werror=format-security -Wno-format-nonliteral -Wlogical-op -Wshadow -Werror=vla -Wdate-time -Wnull-dereference -Wduplicated-cond -Wfloat-conversion -Wmissing-declarations -Wnon-virtual-dtor -Woverloaded-virtual -fno-operator-names -Wzero-as-null-pointer-constant  -DGNM_ENABLED -I/tmp/gdal-2.3.0/port -I/usr/include  -DGDAL_COMPILATION    -I/tmp/gdal-2.3.0/ogr/ogrsf_frmts/geojson/libjson  -DINST_DATA=\"/usr/local/share/gdal\" -DHAVE_CURL -DHAVE_LIBZ -I/usr/include/libxml2 -DHAVE_LIBXML2 -DUSE_ONLY_CRYPTODLL_ALG -DHAVE_OPENSSL_CRYPTO -c -o cpl_error.lo cpl_error.cpp
echo 'CONFIG_INST_LIBS=-L/usr/local/lib -lgdal' >> gdal.pc
echo 'CONFIG_INST_CFLAGS=-I/usr/local/include' >> gdal.pc
echo 'CONFIG_INST_DATA=/usr/local/share/gdal/data' >> gdal.pc
cat gdal.pc.in >> gdal.pc
/bin/sh /tmp/gdal-2.3.0/libtool --mode=compile --silent --tag=CXX g++ -std=c++11 -I/tmp/gdal-2.3.0/port -I/tmp/gdal-2.3.0/gcore -I/tmp/gdal-2.3.0/alg -I/tmp/gdal-2.3.0/ogr -I/tmp/gdal-2.3.0/ogr/ogrsf_frmts -I/tmp/gdal-2.3.0/gnm -I/tmp/gdal-2.3.0/apps -Wold-style-cast -DHAVE_AVX_AT_COMPILE_TIME -DHAVE_SSSE3_AT_COMPILE_TIME -DHAVE_SSE_AT_COMPILE_TIME -g -O2  -Wall -Wextra -Winit-self -Wunused-parameter -Wformat -Werror=format-security -Wno-format-nonliteral -Wlogical-op -Wshadow -Werror=vla -Wdate-time -Wnull-dereference -Wduplicated-cond -Wfloat-conversion -Wmissing-declarations -Wnon-virtual-dtor -Woverloaded-virtual -fno-operator-names -Wzero-as-null-pointer-constant  -DGNM_ENABLED -I/tmp/gdal-2.3.0/port -I/usr/include  -DGDAL_COMPILATION    -I/tmp/gdal-2.3.0/ogr/ogrsf_frmts/geojson/libjson  -DINST_DATA=\"/usr/local/share/gdal\" -DHAVE_CURL -DHAVE_LIBZ -I/usr/include/libxml2 -DHAVE_LIBXML2 -DUSE_ONLY_CRYPTODLL_ALG -DHAVE_OPENSSL_CRYPTO -c -o cpl_string.lo cpl_string.cpp
make[1]: Entering directory `/tmp/gdal-2.3.0/gcore'
make[1]: Nothing to be done for `generate_gdal_version_h'.
make[1]: Leaving directory `/tmp/gdal-2.3.0/gcore'
/bin/sh /tmp/gdal-2.3.0/libtool --mode=compile --silent --tag=CXX g++ -std=c++11 -I/tmp/gdal-2.3.0/port -I/tmp/gdal-2.3.0/gcore -I/tmp/gdal-2.3.0/alg -I/tmp/gdal-2.3.0/ogr -I/tmp/gdal-2.3.0/ogr/ogrsf_frmts -I/tmp/gdal-2.3.0/gnm -I/tmp/gdal-2.3.0/apps -Wold-style-cast -DHAVE_AVX_AT_COMPILE_TIME -DHAVE_SSSE3_AT_COMPILE_TIME -DHAVE_SSE_AT_COMPILE_TIME -g -O2  -Wall -Wextra -Winit-self -Wunused-parameter -Wformat -Werror=format-security -Wno-format-nonliteral -Wlogical-op -Wshadow -Werror=vla -Wdate-time -Wnull-dereference -Wduplicated-cond -Wfloat-conversion -Wmissing-declarations -Wnon-virtual-dtor -Woverloaded-virtual -fno-operator-names -Wzero-as-null-pointer-constant  -DGNM_ENABLED -I/tmp/gdal-2.3.0/port -I/usr/include  -DGDAL_COMPILATION    -I/tmp/gdal-2.3.0/ogr/ogrsf_frmts/geojson/libjson  -DINST_DATA=\"/usr/local/share/gdal\" -DHAVE_CURL -DHAVE_LIBZ -I/usr/include/libxml2 -DHAVE_LIBXML2 -DUSE_ONLY_CRYPTODLL_ALG -DHAVE_OPENSSL_CRYPTO -c -o cplgetsymbol.lo cplgetsymbol.cpp
g++: error: unrecognized command line option ‘-Wdate-time’
g++: error: unrecognized command line option ‘-Wnull-dereference’
g++: error: unrecognized command line option ‘-Wduplicated-cond’
g++: error: unrecognized command line option ‘-Wfloat-conversion’
make[1]: *** [cpl_conv.lo] Error 1
make[1]: *** Waiting for unfinished jobs....
(cd gcore; make)
g++: error: unrecognized command line option ‘-Wdate-time’
g++: error: unrecognized command line option ‘-Wnull-dereference’
g++: error: unrecognized command line option ‘-Wduplicated-cond’
g++: error: unrecognized command line option ‘-Wfloat-conversion’
make[1]: *** [cpl_error.lo] Error 1
(cd frmts; make)
make[1]: Entering directory `/tmp/gdal-2.3.0/frmts'
/bin/sh /tmp/gdal-2.3.0/libtool --mode=compile --silent --tag=CXX g++ -std=c++11 -c -I/tmp/gdal-2.3.0/port -I/tmp/gdal-2.3.0/gcore -I/tmp/gdal-2.3.0/alg -I/tmp/gdal-2.3.0/ogr -I/tmp/gdal-2.3.0/ogr/ogrsf_frmts -I/tmp/gdal-2.3.0/gnm -I/tmp/gdal-2.3.0/apps -I/tmp/gdal-2.3.0/gnm -I/tmp/gdal-2.3.0/gnm/gnm_frmts -DGNM_ENABLED -I/tmp/gdal-2.3.0/port -I/usr/include  -DGDAL_COMPILATION -DHAVE_AVX_AT_COMPILE_TIME -DHAVE_SSSE3_AT_COMPILE_TIME -DHAVE_SSE_AT_COMPILE_TIME -g -O2  -Wall -Wextra -Winit-self -Wunused-parameter -Wformat -Werror=format-security -Wno-format-nonliteral -Wlogical-op -Wshadow -Werror=vla -Wdate-time -Wnull-dereference -Wduplicated-cond -Wfloat-conversion -Wmissing-declarations -Wnon-virtual-dtor -Woverloaded-virtual -fno-operator-names -Wzero-as-null-pointer-constant  -DGNM_ENABLED  -DFRMT_gxf  -DFRMT_gtiff  -DFRMT_hfa  -DFRMT_aigrid  -DFRMT_aaigrid  -DFRMT_ceos  -DFRMT_ceos2  -DFRMT_iso8211  -DFRMT_xpm  -DFRMT_sdts  -DFRMT_raw  -DFRMT_dted  -DFRMT_mem  -DFRMT_jdem  -DFRMT_envisat  -DFRMT_elas  -DFRMT_fit  -DFRMT_vrt  -DFRMT_usgsdem  -DFRMT_l1b  -DFRMT_nitf  -DFRMT_bmp  -DFRMT_airsar  -DFRMT_rs2  -DFRMT_ilwis  -DFRMT_rmf  -DFRMT_leveller  -DFRMT_sgi  -DFRMT_srtmhgt  -DFRMT_idrisi  -DFRMT_gsg  -DFRMT_ingr  -DFRMT_ers  -DFRMT_jaxapalsar  -DFRMT_dimap  -DFRMT_gff  -DFRMT_cosar  -DFRMT_pds  -DFRMT_adrg  -DFRMT_coasp  -DFRMT_tsx  -DFRMT_terragen  -DFRMT_blx  -DFRMT_msgn  -DFRMT_til  -DFRMT_r  -DFRMT_northwood  -DFRMT_saga  -DFRMT_xyz  -DFRMT_hf2  -DFRMT_kmlsuperoverlay  -DFRMT_ctg  -DFRMT_e00grid  -DFRMT_zmap  -DFRMT_ngsgeoid  -DFRMT_iris  -DFRMT_map  -DFRMT_cals  -DFRMT_safe  -DFRMT_sentinel2  -DFRMT_derived  -DFRMT_prf  -DFRMT_mrf  -DFRMT_wcs  -DFRMT_wms  -DFRMT_plmosaic  -DFRMT_wmts  -DFRMT_rda  -DFRMT_grib  -DFRMT_bsb  -DFRMT_netcdf  -DFRMT_hdf5  -DFRMT_gif  -DFRMT_jpeg  -DFRMT_png  -DFRMT_pcraster  -DFRMT_pcidsk  -DFRMT_rik  -DFRMT_ozi  -DFRMT_pdf  -DFRMT_postgisraster  -DFRMT_arg \
    -DGDAL_FORMATS=" gxf gtiff hfa aigrid aaigrid ceos ceos2 iso8211 xpm sdts raw dted mem jdem envisat elas fit vrt usgsdem l1b nitf bmp airsar rs2 ilwis rmf leveller sgi srtmhgt idrisi gsg ingr ers jaxapalsar dimap gff cosar pds adrg coasp tsx terragen blx msgn til r northwood saga xyz hf2 kmlsuperoverlay ctg e00grid zmap ngsgeoid iris map cals safe sentinel2 derived prf mrf wcs wms plmosaic wmts rda grib bsb netcdf hdf5 gif jpeg png pcraster  pcidsk rik ozi pdf postgisraster arg" \
    gdalallregister.cpp -o o/gdalallregister.lo
g++: error: unrecognized command line option ‘-Wdate-time’
g++: error: unrecognized command line option ‘-Wnull-dereference’
g++: error: unrecognized command line option ‘-Wduplicated-cond’
g++: error: unrecognized command line option ‘-Wfloat-conversion’
g++: error: unrecognized command line option ‘-Wdate-time’
g++: error: unrecognized command line option ‘-Wnull-dereference’
g++: error: unrecognized command line option ‘-Wduplicated-cond’
g++: error: unrecognized command line option ‘-Wfloat-conversion’
make[1]: *** [cpl_string.lo] Error 1
make -C gxf install-obj
make[1]: *** [cplgetsymbol.lo] Error 1
make[1]: Leaving directory `/tmp/gdal-2.3.0/port'
make: *** [port-target] Error 2
make: *** Waiting for unfinished jobs....
make -C gtiff install-obj
make[1]: Entering directory `/tmp/gdal-2.3.0/gcore'
make -C mdreader
make[2]: Entering directory `/tmp/gdal-2.3.0/frmts/gxf'
/bin/sh /tmp/gdal-2.3.0/libtool --mode=compile --silent --tag=CXX g++ -std=c++11 -I/tmp/gdal-2.3.0/port -I/tmp/gdal-2.3.0/gcore -I/tmp/gdal-2.3.0/alg -I/tmp/gdal-2.3.0/ogr -I/tmp/gdal-2.3.0/ogr/ogrsf_frmts -I/tmp/gdal-2.3.0/gnm -I/tmp/gdal-2.3.0/apps -DHAVE_AVX_AT_COMPILE_TIME -DHAVE_SSSE3_AT_COMPILE_TIME -DHAVE_SSE_AT_COMPILE_TIME -g -O2  -Wall -Wextra -Winit-self -Wunused-parameter -Wformat -Werror=format-security -Wno-format-nonliteral -Wlogical-op -Wshadow -Werror=vla -Wdate-time -Wnull-dereference -Wduplicated-cond -Wfloat-conversion -Wmissing-declarations -Wnon-virtual-dtor -Woverloaded-virtual -fno-operator-names -Wzero-as-null-pointer-constant  -DGNM_ENABLED -I/tmp/gdal-2.3.0/port -I/usr/include  -DGDAL_COMPILATION -c -o ../o/gxfdataset.lo gxfdataset.cpp
make[2]: Entering directory `/tmp/gdal-2.3.0/frmts/gtiff'
(cd libgeotiff; make install-obj)
make[2]: Entering directory `/tmp/gdal-2.3.0/gcore/mdreader'
/bin/sh /tmp/gdal-2.3.0/libtool --mode=compile --silent --tag=CXX g++ -std=c++11 -I/tmp/gdal-2.3.0/port -I/tmp/gdal-2.3.0/gcore -I/tmp/gdal-2.3.0/alg -I/tmp/gdal-2.3.0/ogr -I/tmp/gdal-2.3.0/ogr/ogrsf_frmts -I/tmp/gdal-2.3.0/gnm -I/tmp/gdal-2.3.0/apps -DHAVE_AVX_AT_COMPILE_TIME -DHAVE_SSSE3_AT_COMPILE_TIME -DHAVE_SSE_AT_COMPILE_TIME -g -O2  -Wall -Wextra -Winit-self -Wunused-parameter -Wformat -Werror=format-security -Wno-format-nonliteral -Wlogical-op -Wshadow -Werror=vla -Wdate-time -Wnull-dereference -Wduplicated-cond -Wfloat-conversion -Wmissing-declarations -Wnon-virtual-dtor -Woverloaded-virtual -fno-operator-names -Wzero-as-null-pointer-constant  -DGNM_ENABLED -I/tmp/gdal-2.3.0/port -I/usr/include  -DGDAL_COMPILATION -c -o ../reader_digital_globe.lo reader_digital_globe.cpp
make[3]: Entering directory `/tmp/gdal-2.3.0/frmts/gtiff/libgeotiff'
/bin/sh /tmp/gdal-2.3.0/libtool --mode=compile --silent --tag=CC gcc -c -I../../port -I../libtiff -DGNM_ENABLED -I/tmp/gdal-2.3.0/port -I/usr/include  -DGDAL_COMPILATION -DHAVE_AVX_AT_COMPILE_TIME -DHAVE_SSSE3_AT_COMPILE_TIME -DHAVE_SSE_AT_COMPILE_TIME -g -O2  -Wall -Wdeclaration-after-statement -Wextra -Winit-self -Wunused-parameter -Wmissing-prototypes -Wmissing-declarations -Wformat -Werror=format-security -Wno-format-nonliteral -Wlogical-op -Wshadow -Werror=vla -Wdeclaration-after-statement -Wdate-time -Wnull-dereference -Wduplicated-cond -Wfloat-conversion -std=gnu89  -DDONT_DEPRECATE_SPRINTF xtiff.c -o ../../o/xtiff.lo
g++: error: unrecognized command line option ‘-Wdate-time’
g++: error: unrecognized command line option ‘-Wnull-dereference’
g++: error: unrecognized command line option ‘-Wduplicated-cond’
g++: error: unrecognized command line option ‘-Wfloat-conversion’
make[2]: *** [../o/gxfdataset.lo] Error 1
make[2]: Leaving directory `/tmp/gdal-2.3.0/frmts/gxf'
make[1]: *** [gxf-install-obj] Error 2
make[1]: *** Waiting for unfinished jobs....
/bin/sh /tmp/gdal-2.3.0/libtool --mode=compile --silent --tag=CXX g++ -std=c++11 -I/tmp/gdal-2.3.0/port -I/tmp/gdal-2.3.0/gcore -I/tmp/gdal-2.3.0/alg -I/tmp/gdal-2.3.0/ogr -I/tmp/gdal-2.3.0/ogr/ogrsf_frmts -I/tmp/gdal-2.3.0/gnm -I/tmp/gdal-2.3.0/apps -DHAVE_AVX_AT_COMPILE_TIME -DHAVE_SSSE3_AT_COMPILE_TIME -DHAVE_SSE_AT_COMPILE_TIME -g -O2  -Wall -Wextra -Winit-self -Wunused-parameter -Wformat -Werror=format-security -Wno-format-nonliteral -Wlogical-op -Wshadow -Werror=vla -Wdate-time -Wnull-dereference -Wduplicated-cond -Wfloat-conversion -Wmissing-declarations -Wnon-virtual-dtor -Woverloaded-virtual -fno-operator-names -Wzero-as-null-pointer-constant  -DGNM_ENABLED -I/tmp/gdal-2.3.0/port -I/usr/include  -DGDAL_COMPILATION -c -o ../reader_geo_eye.lo reader_geo_eye.cpp
g++: error: unrecognized command line option ‘-Wdate-time’
g++: error: unrecognized command line option ‘-Wnull-dereference’
g++: error: unrecognized command line option ‘-Wduplicated-cond’
g++: error: unrecognized command line option ‘-Wfloat-conversion’
make[2]: *** [../reader_digital_globe.lo] Error 1
make[2]: *** Waiting for unfinished jobs....
/bin/sh /tmp/gdal-2.3.0/libtool --mode=compile --silent --tag=CC gcc -c -I../../port -I../libtiff -DGNM_ENABLED -I/tmp/gdal-2.3.0/port -I/usr/include  -DGDAL_COMPILATION -DHAVE_AVX_AT_COMPILE_TIME -DHAVE_SSSE3_AT_COMPILE_TIME -DHAVE_SSE_AT_COMPILE_TIME -g -O2  -Wall -Wdeclaration-after-statement -Wextra -Winit-self -Wunused-parameter -Wmissing-prototypes -Wmissing-declarations -Wformat -Werror=format-security -Wno-format-nonliteral -Wlogical-op -Wshadow -Werror=vla -Wdeclaration-after-statement -Wdate-time -Wnull-dereference -Wduplicated-cond -Wfloat-conversion -std=gnu89  -DDONT_DEPRECATE_SPRINTF geo_free.c -o ../../o/geo_free.lo
g++: error: unrecognized command line option ‘-Wdate-time’
g++: error: unrecognized command line option ‘-Wnull-dereference’
g++: error: unrecognized command line option ‘-Wduplicated-cond’
g++: error: unrecognized command line option ‘-Wfloat-conversion’
make[2]: *** [../reader_geo_eye.lo] Error 1
make[2]: Leaving directory `/tmp/gdal-2.3.0/gcore/mdreader'
make[1]: *** [mdreader-target] Error 2
make[1]: Leaving directory `/tmp/gdal-2.3.0/gcore'
make: *** [core-target] Error 2
(cd libtiff; make install-obj)
make[3]: Entering directory `/tmp/gdal-2.3.0/frmts/gtiff/libtiff'
/bin/sh /tmp/gdal-2.3.0/libtool --mode=compile --silent --tag=CC gcc -c -I../../port -g -O2  -Wall -Wdeclaration-after-statement -Wextra -Winit-self -Wunused-parameter -Wmissing-prototypes -Wmissing-declarations -Wformat -Werror=format-security -Wno-format-nonliteral -Wlogical-op -Wshadow -Werror=vla -Wdeclaration-after-statement -Wdate-time -Wnull-dereference -Wduplicated-cond -Wfloat-conversion -std=gnu89  -DGNM_ENABLED -I/tmp/gdal-2.3.0/port -I/usr/include  -DGDAL_COMPILATION -DDONT_DEPRECATE_SPRINTF -DPIXARLOG_SUPPORT -DZIP_SUPPORT  -DJPEG_SUPPORT -DOJPEG_SUPPORT tif_aux.c -o ../../o/tif_aux.lo
g++: error: unrecognized command line option ‘-Wdate-time’
g++: error: unrecognized command line option ‘-Wnull-dereference’
g++: error: unrecognized command line option ‘-Wduplicated-cond’
g++: error: unrecognized command line option ‘-Wfloat-conversion’
make[1]: *** [o/gdalallregister.lo] Error 1
/bin/sh /tmp/gdal-2.3.0/libtool --mode=compile --silent --tag=CC gcc -c -I../../port -g -O2  -Wall -Wdeclaration-after-statement -Wextra -Winit-self -Wunused-parameter -Wmissing-prototypes -Wmissing-declarations -Wformat -Werror=format-security -Wno-format-nonliteral -Wlogical-op -Wshadow -Werror=vla -Wdeclaration-after-statement -Wdate-time -Wnull-dereference -Wduplicated-cond -Wfloat-conversion -std=gnu89  -DGNM_ENABLED -I/tmp/gdal-2.3.0/port -I/usr/include  -DGDAL_COMPILATION -DDONT_DEPRECATE_SPRINTF -DPIXARLOG_SUPPORT -DZIP_SUPPORT  -DJPEG_SUPPORT -DOJPEG_SUPPORT tif_close.c -o ../../o/tif_close.lo
/bin/sh /tmp/gdal-2.3.0/libtool --mode=compile --silent --tag=CC gcc -c -I../../port -I../libtiff -DGNM_ENABLED -I/tmp/gdal-2.3.0/port -I/usr/include  -DGDAL_COMPILATION -DHAVE_AVX_AT_COMPILE_TIME -DHAVE_SSSE3_AT_COMPILE_TIME -DHAVE_SSE_AT_COMPILE_TIME -g -O2  -Wall -Wdeclaration-after-statement -Wextra -Winit-self -Wunused-parameter -Wmissing-prototypes -Wmissing-declarations -Wformat -Werror=format-security -Wno-format-nonliteral -Wlogical-op -Wshadow -Werror=vla -Wdeclaration-after-statement -Wdate-time -Wnull-dereference -Wduplicated-cond -Wfloat-conversion -std=gnu89  -DDONT_DEPRECATE_SPRINTF geo_get.c -o ../../o/geo_get.lo
/bin/sh /tmp/gdal-2.3.0/libtool --mode=compile --silent --tag=CXX g++ -std=c++11 -I/tmp/gdal-2.3.0/port -I/tmp/gdal-2.3.0/gcore -I/tmp/gdal-2.3.0/alg -I/tmp/gdal-2.3.0/ogr -I/tmp/gdal-2.3.0/ogr/ogrsf_frmts -I/tmp/gdal-2.3.0/gnm -I/tmp/gdal-2.3.0/apps -DHAVE_AVX_AT_COMPILE_TIME -DHAVE_SSSE3_AT_COMPILE_TIME -DHAVE_SSE_AT_COMPILE_TIME -g -O2  -Wall -Wextra -Winit-self -Wunused-parameter -Wformat -Werror=format-security -Wno-format-nonliteral -Wlogical-op -Wshadow -Werror=vla -Wdate-time -Wnull-dereference -Wduplicated-cond -Wfloat-conversion -Wmissing-declarations -Wnon-virtual-dtor -Woverloaded-virtual -fno-operator-names -Wzero-as-null-pointer-constant  -I..  -I../jpeg -DHAVE_LIBJPEG   -DINTERNAL_LIBGEOTIFF -Ilibgeotiff -DINTERNAL_LIBTIFF -Ilibtiff -DBIGTIFF_SUPPORT -DGNM_ENABLED -I/tmp/gdal-2.3.0/port -I/usr/include  -DGDAL_COMPILATION -c -o ../o/geotiff.lo geotiff.cpp
g++: error: unrecognized command line option ‘-Wdate-time’
g++: error: unrecognized command line option ‘-Wnull-dereference’
g++: error: unrecognized command line option ‘-Wduplicated-cond’
g++: error: unrecognized command line option ‘-Wfloat-conversion’
make[2]: *** [../o/geotiff.lo] Error 1
make[2]: *** Waiting for unfinished jobs....
/bin/sh /tmp/gdal-2.3.0/libtool --mode=compile --silent --tag=CC gcc -c -I../../port -g -O2  -Wall -Wdeclaration-after-statement -Wextra -Winit-self -Wunused-parameter -Wmissing-prototypes -Wmissing-declarations -Wformat -Werror=format-security -Wno-format-nonliteral -Wlogical-op -Wshadow -Werror=vla -Wdeclaration-after-statement -Wdate-time -Wnull-dereference -Wduplicated-cond -Wfloat-conversion -std=gnu89  -DGNM_ENABLED -I/tmp/gdal-2.3.0/port -I/usr/include  -DGDAL_COMPILATION -DDONT_DEPRECATE_SPRINTF -DPIXARLOG_SUPPORT -DZIP_SUPPORT  -DJPEG_SUPPORT -DOJPEG_SUPPORT tif_codec.c -o ../../o/tif_codec.lo

[... similar lines without errors ...]

/bin/sh /tmp/gdal-2.3.0/libtool --mode=compile --silent --tag=CC gcc -c -I../../port -g -O2  -Wall -Wdeclaration-after-statement -Wextra -Winit-self -Wunused-parameter -Wmissing-prototypes -Wmissing-declarations -Wformat -Werror=format-security -Wno-format-nonliteral -Wlogical-op -Wshadow -Werror=vla -Wdeclaration-after-statement -Wdate-time -Wnull-dereference -Wduplicated-cond -Wfloat-conversion -std=gnu89  -DGNM_ENABLED -I/tmp/gdal-2.3.0/port -I/usr/include  -DGDAL_COMPILATION -DDONT_DEPRECATE_SPRINTF -DPIXARLOG_SUPPORT -DZIP_SUPPORT  -DJPEG_SUPPORT -DOJPEG_SUPPORT tif_zstd.c -o ../../o/tif_zstd.lo
make[3]: Leaving directory `/tmp/gdal-2.3.0/frmts/gtiff/libtiff'
make[2]: Leaving directory `/tmp/gdal-2.3.0/frmts/gtiff'
make[1]: *** [gtiff-install-obj] Error 2
make[1]: Leaving directory `/tmp/gdal-2.3.0/frmts'
make: *** [frmts-target] Error 2

I am a complete rookie in linux, so not sure how to move forward or interpret the error. I can successfully build 2.0 by following this guide, but attempts to build any more recent versions fail with output similar to the one below (whether I just adapt the guide above, follow this other one, or just try to config without specifying any options).

As requested in the comments, I have tried the following config options (following instructions linked above) - all seem to give the same error output when I make the directory:

./configure --with-static-proj4=/usr/local/lib --with-threads --with-pg=/usr/bin/pg_config
./configure --prefix=/usr/local --without-python
./configure --prefix=/usr/local
./configure
Andrea
  • 76
  • 8
  • Thanks for your comment. I tried 2.2.4 and 2.1.2 and both gave the same kind of errors printed above. – Andrea Jun 15 '18 at 16:27
  • »» `g++: error: unrecognized ... option -Wdate-time , -Wnull-dereference , -Wduplicated-cond, -Wfloat-conversion` «« : Which g++ version are you using ? ? – Knud Larsen Jun 15 '18 at 22:59
  • g++ (GCC) 4.8.5 20150623 (Red Hat 4.8.5-28) – Andrea Jun 16 '18 at 11:56
  • The current version is `gcc-4.8.5-28` : 25-Apr-2018. ... Can you update ? `# yum install gcc-c++` – Knud Larsen Jun 16 '18 at 14:08
  • Not available on yum - command returns: Package gcc-c++-4.8.5-1.22.amzn1.noarch already installed and latest version Nothing to do – Andrea Jun 16 '18 at 15:06

1 Answers1

1

g++: error: unrecognized ... option -Wdate-time , -Wnull-dereference , -Wduplicated-cond, -Wfloat-conversion

Seems to be a poorly configured / built gcc/g++ -4.8.5 . gdal-2.x.x was built OK with "any" g++ version ...

gdal-2.2.4-fedora/ ← gdal-2.2.4-fedora.tar.xz : gcc-7.3
gdal-2.3.0/     ← gdal_2.3.0+dfsg.orig.tar.xz : gcc-7.3
gdal-2.3.0/     ← gdal_2.3.0+dfsg.orig.tar.xz : gcc-4.8  (result packed with rpmbuild)
gdal-2.1.4-fedora/ ← gdal-2.1.4-fedora.tar.xz + patches: gcc-4.8 (+ most config options)
gdal-2.1.2/     ← gdal_2.1.2+dfsg.orig.tar.gz : gcc-6.3
gdal-2.1.2/     ← gdal_2.1.2+dfsg.orig.tar.gz : gcc-4.9
gdal-2.1.2/     ← gdal_2.1.2+dfsg.orig.tar.gz : gcc-4.8

BuildRequires, for the most options: # yum install armadillo-devel cfitsio-devel freexl-devel g2clib-static geos-devel hdf-devel hdf-static jasper-devel libgeotiff-devel libgta-devel libtiff-devel libwebp-devel giflib-devel netcdf-devel libdap-devel librx-devel ogdi-devel openjpeg2-devel poppler-devel proj-devel unixODBC-devel bash-completion json-c-devel perl-generators

Package example, "all-in-one" gdal2-2.3.0-1.el7.x86_64.rpm https://drive.google.com/file/d/1xCYT3m4Br4VmakaZsYK_mXhXhYNS8c7a/view?usp=sharing , configured with $ ./configure --prefix=/usr --libdir=/usr/lib64

Download, and install : # yum install Downloads/gdal2-2.3.0-1.el7.x86_64.rpm

P.S. : Possible config options with CentOS 7.5 (and maybe "Amazon AWS ec2 ?) are :

./configure \
    --prefix=/usr       \
    --libdir=/usr/lib64 \
    --with-armadillo    \
    --with-curl         \
    --with-cfitsio      \
    --with-expat        \
    --with-freexl       \
    --with-geos         \
    --with-geotiff=external \
    --with-gif          \
    --with-gta          \
    --with-hdf4         \
    --with-hdf5         \
    --with-jasper       \
    --with-java         \
    --with-jpeg         \
    --with-libjson-c    \
    --without-jpeg12    \
    --with-liblzma      \
    --with-libtiff=external \
    --with-libz         \
    --without-mdb       \
    --with-mysql        \
    --with-netcdf       \
    --with-odbc         \
    --with-ogdi         \
    --without-msg       \
    --with-openjpeg     \
    --with-pcraster     \
    --with-pg           \
    --with-png          \
    --with-poppler      \
    --with-sqlite3      \
    --with-threads      \
    --with-webp         \
    --with-xerces       \
    --enable-shared     \
    --with-perl         \
    --with-python
Knud Larsen
  • 5,753
  • 2
  • 14
  • 19
  • Thanks a lot for your help!! I get the following errors when I tried to install the binary you provided: Error: Package: gdal2-2.3.0-1.el7.x86_64 (/GDAL2-2.3.0-1.el7.x86_64) Requires: libxerces-c-3.1.so()(64bit) Error: Package: gdal2-2.3.0-1.el7.x86_64 (/GDAL2-2.3.0-1.el7.x86_64) Requires: libpng15.so.15()(64bit) Error: Package: gdal2-2.3.0-1.el7.x86_64 (/GDAL2-2.3.0-1.el7.x86_64) Requires: libcfitsio.so.2()(64bit) ...and a few more. – Andrea Jun 21 '18 at 15:12
  • The package is an example build with CentOS 7.5 . ... No guarantee that the used "BuildRequires" also are available with AWS ec2. ... Suggest: Use an alternative compiler https://stackoverflow.com/questions/47175706/how-to-install-gcc-4-9-2-on-rhel-7-4/47189915#47189915 ... to build gdal. – Knud Larsen Jun 21 '18 at 16:48