Giter VIP home page Giter VIP logo

gdal-grass's Issues

Fails to build with GDAL 3.8.0

As reported in Debian Bug #1055602:

Your package FTBFS with GDAL 3.8.0 from experimental:

g++ -Wall -fPIC -DUSE_CPL -DGRASS_GISBASE=\"/usr/lib/grass83\" -I/usr/include/gdal -I/usr/lib/grass83/include -I/usr/include/postgresql -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -ffile-prefix-map=/build/libgdal-grass-1.0.2=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -c -o ogrgrasslayer.o ogrgrasslayer.cpp
In file included from /usr/include/gdal/ogr_geometry.h:36,
                 from /usr/include/gdal/ogr_feature.h:36,
                 from /usr/include/gdal/ogrsf_frmts.h:35,
                 from ogrgrass.h:33,
                 from ogrgrassdriver.cpp:29:
/usr/include/gdal/cpl_json.h:97:36: error: expected ')' before 'nVal'
   97 |     explicit CPLJSONObject(uint64_t nVal);
      |                           ~        ^~~~~
      |                                    )
/usr/include/gdal/cpl_json.h:119:41: error: 'uint64_t' has not been declared
  119 |     void Add(const std::string &osName, uint64_t nValue);
      |                                         ^~~~~~~~
/usr/include/gdal/cpl_json.h:119:10: error: 'void CPLJSONObject::Add(const std::string&, int)' cannot be overloaded with 'void CPLJSONObject::Add(const std::string&, int)'
  119 |     void Add(const std::string &osName, uint64_t nValue);
      |          ^~~
/usr/include/gdal/cpl_json.h:117:10: note: previous declaration 'void CPLJSONObject::Add(const std::string&, int)'
  117 |     void Add(const std::string &osName, int nValue);
      |          ^~~
/usr/include/gdal/cpl_json.h:131:41: error: 'uint64_t' has not been declared
  131 |     void Set(const std::string &osName, uint64_t nValue);
      |                                         ^~~~~~~~
/usr/include/gdal/cpl_json.h:131:10: error: 'void CPLJSONObject::Set(const std::string&, int)' cannot be overloaded with 'void CPLJSONObject::Set(const std::string&, int)'
  131 |     void Set(const std::string &osName, uint64_t nValue);
      |          ^~~
/usr/include/gdal/cpl_json.h:129:10: note: previous declaration 'void CPLJSONObject::Set(const std::string&, int)'
  129 |     void Set(const std::string &osName, int nValue);
      |          ^~~
/usr/include/gdal/cpl_json.h:245:14: error: 'uint64_t' has not been declared
  245 |     void Add(uint64_t nValue);
      |              ^~~~~~~~
/usr/include/gdal/cpl_json.h:245:10: error: 'void CPLJSONArray::Add(int)' cannot be overloaded with 'void CPLJSONArray::Add(int)'
  245 |     void Add(uint64_t nValue);
      |          ^~~
/usr/include/gdal/cpl_json.h:243:10: note: previous declaration 'void CPLJSONArray::Add(int)'
  243 |     void Add(int nValue);
      |          ^~~
In file included from /usr/include/gdal/ogr_geometry.h:36,
                 from /usr/include/gdal/ogr_feature.h:36,
                 from /usr/include/gdal/ogrsf_frmts.h:35,
                 from ogrgrass.h:33,
                 from ogrgrassdatasource.cpp:30:
/usr/include/gdal/cpl_json.h:97:36: error: expected ')' before 'nVal'
   97 |     explicit CPLJSONObject(uint64_t nVal);
      |                           ~        ^~~~~
      |                                    )
/usr/include/gdal/cpl_json.h:119:41: error: 'uint64_t' has not been declared
  119 |     void Add(const std::string &osName, uint64_t nValue);
      |                                         ^~~~~~~~
/usr/include/gdal/cpl_json.h:119:10: error: 'void CPLJSONObject::Add(const std::string&, int)' cannot be overloaded with 'void CPLJSONObject::Add(const std::string&, int)'
  119 |     void Add(const std::string &osName, uint64_t nValue);
      |          ^~~
/usr/include/gdal/cpl_json.h:117:10: note: previous declaration 'void CPLJSONObject::Add(const std::string&, int)'
  117 |     void Add(const std::string &osName, int nValue);
      |          ^~~
/usr/include/gdal/cpl_json.h:131:41: error: 'uint64_t' has not been declared
  131 |     void Set(const std::string &osName, uint64_t nValue);
      |                                         ^~~~~~~~ 
/usr/include/gdal/cpl_json.h:131:10: error: 'void CPLJSONObject::Set(const std::string&, int)' cannot be overloaded with 'void CPLJSONObject::Set(const std::string&, int)'
  131 |     void Set(const std::string &osName, uint64_t nValue);
      |          ^~~                        
/usr/include/gdal/cpl_json.h:129:10: note: previous declaration 'void CPLJSONObject::Set(const std::string&, int)'
  129 |     void Set(const std::string &osName, int nValue);
      |          ^~~                             
/usr/include/gdal/cpl_json.h:245:14: error: 'uint64_t' has not been declared
  245 |     void Add(uint64_t nValue);
      |              ^~~~~~~~
/usr/include/gdal/cpl_json.h:245:10: error: 'void CPLJSONArray::Add(int)' cannot be overloaded with 'void CPLJSONArray::Add(int)'
  245 |     void Add(uint64_t nValue);
      |          ^~~
/usr/include/gdal/cpl_json.h:243:10: note: previous declaration 'void CPLJSONArray::Add(int)'
  243 |     void Add(int nValue);
      |          ^~~
In file included from /usr/include/gdal/ogr_geometry.h:36,
                 from /usr/include/gdal/ogr_feature.h:36,
                 from /usr/include/gdal/ogrsf_frmts.h:35,
                 from ogrgrass.h:33,
                 from ogrgrasslayer.cpp:31:
/usr/include/gdal/cpl_json.h:97:36: error: expected ')' before 'nVal'
   97 |     explicit CPLJSONObject(uint64_t nVal);
      |                           ~        ^~~~~
      |                                    )
/usr/include/gdal/cpl_json.h:119:41: error: 'uint64_t' has not been declared
  119 |     void Add(const std::string &osName, uint64_t nValue);
      |                                         ^~~~~~~~
/usr/include/gdal/cpl_json.h:119:10: error: 'void CPLJSONObject::Add(const std::string&, int)' cannot be overloaded with 'void CPLJSONObject::Add(const std::string&, int)'
  119 |     void Add(const std::string &osName, uint64_t nValue);
      |          ^~~
/usr/include/gdal/cpl_json.h:117:10: note: previous declaration 'void CPLJSONObject::Add(const std::string&, int)'
  117 |     void Add(const std::string &osName, int nValue);
      |          ^~~
/usr/include/gdal/cpl_json.h:131:41: error: 'uint64_t' has not been declared
  131 |     void Set(const std::string &osName, uint64_t nValue);
      |                                         ^~~~~~~~
/usr/include/gdal/cpl_json.h:131:10: error: 'void CPLJSONObject::Set(const std::string&, int)' cannot be overloaded with 'void CPLJSONObject::Set(const std::string&, int)'
  131 |     void Set(const std::string &osName, uint64_t nValue);
      |          ^~~
/usr/include/gdal/cpl_json.h:129:10: note: previous declaration 'void CPLJSONObject::Set(const std::string&, int)'
  129 |     void Set(const std::string &osName, int nValue);
      |          ^~~
/usr/include/gdal/cpl_json.h:245:14: error: 'uint64_t' has not been declared
  245 |     void Add(uint64_t nValue);
      |              ^~~~~~~~
/usr/include/gdal/cpl_json.h:245:10: error: 'void CPLJSONArray::Add(int)' cannot be overloaded with 'void CPLJSONArray::Add(int)'
  245 |     void Add(uint64_t nValue);
      |          ^~~
/usr/include/gdal/cpl_json.h:243:10: note: previous declaration 'void CPLJSONArray::Add(int)'
  243 |     void Add(int nValue);
      |          ^~~
