Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OGDI drivers fail to build on Debian 11 Bullseye (missing rpc/rpc.h) #6520

Closed
zedrdave opened this issue Oct 13, 2022 · 7 comments
Closed

OGDI drivers fail to build on Debian 11 Bullseye (missing rpc/rpc.h) #6520

zedrdave opened this issue Oct 13, 2022 · 7 comments

Comments

@zedrdave
Copy link

zedrdave commented Oct 13, 2022

Encountering issue similar to the one described in #4817

Expected behavior and actual behavior.

When building from head using cmake.
Expect: all drivers to build
Actual: OGDI driver fails to build because rpc/rpc.h is not found:

In file included from /home/dave/gdal/ogr/ogrsf_frmts/ogdi/ogrogdi.h:40,
                 from /home/dave/gdal/ogr/ogrsf_frmts/ogdi/ogrogdidatasource.cpp:30:
/usr/include/ogdi/ecs.h:9:10: fatal error: rpc/rpc.h: No such file or directory
    9 | #include <rpc/rpc.h>
      |          ^~~~~~~~~~~

Ogdi is installed and correctly detected by pkg-config:

> pkg-config ogdi --modversion
4.1.0

(but, as expected, no longer contains rpc/rpc.h)

Steps to reproduce the problem.

git pull
mkdir build
cd build
cmake -S .. -B .
make

Operating system

Linux 5.10.0-18-amd64 #1 SMP Debian 5.10.140-1 (2022-09-02) x86_64 GNU/Linux

> lsb_release -a
Distributor ID:	Debian
Description:	Debian GNU/Linux 11 (bullseye)
Release:	11
Codename:	bullseye

GDAL version and provenance

Using current head

> git rev-parse HEAD
ab9df14f4b6f7f9937e32f991c140b1621b7b5de

Excerpt from CMakeCache.txt:

grep OGDI CMakeCache.txt
//Set ON to use OGDI
GDAL_USE_OGDI:BOOL=ON
OGDI_CONFIG_EXE:FILEPATH=/usr/bin/ogdi-config
OGDI_INCLUDE_DIR:PATH=/usr/include/ogdi
OGDI_LIBRARY:FILEPATH=/usr/lib/libogdi.so
//Set ON to build OGR OGDI driver
OGR_ENABLE_DRIVER_OGDI:BOOL=ON
//Set ON to build OGR OGDI driver as plugin
OGR_ENABLE_DRIVER_OGDI_PLUGIN:BOOL=OFF
pkgcfg_lib_PC_OGDI_ogdi:FILEPATH=/usr/lib/libogdi.so
//Details about finding OGDI
FIND_PACKAGE_MESSAGE_DETAILS_OGDI:INTERNAL=[/usr/lib/libogdi.so][/usr/include/ogdi;/usr/include/ogdi][v4.1.0()]
//ADVANCED property for variable: OGDI_CONFIG_EXE
OGDI_CONFIG_EXE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: OGDI_INCLUDE_DIR
OGDI_INCLUDE_DIR-ADVANCED:INTERNAL=1
//ADVANCED property for variable: OGDI_LIBRARY
OGDI_LIBRARY-ADVANCED:INTERNAL=1
//Old value of option OGR_ENABLE_DRIVER_OGDI_PLUGIN
OGR_ENABLE_DRIVER_OGDI_PLUGIN_OLD_VAL:INTERNAL=OFF
PC_OGDI_CFLAGS:INTERNAL=-I/usr/include/ogdi
PC_OGDI_CFLAGS_I:INTERNAL=
PC_OGDI_CFLAGS_OTHER:INTERNAL=
PC_OGDI_FOUND:INTERNAL=1
PC_OGDI_INCLUDEDIR:INTERNAL=/usr/include
PC_OGDI_INCLUDE_DIRS:INTERNAL=/usr/include/ogdi
PC_OGDI_LDFLAGS:INTERNAL=-logdi
PC_OGDI_LDFLAGS_OTHER:INTERNAL=
PC_OGDI_LIBDIR:INTERNAL=/usr/lib
PC_OGDI_LIBRARIES:INTERNAL=ogdi
PC_OGDI_LIBRARY_DIRS:INTERNAL=
PC_OGDI_LIBS:INTERNAL=
PC_OGDI_LIBS_L:INTERNAL=
PC_OGDI_LIBS_OTHER:INTERNAL=
PC_OGDI_LIBS_PATHS:INTERNAL=
PC_OGDI_MODULE_NAME:INTERNAL=ogdi
PC_OGDI_PREFIX:INTERNAL=/usr
PC_OGDI_STATIC_CFLAGS:INTERNAL=-I/usr/include/ogdi
PC_OGDI_STATIC_CFLAGS_I:INTERNAL=
PC_OGDI_STATIC_CFLAGS_OTHER:INTERNAL=
PC_OGDI_STATIC_INCLUDE_DIRS:INTERNAL=/usr/include/ogdi
PC_OGDI_STATIC_LDFLAGS:INTERNAL=-logdi;-lexpat;-lz
PC_OGDI_STATIC_LDFLAGS_OTHER:INTERNAL=
PC_OGDI_STATIC_LIBDIR:INTERNAL=
PC_OGDI_STATIC_LIBRARIES:INTERNAL=ogdi;expat;z
PC_OGDI_STATIC_LIBRARY_DIRS:INTERNAL=
PC_OGDI_STATIC_LIBS:INTERNAL=
PC_OGDI_STATIC_LIBS_L:INTERNAL=
PC_OGDI_STATIC_LIBS_OTHER:INTERNAL=
PC_OGDI_STATIC_LIBS_PATHS:INTERNAL=
PC_OGDI_VERSION:INTERNAL=4.1.0
PC_OGDI_ogdi_INCLUDEDIR:INTERNAL=
PC_OGDI_ogdi_LIBDIR:INTERNAL=
PC_OGDI_ogdi_PREFIX:INTERNAL=
PC_OGDI_ogdi_VERSION:INTERNAL=
__pkg_config_arguments_PC_OGDI:INTERNAL=QUIET;ogdi
__pkg_config_checked_PC_OGDI:INTERNAL=1
//ADVANCED property for variable: pkgcfg_lib_PC_OGDI_ogdi
pkgcfg_lib_PC_OGDI_ogdi-ADVANCED:INTERNAL=1
@zedrdave
Copy link
Author

