[gdal-dev] About installing EXPAT

Abel Pau a.pau at creaf.uab.cat
Fri Sep 29 07:20:46 PDT 2023


Hi Stefan,
thanks for your answer.

I’ve installed vcpkg as you recommend. I followed the instructions of the web.
After I installed packages you comment.
It’s been needed to install phyton3 again cause some recent issues. (error: while looking for phyton:x64-windows: error: while loading phyton: error: phyton does not exist)
vcpkg install phyton3 works fine (it seems)

I Open Gdal CMakelists.txt in Visual
I add next two lines below (ODBC is not in vcpkg?)
list(APPEND CMAKE_PREFIX_PATH "C:/dev/vcpkg/vcpkg/installed")
set(ODBCCPP_INCLUDE_DIR "D:/GitHub-repository/odbc-cpp-wrapper/src")

It seems that all is fine. Visual detect it and execute the configuration.
1> [CMake] -- The following RECOMMENDED packages have been found:
1> [CMake]
1> [CMake]  * EXPAT
1> [CMake]    Read and write XML formats
...
1> CMake generation finished.


After that i try to build the project and...
>------ Build All started: Project: GDAL, Configuration: x64-Debug ------
  [1/6] cmd.exe /C "cd /D D:\GitHub-repository\GDAL\ogr && "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -DIN_FILE=swq_parser.y -DTARGET=generate_swq_parser -DEXPECTED_MD5SUM=44620ffbb37fb8665887a175b299781b -DFILENAME_CMAKE=D:/GitHub-repository/GDAL/ogr/CMakeLists.txt -P D:/GitHub-repository/GDAL/cmake/helpers/check_md5sum.cmake"
  [2/6] cmd.exe /C "cd /D D:\GitHub-repository\GDAL\ogr\ogrsf_frmts\ods && "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -DIN_FILE=ods_formula_parser.y -DTARGET=generate_ods_formula_parser -DEXPECTED_MD5SUM=acf825ac2d574098a64c74c864aee15e -DFILENAME_CMAKE=D:/GitHub-repository/GDAL/ogr/ogrsf_frmts/ods/CMakeLists.txt -P D:/GitHub-repository/GDAL/cmake/helpers/check_md5sum.cmake"
  [3/6] cmd.exe /C "cd /D D:\GitHub-repository\GDAL\out\build\x64-Debug && "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -DSOURCE_DIR=D:/GitHub-repository/GDAL -DBINARY_DIR=D:/GitHub-repository/GDAL/out/build/x64-Debug -DGDAL_SHA1SUM= -DGDAL_RELEASE_DATE= -P D:/GitHub-repository/GDAL/cmake/helpers/generate_gdal_version_h.cmake"
  -- Found Git: C:/Program Files/Git/cmd/git.exe (found version "2.40.1.windows.1")
  [4/6] Generating osgeo/_gdal.cp311-win_amd64.pyd, osgeo/_gdalconst.cp311-win_amd64.pyd, osgeo/_gnm.cp311-win_amd64.pyd, osgeo/_ogr.cp311-win_amd64.pyd, osgeo/_osr.cp311-win_amd64.pyd
  Traceback (most recent call last):
    File "D:\GitHub-repository\GDAL\out\build\x64-Debug\swig\python\setup.py", line 14, in <module>
      from setuptools.command.build_ext import build_ext
  ModuleNotFoundError: No module named 'setuptools'
  [5/6] Building CXX object autotest\CMakeFiles\pytest_runner.dir\pytest_runner.cpp.obj
  [6/6] Linking CXX executable autotest\pytest_runner.exe

Build All succeeded.

I have to install setuptools? At the end I don’t get the GDAL project rebuilded and I don’t know what is happening.
I’m new at that kind of things.
Thanks again for any help!

De: Uhrig, Stefan <stefan.uhrig at sap.com>
Enviado el: dijous, 28 de setembre de 2023 11:46
Para: Abel Pau <a.pau at creaf.uab.cat>; gdal dev <gdal-dev at lists.osgeo.org>
Asunto: RE: [gdal-dev] About installing EXPAT

Hi Abel,

I can recommend vcpkg (https://vcpkg.io/) if you’d like to build GDAL on Windows with Visual Studio or Visual Studio Community Edition.

vcpkg builds packages from sources and can build the mandatory dependencies of GDAL (and a lot of optional ones). You get a working starting set via

vcpkg --triplet=x64-windows install curl expat geos lerc libdeflate libgeotiff libiconv libpng libxml2 openssl proj qhull sqlite3[rtree] xerces-c zlib

You can then open GDAL’s CMakeLists.txt file in Visual Studio via File -> Open -> CMake… After configuration, you can just start the build:

>------ Build All started: Project: gdal, Configuration: x64-Debug ------
  [1/1351] Building C object frmts\zlib\CMakeFiles\libz.dir\crc32.c.obj
  [2/1351] Building C object frmts\zlib\CMakeFiles\libz.dir\trees.c.obj
  [3/1351] Building C object frmts\zlib\CMakeFiles\libz.dir\uncompr.c.obj
...
  [1348/1351] Linking CXX executable fuzzers\tests\test_ogr_fuzzer.exe
  [1349/1351] Linking CXX executable fuzzers\tests\test_gdal_fuzzer.exe
  [1350/1351] Linking CXX executable perftests\bench_ogr_c_api.exe
  [1351/1351] Linking CXX executable fuzzers\tests\test_osr_set_from_user_input_fuzzer.exe

Build All succeeded.

vcpkg builds debug and release versions of the packages. As the packages are built from source, you can even debug into the dependencies because the source code is on your machine. That can be really helpful from time to time.

I’d recommend starting from a clean environment though. I guess you tweaked quite a lot to get GDAL building.

Cheers,
Stefan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20230929/c23df36f/attachment-0001.htm>


More information about the gdal-dev mailing list