ogrgrassdriver.cpp: In function 'void RegisterOGRGRASS()':
ogrgrassdriver.cpp:99:39: warning: 'static OGRSFDriverRegistrar* OGRSFDriverRegistrar::GetRegistrar()' is deprecated [-Wdeprecated-declarations]
   99 |     OGRSFDriverRegistrar::GetRegistrar()->RegisterDriver( poDriver );
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
/usr/include/gdal/ogrsf_frmts.h:592:34: note: declared here
  592 |     static OGRSFDriverRegistrar *GetRegistrar()
      |                                  ^~~~~~~~~~~~
ogrgrassdriver.cpp:99:57: warning: 'void OGRSFDriverRegistrar::RegisterDriver(OGRSFDriver*)' is deprecated [-Wdeprecated-declarations]
   99 |     OGRSFDriverRegistrar::GetRegistrar()->RegisterDriver( poDriver );
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
/usr/include/gdal/ogrsf_frmts.h:596:10: note: declared here
  596 |     void RegisterDriver(OGRSFDriver *poDriver)
      |          ^~~~~~~~~~~~~~

The full buildlog is attached.

libgdal-grass_1.0.2-7_amd64.build

cmake build issue on Fedora 38: Could NOT find PROJ (missing: PROJINC)

I have tried to compile the current driver version on my Fedora 38 box:

cmake .. -DAUTOLOAD_DIR=/usr/lib64/gdalplugin \
        -DGDAL_CONFIG_PREFER_PATH=/usr/bin/   -DGRASS_BIN_PREFER_PATH=$HOME/bin/
-- Found GDAL: /usr/lib64/libgdal.so (3.6.4)
-- Found GRASS_GISBASE: /home/mneteler/software/grass83/dist.x86_64-pc-linux-gnu (8.3.2dev)
-- Could NOT find PROJ (missing: PROJINC) 
-- Using /usr/lib64/gdalplugin as GDAL shared library autoload directory
-- Configuring done (0.5s)
-- Generating done (0.0s)
CMake Warning:
  Manually-specified variables were not used by the project:

    GDAL_CONFIG_PREFER_PATH

-- Build files have been written to: /home/mneteler/software/gdal-grass/build

Since I can successfully compile GRASS GIS on the same machine (start script in $HOME/bin/) I am a bit lost...

cd ~/software/gdal-grass
ag PROJINC
CMakeLists.txt
57:                     ${GRASS_INCLUDE} ${PROJINC})
66:                    ${GRASS_INCLUDE} ${PROJINC})

cmake/FindPROJ.cmake
10:set(PROJINC "")
12:get_grass_platform_var("${GRASS_GISBASE}/include/Make/Platform.make" "PROJINC"
13:                       PROJINC)
15:if(NOT "${PROJINC}" STREQUAL "")
16:  string(REGEX REPLACE "-I(.*)" "\\1" PROJINC "${PROJINC}")
20:find_package_handle_standard_args(PROJ REQUIRED_VARS PROJINC)

... seems to fail on my system.

Here my setup:

which grass 
~/bin/grass

grass --config
x86_64-pc-linux-gnu
./configure --with-cxx --enable-largefile --with-proj-share=/usr/share/proj --with-gdal=/usr/bin/gdal-config --with-geos --with-sqlite --with-nls --with-zstd --with-pdal --with-cairo --with-cairo-ldflags=-lfontconfig --with-freetype --with-freetype-includes=/usr/include/freetype2 --with-fftw --with-postgres --with-postgres-includes=/usr/include/pgsql --with-blas --with-blas-includes=/usr/include/atlas-x86_64-base/ --with-lapack --with-lapack-includes=/usr/include/atlas-x86_64-base/ --with-openmp --with-netcdf --without-bzlib --without-mysql --without-odbc CFLAGS=-g -Wall -Wstringop-truncation -Wshadow -Wlogical-op -Werror-implicit-function-declaration -fPIC -fno-common -fno-omit-frame-pointer -fexceptions -Wextra -Wunused -Wreturn-type -Wfatal-errors -march=native -std=gnu99 -fexceptions -fstack-protector -m64 -fdiagnostics-color LDFLAGS=-Wl,--no-undefined -Wl,-z,now CXXFLAGS=-g -Wall
gcc
/home/mneteler/software/grass83/dist.x86_64-pc-linux-gnu
/home/mneteler/software/grass83/dist.x86_64-pc-linux-gnu/etc/python
08018e34b2
8.3.2dev
2023-10-25T07:54:00+00:00

