Open mandree opened 1 year ago
One small workaround for FreeBSD 13.2 is to patch cmake/OpenEXRSetup.cmake on line 218 like this:
- set(EXR_DEFLATE_LIB ${deflate_LIBRARIES})
+ set(EXR_DEFLATE_LIB ${deflate_LINK_LIBRARIES})
Thanks for the catch and the suggested fix, that does seem correct to me. Our CI doesn't currently validate all these cases as it should. Let's give this another day or so and I'll push out another release.
Cary, I am sorry to say I appear to have misled you, reading https://github.com/AcademySoftwareFoundation/openexr/pull/1572#issue-1916654793 - my apologies for being unclear about what FreeBSD usually does, and what deflate_LINK_LIBRARIES
contains.
deflate_LINK_LIBRARIES
, after cmake's configure run, on FreeBSD ports, will contain the absolute path of libdeflate.so (by default, /usr/local/lib/libdeflate.so
) but NOT the -L flag. The latter is part of deflate_LDFLAGS
, see below. This is what I get in CMakeCache.txt on FreeBSD 13.2 with the workaround shown above (I think it should not influence CMakeCache.txt):
$ grep deflate work/.build/CMakeCache.txt | grep -v ^//
OPENEXR_DEFLATE_REPO:STRING=https://github.com/ebiggers/libdeflate.git
pkgcfg_lib_deflate_deflate:FILEPATH=/usr/local/lib/libdeflate.so
__pkg_config_arguments_deflate:INTERNAL=IMPORTED_TARGET;GLOBAL;libdeflate
__pkg_config_checked_deflate:INTERNAL=1
deflate_CFLAGS:INTERNAL=-I/usr/local/include
deflate_CFLAGS_I:INTERNAL=
deflate_CFLAGS_OTHER:INTERNAL=
deflate_FOUND:INTERNAL=1
deflate_INCLUDEDIR:INTERNAL=/usr/local/include
deflate_INCLUDE_DIRS:INTERNAL=/usr/local/include
deflate_LDFLAGS:INTERNAL=-L/usr/local/lib;-ldeflate
deflate_LDFLAGS_OTHER:INTERNAL=
deflate_LIBDIR:INTERNAL=/usr/local/lib
deflate_LIBRARIES:INTERNAL=deflate
deflate_LIBRARY_DIRS:INTERNAL=/usr/local/lib
deflate_LIBS:INTERNAL=
deflate_LIBS_L:INTERNAL=
deflate_LIBS_OTHER:INTERNAL=
deflate_LIBS_PATHS:INTERNAL=
deflate_MODULE_NAME:INTERNAL=libdeflate
deflate_PREFIX:INTERNAL=/usr/local
deflate_STATIC_CFLAGS:INTERNAL=-I/usr/local/include
deflate_STATIC_CFLAGS_I:INTERNAL=
deflate_STATIC_CFLAGS_OTHER:INTERNAL=
deflate_STATIC_INCLUDE_DIRS:INTERNAL=/usr/local/include
deflate_STATIC_LDFLAGS:INTERNAL=-L/usr/local/lib;-ldeflate
deflate_STATIC_LDFLAGS_OTHER:INTERNAL=
deflate_STATIC_LIBDIR:INTERNAL=
deflate_STATIC_LIBRARIES:INTERNAL=deflate
deflate_STATIC_LIBRARY_DIRS:INTERNAL=/usr/local/lib
deflate_STATIC_LIBS:INTERNAL=
deflate_STATIC_LIBS_L:INTERNAL=
deflate_STATIC_LIBS_OTHER:INTERNAL=
deflate_STATIC_LIBS_PATHS:INTERNAL=
deflate_VERSION:INTERNAL=1.19
deflate_libdeflate_INCLUDEDIR:INTERNAL=
deflate_libdeflate_LIBDIR:INTERNAL=
deflate_libdeflate_PREFIX:INTERNAL=
deflate_libdeflate_VERSION:INTERNAL=
pkgcfg_lib_deflate_deflate-ADVANCED:INTERNAL=1
I'm unfortunately not going to have any further time to look into this in the next few days. If anyone out there can contribute a fix, I'd appreciate it so much I'll buy you a milkshake.
The fix in #1572 doesn't resolve the issue and presumably shouldn't be merged, although the discussion there makes some good suggestions, I just don't have the time now to turn that into a workable PR.
If anyone out there can contribute a fix, I'd appreciate it so much I'll buy you a milkshake
We've also had the same issue internally here at Weta using Ubuntu with an existing libdelflate install (provided via CMAKE_PREFIX_PATH
/PKG_CONFIG_PATH
).
Will be pushing up a patch soon, and looking forward to that milkshake!
FreeBSD builds, which install libdeflate as .so in /usr/local/lib, and use the system libdeflate (not the embedding approach), fail to build as of v3.2.1. The cmake configure phase completes successfully:
But the build then barfs:
FreeBSD requires some -L/usr/local/lib for -ldeflate, and pkgconf also emits it.
This issue appears to be caused by the second hunk of this patch:
https://github.com/AcademySoftwareFoundation/openexr/pull/1561/files#diff-d20456c2960f2c3e9dbea28785de9afbf98e37a3ccef8043a4848bce979535c3
Reverting this hunk changes the above to (note we have the absolute /usr/local/lib/libdeflate.so instead of -ldeflate), which succeeds: