[gdal-dev] Building GDAL on Ubuntu 22.04

Eric Knudstrup eric at knudstrup.org
Fri Jul 12 23:38:20 PDT 2024


I'm still having trouble with getting it to build osgeo:


[ 96%] Generating osgeo/_gdal.cpython-310-x86_64-linux-gnu.so, 
osgeo/_gdalconst.cpython-310-x86_64-linux-gnu.so, 
osgeo/_gnm.cpython-310-x86_64-linux-gnu.so, 
osgeo/_ogr.cpython-310-x86_64-linux-gnu.so, 
osgeo/_osr.cpython-310-x86_64-linux-gnu.so, 
osgeo/_gdal_array.cpython-310-x86_64-linux-gnu.so
Using numpy 1.21.5
running build_ext
x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g 
-fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat 
-Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong 
-Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC 
-I/home/ek/gdal-3.9.1/build/port -I/home/ek/gdal-3.9.1/port 
-I/home/ek/gdal-3.9.1/build/gcore -I/home/ek/gdal-3.9.1/gcore 
-I/home/ek/gdal-3.9.1/alg -I/home/ek/gdal-3.9.1/ogr/ 
-I/home/ek/gdal-3.9.1/ogr/ogrsf_frmts -I/home/ek/gdal-3.9.1/gnm 
-I/home/ek/gdal-3.9.1/apps -I/usr/include/python3.10 
-I/usr/lib/python3/dist-packages/numpy/core/include -c 
gdal_python_cxx11_test.cpp -o gdal_python_cxx11_test.o
x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g 
-fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat 
-Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong 
-Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC 
-I/home/ek/gdal-3.9.1/build/port -I/home/ek/gdal-3.9.1/port 
-I/home/ek/gdal-3.9.1/build/gcore -I/home/ek/gdal-3.9.1/gcore 
-I/home/ek/gdal-3.9.1/alg -I/home/ek/gdal-3.9.1/ogr/ 
-I/home/ek/gdal-3.9.1/ogr/ogrsf_frmts -I/home/ek/gdal-3.9.1/gnm 
-I/home/ek/gdal-3.9.1/apps -I/usr/include/python3.10 
-I/usr/lib/python3/dist-packages/numpy/core/include -c 
gdal_python_cxx11_test.cpp -o gdal_python_cxx11_test.o -std=c++11
building 'osgeo._gdal' extension
creating build
creating build/temp.linux-x86_64-3.10
creating build/temp.linux-x86_64-3.10/extensions
x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g 
-fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat 
-Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong 
-Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC 
-I/home/ek/gdal-3.9.1/build/port -I/home/ek/gdal-3.9.1/port 
-I/home/ek/gdal-3.9.1/build/gcore -I/home/ek/gdal-3.9.1/gcore 
-I/home/ek/gdal-3.9.1/alg -I/home/ek/gdal-3.9.1/ogr/ 
-I/home/ek/gdal-3.9.1/ogr/ogrsf_frmts -I/home/ek/gdal-3.9.1/gnm 
-I/home/ek/gdal-3.9.1/apps -I/usr/include/python3.10 
-I/usr/lib/python3/dist-packages/numpy/core/include -c 
extensions/gdal_wrap.cpp -o 
build/temp.linux-x86_64-3.10/extensions/gdal_wrap.o
building 'osgeo._gdalconst' extension
x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g 
-fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat 
-Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong 
-Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC 
-I/home/ek/gdal-3.9.1/build/port -I/home/ek/gdal-3.9.1/port 
-I/home/ek/gdal-3.9.1/build/gcore -I/home/ek/gdal-3.9.1/gcore 
-I/home/ek/gdal-3.9.1/alg -I/home/ek/gdal-3.9.1/ogr/ 
-I/home/ek/gdal-3.9.1/ogr/ogrsf_frmts -I/home/ek/gdal-3.9.1/gnm 
-I/home/ek/gdal-3.9.1/apps -I/usr/include/python3.10 
-I/usr/lib/python3/dist-packages/numpy/core/include -c 
extensions/gdalconst_wrap.c -o 
build/temp.linux-x86_64-3.10/extensions/gdalconst_wrap.o
building 'osgeo._osr' extension
x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g 
-fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat 
-Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong 
-Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC 
-I/home/ek/gdal-3.9.1/build/port -I/home/ek/gdal-3.9.1/port 
-I/home/ek/gdal-3.9.1/build/gcore -I/home/ek/gdal-3.9.1/gcore 
-I/home/ek/gdal-3.9.1/alg -I/home/ek/gdal-3.9.1/ogr/ 
-I/home/ek/gdal-3.9.1/ogr/ogrsf_frmts -I/home/ek/gdal-3.9.1/gnm 
-I/home/ek/gdal-3.9.1/apps -I/usr/include/python3.10 
-I/usr/lib/python3/dist-packages/numpy/core/include -c 
extensions/osr_wrap.cpp -o 
build/temp.linux-x86_64-3.10/extensions/osr_wrap.o
building 'osgeo._ogr' extension
x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g 
-fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat 
-Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong 
-Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC 
-I/home/ek/gdal-3.9.1/build/port -I/home/ek/gdal-3.9.1/port 
-I/home/ek/gdal-3.9.1/build/gcore -I/home/ek/gdal-3.9.1/gcore 
-I/home/ek/gdal-3.9.1/alg -I/home/ek/gdal-3.9.1/ogr/ 
-I/home/ek/gdal-3.9.1/ogr/ogrsf_frmts -I/home/ek/gdal-3.9.1/gnm 
-I/home/ek/gdal-3.9.1/apps -I/usr/include/python3.10 
-I/usr/lib/python3/dist-packages/numpy/core/include -c 
extensions/ogr_wrap.cpp -o 
build/temp.linux-x86_64-3.10/extensions/ogr_wrap.o
building 'osgeo._gnm' extension
x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g 
-fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat 
-Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong 
-Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC 
-I/home/ek/gdal-3.9.1/build/port -I/home/ek/gdal-3.9.1/port 
-I/home/ek/gdal-3.9.1/build/gcore -I/home/ek/gdal-3.9.1/gcore 
-I/home/ek/gdal-3.9.1/alg -I/home/ek/gdal-3.9.1/ogr/ 
-I/home/ek/gdal-3.9.1/ogr/ogrsf_frmts -I/home/ek/gdal-3.9.1/gnm 
-I/home/ek/gdal-3.9.1/apps -I/usr/include/python3.10 
-I/usr/lib/python3/dist-packages/numpy/core/include -c 
extensions/gnm_wrap.cpp -o 
build/temp.linux-x86_64-3.10/extensions/gnm_wrap.o
building 'osgeo._gdal_array' extension
x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g 
-fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat 
-Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong 
-Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC 
-I/home/ek/gdal-3.9.1/build/port -I/home/ek/gdal-3.9.1/port 
-I/home/ek/gdal-3.9.1/build/gcore -I/home/ek/gdal-3.9.1/gcore 
-I/home/ek/gdal-3.9.1/alg -I/home/ek/gdal-3.9.1/ogr/ 
-I/home/ek/gdal-3.9.1/ogr/ogrsf_frmts -I/home/ek/gdal-3.9.1/gnm 
-I/home/ek/gdal-3.9.1/apps -I/usr/include/python3.10 
-I/usr/lib/python3/dist-packages/numpy/core/include -c 
extensions/gdal_array_wrap.cpp -o 
build/temp.linux-x86_64-3.10/extensions/gdal_array_wrap.o
error: command 'x86_64-linux-gnu-gcc' failed: No such file or directory
CMake Error at build_ext.cmake:5 (message):
   setup.py bdist_wheel failed


gmake[2]: *** [swig/python/CMakeFiles/python_binding.dir/build.make:405: 
swig/python/osgeo/_gdal.cpython-310-x86_64-linux-gnu.so] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:9397: 
swig/python/CMakeFiles/python_binding.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2



More information about the gdal-dev mailing list