Ideas welcome :-)

configure should detect if GRASS is compiled with Postgres

If GRASS is compiled with PG, then it is necessary to provide PG includes and linking parameters also for gdal-grass as include/grass/config.h then has #define HAVE_POSTGRES 1 affecting include/grass/vect/dig_structs.h

Symptom for a reference:
include/grass/vect/dig_structs.h:31:10: fatal error: libpq-fe.h: No such file or directory

undefined GDAL symbols in ogr/gdal_GRASS.so

GDAL-GRASS 1.0.0 (from release tarball)
GDAL 3.5.0 (from git release branch)
GRASS 8.2.0 (from release tarball)
QGIS 3.24.3 (from git release branch)

gdalinfo --formats outputs:

ERROR 1: /usr/lib/gdalplugins/gdal_GRASS.so: undefined symbol: GDALRegisterMe
ERROR 1: /usr/lib/gdalplugins/gdal_GRASS.so: undefined symbol: GDALRegister_GRASS
ERROR 1: /usr/lib/gdalplugins/ogr_GRASS.so: undefined symbol: GDALRegisterMe
ERROR 1: /usr/lib/gdalplugins/ogr_GRASS.so: undefined symbol: RegisterOGRGRASS

QGIS outputs:

ERROR 1: /usr/lib/gdalplugins/gdal_GRASS.so: undefined symbol: GDALRegisterMe
ERROR 1: /usr/lib/gdalplugins/gdal_GRASS.so: undefined symbol: GDALRegister_GRASS
ERROR 1: /usr/lib/gdalplugins/ogr_GRASS.so: undefined symbol: GDALRegisterMe
ERROR 1: /usr/lib/gdalplugins/ogr_GRASS.so: undefined symbol: RegisterOGRGRASS
ERROR 1: /usr/lib/gdalplugins/gdal_GRASS.so: undefined symbol: GDALRegisterMe
ERROR 1: /usr/lib/gdalplugins/gdal_GRASS.so: undefined symbol: GDALRegister_GRASS
ERROR 1: /usr/lib/gdalplugins/ogr_GRASS.so: undefined symbol: GDALRegisterMe
ERROR 1: /usr/lib/gdalplugins/ogr_GRASS.so: undefined symbol: RegisterOGRGRASS

GRASS outputs:

ERROR 1: /usr/lib/gdalplugins/gdal_GRASS.so: undefined symbol: GDALRegisterMe
ERROR 1: /usr/lib/gdalplugins/gdal_GRASS.so: undefined symbol: GDALRegister_GRASS
ERROR 1: /usr/lib/gdalplugins/ogr_GRASS.so: undefined symbol: GDALRegisterMe
ERROR 1: /usr/lib/gdalplugins/ogr_GRASS.so: undefined symbol: RegisterOGRGRASS

Fails to build with GDAL 3.6.0

gdal-grass fails to build with GDAL 3.6.0-rc1:

g++ -Wall -fPIC -DUSE_CPL -DGRASS_GISBASE=\"/usr/lib/grass82\" -I/usr/include/gdal -I/usr/lib/grass82/include -I/usr/include/postgresql -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -ffile-prefix-map=/build/libgdal-grass-1.0.1=. -fstack-protector-strong -Wformat -Werror=format-security -c -o grass.o grass.cpp
g++ -Wall -fPIC -DUSE_CPL -DGRASS_GISBASE=\"/usr/lib/grass82\" -I/usr/include/gdal -I/usr/lib/grass82/include -I/usr/include/postgresql -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -ffile-prefix-map=/build/libgdal-grass-1.0.1=. -fstack-protector-strong -Wformat -Werror=format-security -c -o ogrgrassdriver.o ogrgrassdriver.cpp
g++ -Wall -fPIC -DUSE_CPL -DGRASS_GISBASE=\"/usr/lib/grass82\" -I/usr/include/gdal -I/usr/lib/grass82/include -I/usr/include/postgresql -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -ffile-prefix-map=/build/libgdal-grass-1.0.1=. -fstack-protector-strong -Wformat -Werror=format-security -c -o ogrgrassdatasource.o ogrgrassdatasource.cpp
grass.cpp:106:17: error: 'const char* GRASSDataset::_GetProjectionRef()' marked 'override', but does not override
  106 |     const char *_GetProjectionRef(void) override;
      |                 ^~~~~~~~~~~~~~~~~
grass.cpp: In member function 'virtual const OGRSpatialReference* GRASSDataset::GetSpatialRef() const':
grass.cpp:108:16: error: 'GetSpatialRefFromOldGetProjectionRef' was not declared in this scope
  108 |         return GetSpatialRefFromOldGetProjectionRef();
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ogrgrassdriver.cpp: In function 'void RegisterOGRGRASS()':
ogrgrassdriver.cpp:99:39: warning: 'static OGRSFDriverRegistrar* OGRSFDriverRegistrar::GetRegistrar()' is deprecated [-Wdeprecated-declarations]
   99 |     OGRSFDriverRegistrar::GetRegistrar()->RegisterDriver( poDriver );
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
In file included from ogrgrass.h:33,
                 from ogrgrassdriver.cpp:29:
/usr/include/gdal/ogrsf_frmts.h:491:34: note: declared here
  491 |     static OGRSFDriverRegistrar *GetRegistrar() OGR_DEPRECATED("Use GDALDriverManager class instead");
      |                                  ^~~~~~~~~~~~
ogrgrassdriver.cpp:99:57: warning: 'void OGRSFDriverRegistrar::RegisterDriver(OGRSFDriver*)' is deprecated [-Wdeprecated-declarations]
   99 |     OGRSFDriverRegistrar::GetRegistrar()->RegisterDriver( poDriver );
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
/usr/include/gdal/ogrsf_frmts.h:494:17: note: declared here
  494 |     void        RegisterDriver( OGRSFDriver * poDriver ) OGR_DEPRECATED("Use GDALDriverManager class instead");
      |                 ^~~~~~~~~~~~~~

Full buildlog: libgdal-grass_1.0.1-2_amd64.txt

Undefined symbol runtime error w/GDAL 3.5.1

Compiles fine against GDAL 3.5.1, but hitting undefined symbol errors with any kind of execution, which go away if I simply remove the GRASS plugins. My guess is a simple update is req to reflect changes in 3.5.1

  gdalinfo --version
    ERROR 1: /discover/swdev/sacs/sw/base/gcc12-3.5.1/gdal-3.5.1/lib/gdalplugins/ogr_GRASS.so: undefined symbol: _ZNK11GDALDataset19GetFieldDomainNamesB5cxx11EPKPKc
    ERROR 1: /discover/swdev/sacs/sw/base/gcc12-3.5.1/gdal-3.5.1/lib/gdalplugins/ogr_GRASS.so: undefined symbol: _ZNK11GDALDataset19GetFieldDomainNamesB5cxx11EPKPKc
    ERROR 1: /discover/swdev/sacs/sw/base/gcc12-3.5.1/gdal-3.5.1/lib/gdalplugins/gdal_GRASS.so: undefined symbol: _ZNK11GDALDataset19GetFieldDomainNamesB5cxx11EPKPKc
    ERROR 1: /discover/swdev/sacs/sw/base/gcc12-3.5.1/gdal-3.5.1/lib/gdalplugins/gdal_GRASS.so: undefined symbol: _ZNK11GDALDataset19GetFieldDomainNamesB5cxx11EPKPKc
    GDAL 3.5.1, released 2022/06/30

Time for new release?

A neat change log has accumulated since the 1.0.2 release: 1.0.2...main
Perhaps the biggest change is the added support of CMake.
Maybe it is time for a new release: 1.0.3?

There is a pending pull request #37, which I'm not sure if it should go to a patch release or rather to 1.1.0?

A future 1.1.0 release could possibly also be a the first release with CMake only (ie. dropping Autotools configure) โ€“ to simplify maintenance. If this proposition is agreed upon, I'd suggest we deprecate Autotools configure with the 1.0.3 release and then create a 1.0 release branch.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

This repository currently has no open or pending branches.

Detected dependencies

github-actions
.github/workflows/publish.yml
  • actions/checkout v4
  • softprops/action-gh-release v2
.github/workflows/ubuntu.yml
  • actions/checkout v4
  • actions/setup-python v5

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.