gisinternals / buildsystem

Build system on www.gisinternals.com
MIT License
33 stars 10 forks source link

Issues with linking of proj9.lib, and mfhdf.lib #222

Open rouault opened 10 months ago

rouault commented 10 months ago

In https://github.com/OSGeo/gdal/pull/8916, I'm updating a CI job to link against the release-1930 SDK 32-bit, and I get linking errors with proj9.lib, and mfhdf.lib Cf commit https://github.com/OSGeo/gdal/pull/8916/commits/980712bee3a4d80f627c2ba2ef8a71a09dbb38cb and those errors

            # We disable Spatialite and external geotiff as they link to gisinternals proj9 and we have the following linking error
            # refering to a file from the gisinternals build machine...
            # LINK : fatal error LNK1181: cannot open input file 'E:\buildsystem\release-1930\lib\proj9.lib' [D:\a\gdal\gdal\build\GDAL.vcxproj]
            # Disabling HDF4 (and netCDF) for similar reason: LINK : fatal error LNK1181: cannot open input file 'E:\buildsystem\release-1930\lib\mfhdf.lib'

The paths "E:\buildsystem\release-1930\lib" are very suspicious

szekerest commented 9 months ago

@rouault It is suspicious that the following files in the package prevents cmake to detect those libraries at the correct locations.

E:\buildsystem\release-1930\cmake\geotiff-depends.cmake E:\buildsystem\release-1930\lib\cmake\netCDF\netCDFTargets.cmake

I'm thinking to remove all .cmake and .pc files from the packages which may contain build server specific local paths.

rkolka commented 3 months ago

for gdal-3.9.1 I found 12 occurences of "E:/buildsystem/release-1930-x64" in "\lib\cmake\" Replacing them with "${_IMPORT_PREFIX}" seems to work.

Search "buildsystem" (12 hits in 4 files of 27 searched) C:\src\gdal-3.9.1-libs\lib\cmake\freetype\freetype-config.cmake (4 hits) Line 58: INTERFACE_LINK_LIBRARIES "E:/buildsystem/release-1930-x64/lib/zlib.lib;E:/buildsystem/release-1930-x64/lib/libpng16_static.lib;E:/buildsystem/release-1930-x64/lib/zlib.lib;E:/buildsystem/release-1930-x64/lib/harfbuzz.lib" C:\src\libs391\lib\cmake\harfbuzz\harfbuzzConfig.cmake (1 hit) Line 58: INTERFACE_LINK_LIBRARIES "E:/buildsystem/release-1930-x64/lib/freetype.lib" C:\src\libs391\lib\cmake\netCDF\netCDFTargets.cmake (6 hits) Line 58: INTERFACE_LINK_LIBRARIES "E:/buildsystem/release-1930-x64/lib/mfhdf.lib;E:/buildsystem/release-1930-x64/lib/hdf.lib;E:/buildsystem/release-1930-x64/lib/hdf5.lib;E:/buildsystem/release-1930-x64/lib/hdf5_hl.lib;E:/buildsystem/release-1930-x64/lib/szip.lib;E:/buildsystem/release-1930-x64/lib/libcurl_imp.lib" C:\src\libs391\lib\cmake\OpenSSL\OpenSSLConfig.cmake (1 hit) Line 92: set(OPENSSL_LIBCRYPTO_DEPENDENCIES E:\buildsystem\release-1930-x64\lib\zlib.lib ws2_32.lib gdi32.lib advapi32.lib crypt32.lib user32.lib)