0

all:

I successfully configured and built gdal-3.4.3, but failed to install it on Ubuntu 22.04, with gcc-11.2,

My ENV:

➜  ~ uname -r  
5.15.0-27-generic
➜  ~ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04 LTS
Release: 22.04
Codename: jammy
➜  ~ gcc --version
gcc (Ubuntu 11.2.0-19ubuntu1) 11.2.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

my installation outcome:

Installing with make install...

========================= Installation results ===========================
/usr/local/bin/cmake -S....../GDAL -B....../GDAL/build --check-build-system CMakeFiles/Makefile.cmake 0
/usr/local/bin/cmake -E cmake_progress_start ....../GDAL/build/CMakeFiles ....../GDAL/build//CMakeFiles/progress.marks
make  -f CMakeFiles/Makefile2 all
make[1]: Entering directory '....../GDAL/build'
make  -f CMakeFiles/generate_gdal_version_h.dir/build.make CMakeFiles/generate_gdal_version_h.dir/depend
make[2]: Entering directory '....../GDAL/build'
cd ....../GDAL/build && /usr/local/bin/cmake -E cmake_depends "Unix Makefiles" ....../GDAL ....../GDAL ....../GDAL/build ....../GDAL/build ....../GDAL/build/CMakeFiles/generate_gdal_version_h.dir/DependInfo.cmake --color=
make[2]: Leaving directory '....../GDAL/build'
make  -f CMakeFiles/generate_gdal_version_h.dir/build.make CMakeFiles/generate_gdal_version_h.dir/build
make[2]: Entering directory '....../GDAL/build'
/usr/local/bin/cmake -DSOURCE_DIR=....../GDAL -DBINARY_DIR=....../GDAL/build -DGDAL_SHA1SUM= -DGDAL_RELEASE_DATE= -P ....../GDAL/cmake/helpers/generate_gdal_version_h.cmake
-- Found Git: /usr/bin/git (found version "2.34.1")
CMake Error at ....../GDAL/cmake/helpers/generate_gdal_version_h.cmake:27 (string):
  string sub-command SUBSTRING requires four arguments.


make[2]: *** [CMakeFiles/generate_gdal_version_h.dir/build.make:73: CMakeFiles/generate_gdal_version_h] Error 1
make[2]: Leaving directory '....../GDAL/build'
make[1]: *** [CMakeFiles/Makefile2:4367: CMakeFiles/generate_gdal_version_h.dir/all] Error 2
make[1]: Leaving directory '....../GDAL/build'
make: *** [Makefile:149: all] Error 2

****  Installation failed. Aborting package creation.

Restoring overwritten files from backup...OK

Cleaning up...OK

Bye.

Actually, line 27 of file ....../GDAL/cmake/helpers/generate_gdal_version_h.cmake is string(SUBSTRING ${GDAL_GIT_HASH} 0 10 REV), it looks okay to me...

Did anybody meet the same issue?

Pei JIA
  • 158
  • 2
  • 10
  • Apparently `GDAL_GIT_HASH` is empty, hence the error. My guess would be you are trying to build it not in a git repository. – ixSci May 12 '22 at 05:29
  • GDAL 3.5.0 is out and one of the main areas of improvement is the cmake build which is now the default build – mmomtchev May 18 '22 at 10:06

0 Answers0