Hi,

If this is too off-topic, then apologies, but it is related to compiling OpenImageIO under MacOS as a universal binary.

I've compiled all dependencies for OIIO for both x86_64 and arm64 as universal binaries (by adding CMAKE_OSX_ARCHITECTURES arm64;x86_64 to build universal libraries of all dependencies and then confirmed at each stage with lipo -archs <file> to show the dual architectures in the libraries) libOpenImageIO_Util links just fine, but linking libOpenImageIO.dylib fails (specifically linking in libfreetype and it's dependency harfbuzz).

The errors are all the same library issues and along the lines of:

[ 84%] Building CXX object src/libOpenImageIO/CMakeFiles/OpenImageIO.dir/__/include/OpenImageIO/detail/pugixml/pugixml.cpp.o
[ 84%] Linking CXX shared library ../../lib/libOpenImageIO.dylib
Undefined symbols for architecture arm64:
  "_hb_buffer_add_utf8", referenced from:
      _af_shaper_get_cluster in libfreetype.a(autofit.c.o)
  <and more>

I checked the output from nm for both archituctures for libharfbuzz and these functions are there:

build@M1-BuildMacMini lib % nm -gA -arch all libharfbuzz.a | grep _hb_buffer_add_utf8 (for architecture x86_64):libharfbuzz.a:harfbuzz.cc.o: 000000000000a6b0 T _hb_buffer_add_utf8 (for architecture arm64):libharfbuzz.a:harfbuzz.cc.o: 0000000000009c94 T _hb_buffer_add_utf8

So I can't work out why it would not link.
Does anyone have any thoughts or help on this?

Best Regards,
  Simon C. Smith
  Co-Founder, Lightmap LTD.
_______________________________________________
Oiio-dev mailing list
[email protected]
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org

Reply via email to