[gdal-dev] Error building GDAL 3.8.3: Installed GEOS not found during build

Eric Patton eric.r.patton at pm.me
Tue Jan 16 09:20:48 PST 2024


Hi Evan,

I tried running 'cmake .. "-UGEOS*"' followed by 'cmake --build .', but received the same error:

CMakeFiles/GDAL.dir/build.make:2687: *** target pattern contains no '%'. Stop.
make[1]: *** [CMakeFiles/Makefile2:5005: CMakeFiles/GDAL.dir/all] Error 2make: *** [Makefile:141: all] Error 2

$ grep -i GEOS CMakeCache.txt
//Config file name for GEOS
GDAL_CHECK_PACKAGE_GEOS_NAMES:STRING=GEOS
//Target name candidates for GEOS
GDAL_CHECK_PACKAGE_GEOS_TARGETS:STRING=GEOS::geos_c;GEOS::GEOS
//Set ON to build Geospatial PDF format
//Set ON to use GEOS
GDAL_USE_GEOS:BOOL=ON
//The directory containing a CMake configuration file for GEOS.
GEOS_DIR:PATH=/usr/local/geos-3.12.1/cmake
pkgcfg_lib_PC_SPATIALITE_geos_c:FILEPATH=/usr/local/lib/libgeos_c.so
//ADVANCED property for variable: GDAL_CHECK_PACKAGE_GEOS_NAMES
GDAL_CHECK_PACKAGE_GEOS_NAMES-ADVANCED:INTERNAL=1
//ADVANCED property for variable: GDAL_CHECK_PACKAGE_GEOS_TARGETS
GDAL_CHECK_PACKAGE_GEOS_TARGETS-ADVANCED:INTERNAL=1
PC_SPATIALITE_LDFLAGS:INTERNAL=-lspatialite;-lminizip;-lrttopo;-lfreexl;-lproj;-lsqlite3;-lz;-lsqlite3;-lgeos_c;-lxml2;-lm
PC_SPATIALITE_LIBRARIES:INTERNAL=spatialite;minizip;rttopo;freexl;proj;sqlite3;z;sqlite3;geos_c;xml2;m
PC_SPATIALITE_STATIC_LDFLAGS:INTERNAL=-lspatialite;-lminizip;-lrttopo;-lfreexl;-lproj;-lsqlite3;-lz;-lsqlite3;-lgeos_c;-lxml2;-lm
PC_SPATIALITE_STATIC_LIBRARIES:INTERNAL=spatialite;minizip;rttopo;freexl;proj;sqlite3;z;sqlite3;geos_c;xml2;m
//ADVANCED property for variable: pkgcfg_lib_PC_SPATIALITE_geos_cpkgcfg_lib_PC_SPATIALITE_geos_c-ADVANCED:INTERNAL=1

Thanks,

~ Eric.

On Tuesday, 16 January 2024 at 12:23, Even Rouault <even.rouault at spatialys.com> wrote:

> Eric,
>
> What is the output of "grep -i GEOS CMakeCache.txt" ?
>
> Also retry with cmake .. "-UGEOS*" to make sure any potential old GEOS variables are reset
>
> Even
>
> Le 16/01/2024 à 17:20, Eric Patton via gdal-dev a écrit :
>
>> I am running into an error while building gdal 3.8.3 from source - it seems GEOS (version 3.12.1) is not being found during the build, despite that fact it was completely installed from source with no errors. I'm using LInux Mint 20.3.
>>
>> # GDAL build commands used:
>>
>> $ cmake -DCMAKE_BUILD_TYPE=Release ..
>> (No obvious errors in output, GEOS seems to be located):
>>
>> -- The following RECOMMENDED packages have been found:
>> * GEOS
>> Geometry Engine - Open Source (GDAL core dependency)
>>
>> $ cmake --build .
>> <snip>
>> [ 95%] Built target gcore_mdreader
>> CMakeFiles/GDAL.dir/build.make:2687: *** target pattern contains no '%'. Stop.
>> make[1]: *** [CMakeFiles/Makefile2:5005: CMakeFiles/GDAL.dir/all] Error 2
>> make: *** [Makefile:141: all] Error 2
>>
>> # Line 2687 of /usr/local/gdal-3.8.3/build/CMakefiles/GDAL.dir:
>> libgdal.so.34.3.8.3: GEOS::geos_c-NOTFOUND
>>
>> # But that's strange:
>> $ which geos-config
>> /usr/local/bin/geos-config
>>
>> $ geos-config --version
>> 3.12.1
>>
>> # Location of GEOS include dir:
>>
>> $ cd /usr
>> $ find . -name "geos_c.h"
>>
>> ./local/geos-3.12.1/_build/capi/geos_c.h
>> ./local/include/geos_c.h
>>
>> # Location of GEOS_LIBRARY:
>>
>> $ cd /usr
>> $ find . -name "*libgeos_c*"
>>
>> ./local/lib/libgeos_c.so.1
>> ./local/lib/libgeos_c.so.1.18.1
>> ./local/lib/libgeos_c.so
>> ./local/geos-3.12.1/_build/lib/libgeos_c.so.1
>> ./local/geos-3.12.1/_build/lib/libgeos_c.so.1.18.1
>> ./local/geos-3.12.1/_build/lib/libgeos_c.so
>>
>> $ uname -a:
>>
>> Linux FieldBathy 5.15.0-91-generic #101~20.04.1-Ubuntu SMP Thu Nov 16 14:22:28 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
>> Please let me know if there's anything else I can post to help diagnose the error, thanks.
>>
>> --
>> Eric Patton
>>
>> _______________________________________________
>> gdal-dev mailing list
>> gdal-dev at lists.osgeo.org
>>
>> https://lists.osgeo.org/mailman/listinfo/gdal-dev
>
> --
> http://www.spatialys.com
> My software is free, but my time generally not.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20240116/de79671a/attachment-0001.htm>


More information about the gdal-dev mailing list