Open marklit opened 2 hours ago
I tried GDAL 3.9.3 but I'm still getting the same error message.
$ export CPLUS_INCLUDE_PATH=/mnt/d/code_gis/gdal-3.9.3/
$ export C_INCLUDE_PATH=/mnt/d/code_gis/gdal-3.9.3/
$ sudo ldconfig
$ mkdir build
$ cd build
$ CC=gcc \
CXX=g++ \
GDAL_ROOT=/mnt/d/code_gis/gdal-3.9.3 \
cmake \
-DCMAKE_INSTALL_PREFIX=../install \
../
$ make -j$(nproc) VERBOSE=ON
/mnt/d/code_gis/gdal-3.9.3/version:1:1: error: expected unqualified-id before numeric constant
In file included from /home/mark/.nasa_sar/include/pybind11/detail/common.h:328,
from /home/mark/.nasa_sar/include/pybind11/attr.h:13,
from /home/mark/.nasa_sar/include/pybind11/detail/class.h:12,
from /home/mark/.nasa_sar/include/pybind11/pybind11.h:12,
from /mnt/d/code_gis/isce3/build/_deps/pyre-src/extensions/pyre/timers/../external.h:18,
from /mnt/d/code_gis/isce3/build/_deps/pyre-src/extensions/pyre/timers/external.h:12,
from /mnt/d/code_gis/isce3/build/_deps/pyre-src/extensions/pyre/timers/wall_timers.cc:8:
/mnt/d/code_gis/gdal-3.9.3/version:1:1: error: expected unqualified-id before numeric constant
Is it picking up the right version of pybind11.
grep -i pybind11 CMakeCache.txt
- the error suggest some form of clash between Python headers.
Also pyre-check
is unrelated to this project.
I think the problem is the file version
in the gdal
directory that has been added to the include path. This file shadows the file version
from the STL. Do things improve if instead of setting CPLUS_INCLUDE_PATH
to the root gdal
directory, you instead point it to where the gdal
headers are?
What versions of cmake are you in? Maybe there have been changes to GDAL auto detect as well due to the new version
file as suggested above.
On my laptop with homebrew
cmake 3.30.5
pybind11 2.13.6
clang 16.0.0
python 3.11.10
gdal 3.9.3
Built fine without issues
I do not see a file named version
. GDAL handles all its versions via gdal_version.h
. Are you sure GDAL_ROOT
is correctly set and there is are lib
, include
and bin
folders under it
@marklit's output complains that /mnt/d/code_gis/gdal-3.10.0/version
is not parsable because the (assumed) real literal 3.10.0
has too many decimal points. clearly during compilation, some file #include <version>
, a standard STL header, and it is being shadowed by the identically named file in the main gdal
distribution directory. in turn, this directory is visible to the compiler because of the CPLUS_INCLUDE_PATH
environment variable setting. let's wait for @marklit to verify that this is the case...
I agree with a file named version
shadowing the system file but I don't think its part of the standard / official GDAL distribution. Hence my question on if the GDAL_ROOT that he is passing to cmake is correctly set.