zedrdave commented Oct 13, 2022

Manually editing PC_OGDI_INCLUDE_DIRS to add include path:
PC_OGDI_INCLUDE_DIRS:INTERNAL=/usr/include/ogdi;/usr/include/tirpc
seems to fix the compilation problem, but resulting binaries crash with a segmentation fault (not certain if connected).

[Edit] compiling without OGDI drivers still gives out segfault, so can't confirm whether fixing includes would work.

@rouault
Copy link
Member

rouault commented Oct 13, 2022

pkg-config ogdi --modversion
4.1.0

I'm confused by this. Just trying the docker debian:10 image, I can only install libogdi3.2. How did you install OGDI 4.1 ?

@zedrdave
Copy link
Author

@rouault All apologies: I meant to write Debian 11 (Bullseye), not 10!
(updated the issue's content with distribution details)

@zedrdave zedrdave changed the title OGDI drivers fail to build on Debian 10 (missing rpc/rpc.h) OGDI drivers fail to build on Debian 11 Bullseye (missing rpc/rpc.h) Oct 13, 2022
@rouault
Copy link
Member

rouault commented Oct 13, 2022

I can't reproduce any build error with the following:

$ docker run --rm -it -v $HOME:$HOME debian:11 

inside container:

apt update
apt install g++ cmake libogdi-dev libproj-dev pkg-config
cd /path/to/gdal/source
mkdir build_deb11
cd build_deb11
cmake -S .. -B .
make -j$(nproc)

I do have libtirpc package installed (as one of the dependencies of the ones I installed)

$ dpkg -l | grep rpc
ii  libtirpc-common           1.3.1-1+deb11u1                all          transport-independent RPC library - common files
ii  libtirpc-dev:amd64        1.3.1-1+deb11u1                amd64        transport-independent RPC library - development files
ii  libtirpc3:amd64           1.3.1-1+deb11u1                amd64        transport-independent RPC library

Although I presume it is rather the following which is used:

$ ls -al /usr/include/rpc/rpc.h
-rw-r--r-- 1 root root 3938 Aug 26 21:32 /usr/include/rpc/rpc.h
$ dpkg -S /usr/include/rpc/rpc.h
libc6-dev:amd64: /usr/include/rpc/rpc.h

and you can't remove libc6-dev without removing g++

@zedrdave
Copy link
Author

Indeed… after retrying on a perfectly clean reinstall of Debian 11, I am no longer able to replicate that weird issue.

Sorry for raising this false alarm…

@aborruso
Copy link
Contributor

@zedrdave @rouault I'm trying to compile gdal 3.7.1 in debian 11

cmake -D GDAL_USE_GEOS=ON -D GDAL_USE_PARQUET=ON ..
cmake --build .

And I have

[ 89%] Building CXX object ogr/ogrsf_frmts/ogdi/CMakeFiles/ogr_OGDI.dir/ogrogdidatasource.cpp.o
In file included from /usr/include/ogdi/ecs.h:9,
                 from /home/aborruso/lavagna/tmp/gdal-3.7.1/ogr/ogrsf_frmts/ogdi/ogrogdi.h:41,
                 from /home/aborruso/lavagna/tmp/gdal-3.7.1/ogr/ogrsf_frmts/ogdi/ogrogdidatasource.cpp:30:
/usr/include/rpc/rpc.h:38:10: fatal error: rpc/types.h: No such file or directory
   38 | #include <rpc/types.h>  /* some typedefs */
      |          ^~~~~~~~~~~~~
compilation terminated.
gmake[2]: *** [ogr/ogrsf_frmts/ogdi/CMakeFiles/ogr_OGDI.dir/build.make:82: ogr/ogrsf_frmts/ogdi/CMakeFiles/ogr_OGDI.dir/ogrogdidatasource.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:10535: ogr/ogrsf_frmts/ogdi/CMakeFiles/ogr_OGDI.dir/all] Error 2
gmake: *** [Makefile:160: all] Error 2

@aborruso
Copy link
Contributor

Hi,
if I remove OGDI support cmake -D GDAL_USE_GEOS=ON -D GDAL_USE_PARQUET=ON -D OGR_ENABLE_DRIVER_OGDI:BOOL=OFF .., I have the error below after cmake --build .

[ 93%] Built target gcore_mdreader
Scanning dependencies of target GDAL
[ 93%] Linking CXX shared library libgdal.so
/usr/bin/ld:
ogr/ogrsf_frmts/parquet/CMakeFiles/ogr_Parquet.dir/ogrparquetdriver.cpp.o:
in function `GetFileSystem(std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> >&,
std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> > const&)':
ogrparquetdriver.cpp:(.text+0x1193): undefined reference to
`arrow::fs::FileSystemFromUriOrPath(std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&,
std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> >*)'
/usr/bin/ld:
ogr/ogrsf_frmts/parquet/CMakeFiles/ogr_Parquet.dir/ogrparquetdriver.cpp.o:
in function `arrow::fs::FileSystem::FileSystem(arrow::io::IOContext
const&)':
ogrparquetdriver.cpp:(.text._ZN5arrow2fs10FileSystemC2ERKNS_2io9IOContextE[_ZN5arrow2fs10FileSystemC5ERKNS_2io9IOContextE]+0x23):
undefined reference to `vtable for arrow::fs::FileSystem'
/usr/bin/ld:
ogr/ogrsf_frmts/parquet/CMakeFiles/ogr_Parquet.dir/ogrparquetdriver.cpp.o:
in function
`VSIArrowFileSystem::VSIArrowFileSystem(std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&)':
ogrparquetdriver.cpp:(.text._ZN18VSIArrowFileSystemC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN18VSIArrowFileSystemC5ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x57):
undefined reference to `arrow::fs::FileSystem::~FileSystem()'
/usr/bin/ld:
ogr/ogrsf_frmts/parquet/CMakeFiles/ogr_Parquet.dir/ogrparquetdriver.cpp.o:
in function `VSIArrowFileSystem::Equals(arrow::fs::FileSystem const&)
const':
ogrparquetdriver.cpp:(.text._ZNK18VSIArrowFileSystem6EqualsERKN5arrow2fs10FileSystemE[_ZNK18VSIArrowFileSystem6EqualsERKN5arrow2fs10FileSystemE]+0x2a):
undefined reference to `typeinfo for arrow::fs::FileSystem'
/usr/bin/ld:
ogr/ogrsf_frmts/parquet/CMakeFiles/ogr_Parquet.dir/ogrparquetdriver.cpp.o:(.data.rel.ro._ZTV18VSIArrowFileSystem[_ZTV18VSIArrowFileSystem]+0x28):
undefined reference to
`arrow::fs::FileSystem::NormalizePath(std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> >)'
/usr/bin/ld:
ogr/ogrsf_frmts/parquet/CMakeFiles/ogr_Parquet.dir/ogrparquetdriver.cpp.o:(.data.rel.ro._ZTV18VSIArrowFileSystem[_ZTV18VSIArrowFileSystem]+0x30):
undefined reference to
`arrow::fs::FileSystem::PathFromUri(std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&) const'
/usr/bin/ld:
ogr/ogrsf_frmts/parquet/CMakeFiles/ogr_Parquet.dir/ogrparquetdriver.cpp.o:(.data.rel.ro._ZTV18VSIArrowFileSystem[_ZTV18VSIArrowFileSystem]+0x50):
undefined reference to
`arrow::fs::FileSystem::GetFileInfo(std::vector<std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> >,
std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> > > > const&)'
/usr/bin/ld:
ogr/ogrsf_frmts/parquet/CMakeFiles/ogr_Parquet.dir/ogrparquetdriver.cpp.o:(.data.rel.ro._ZTV18VSIArrowFileSystem[_ZTV18VSIArrowFileSystem]+0x60):
undefined reference to
`arrow::fs::FileSystem::GetFileInfoAsync(std::vector<std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> >,
std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> > > > const&)'
/usr/bin/ld:
ogr/ogrsf_frmts/parquet/CMakeFiles/ogr_Parquet.dir/ogrparquetdriver.cpp.o:(.data.rel.ro._ZTV18VSIArrowFileSystem[_ZTV18VSIArrowFileSystem]+0x68):
undefined reference to
`arrow::fs::FileSystem::GetFileInfoGenerator(arrow::fs::FileSelector
const&)'
/usr/bin/ld:
ogr/ogrsf_frmts/parquet/CMakeFiles/ogr_Parquet.dir/ogrparquetdriver.cpp.o:(.data.rel.ro._ZTV18VSIArrowFileSystem[_ZTV18VSIArrowFileSystem]+0x88):
undefined reference to
`arrow::fs::FileSystem::DeleteDirContentsAsync(std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&, bool)'
/usr/bin/ld:
ogr/ogrsf_frmts/parquet/CMakeFiles/ogr_Parquet.dir/ogrparquetdriver.cpp.o:(.data.rel.ro._ZTV18VSIArrowFileSystem[_ZTV18VSIArrowFileSystem]+0xa0):
undefined reference to
`arrow::fs::FileSystem::DeleteFiles(std::vector<std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> >,
std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> > > > const&)'
/usr/bin/ld:
ogr/ogrsf_frmts/parquet/CMakeFiles/ogr_Parquet.dir/ogrparquetdriver.cpp.o:(.data.rel.ro._ZTV18VSIArrowFileSystem[_ZTV18VSIArrowFileSystem]+0xc0):
undefined reference to
`arrow::fs::FileSystem::OpenInputStream(arrow::fs::FileInfo const&)'
/usr/bin/ld:
ogr/ogrsf_frmts/parquet/CMakeFiles/ogr_Parquet.dir/ogrparquetdriver.cpp.o:(.data.rel.ro._ZTV18VSIArrowFileSystem[_ZTV18VSIArrowFileSystem]+0xd0):
undefined reference to
`arrow::fs::FileSystem::OpenInputFile(arrow::fs::FileInfo const&)'
/usr/bin/ld:
ogr/ogrsf_frmts/parquet/CMakeFiles/ogr_Parquet.dir/ogrparquetdriver.cpp.o:(.data.rel.ro._ZTV18VSIArrowFileSystem[_ZTV18VSIArrowFileSystem]+0xd8):
undefined reference to
`arrow::fs::FileSystem::OpenInputStreamAsync(std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld:
ogr/ogrsf_frmts/parquet/CMakeFiles/ogr_Parquet.dir/ogrparquetdriver.cpp.o:(.data.rel.ro._ZTV18VSIArrowFileSystem[_ZTV18VSIArrowFileSystem]+0xe0):
undefined reference to
`arrow::fs::FileSystem::OpenInputStreamAsync(arrow::fs::FileInfo const&)'
/usr/bin/ld:
ogr/ogrsf_frmts/parquet/CMakeFiles/ogr_Parquet.dir/ogrparquetdriver.cpp.o:(.data.rel.ro._ZTV18VSIArrowFileSystem[_ZTV18VSIArrowFileSystem]+0xe8):
undefined reference to
`arrow::fs::FileSystem::OpenInputFileAsync(std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld:
ogr/ogrsf_frmts/parquet/CMakeFiles/ogr_Parquet.dir/ogrparquetdriver.cpp.o:(.data.rel.ro._ZTV18VSIArrowFileSystem[_ZTV18VSIArrowFileSystem]+0xf0):
undefined reference to
`arrow::fs::FileSystem::OpenInputFileAsync(arrow::fs::FileInfo const&)'
/usr/bin/ld:
ogr/ogrsf_frmts/parquet/CMakeFiles/ogr_Parquet.dir/ogrparquetdriver.cpp.o:
in function `VSIArrowFileSystem::~VSIArrowFileSystem()':
ogrparquetdriver.cpp:(.text._ZN18VSIArrowFileSystemD2Ev[_ZN18VSIArrowFileSystemD5Ev]+0x32):
undefined reference to `arrow::fs::FileSystem::~FileSystem()'
/usr/bin/ld:
ogr/ogrsf_frmts/parquet/CMakeFiles/ogr_Parquet.dir/ogrparquetdriver.cpp.o:(.data.rel.ro._ZTI18VSIArrowFileSystem[_ZTI18VSIArrowFileSystem]+0x10):
undefined reference to `typeinfo for arrow::fs::FileSystem'
collect2: error: ld returned 1 exit status
gmake[2]: *** [CMakeFiles/GDAL.dir/build.make:2638: libgdal.so.33.3.7.1]
Error 1
gmake[1]: *** [CMakeFiles/Makefile2:4667: CMakeFiles/GDAL.dir/all] Error 2
gmake: *** [Makefile:160: all] Error 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants