ErichZimmer / OpenPIV-Python-cxx

OpenPIV Python accelerated by c++
GNU General Public License v3.0
1 stars 2 forks source link

macOS arm64 build fail #28

Open ErichZimmer opened 2 years ago

ErichZimmer commented 2 years ago

Describe the bug CIBuildWheel macOS arm64 build fails.

To Reproduce Steps to reproduce the behavior:

  1. Go to actions
  2. Click on any failed build_wheels build
  3. Scroll down to macOS build
  4. See error

Expected behavior Build and test passes.

Additional information

  [13/31] Linking CXX shared library out/libopenpivcore.dylib
  FAILED: out/libopenpivcore.dylib 
  : && /Applications/Xcode_12.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -Wall -Wextra -Wno-unknown-pragmas -O3 -DNDEBUG -DNDEBUG -g -O3 -ffast-math -arch arm64 -isysroot /Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk -mmacosx-version-min=10.14 -dynamiclib -Wl,-headerpad_max_install_names  -o out/libopenpivcore.dylib -install_name @rpath/libopenpivcore.dylib extern/openpiv-c--qt/openpiv/CMakeFiles/openpivcore.dir/core/size.cpp.o extern/openpiv-c--qt/openpiv/CMakeFiles/openpivcore.dir/core/rect.cpp.o extern/openpiv-c--qt/openpiv/CMakeFiles/openpivcore.dir/core/util.cpp.o extern/openpiv-c--qt/openpiv/CMakeFiles/openpivcore.dir/loaders/image_loader.cpp.o extern/openpiv-c--qt/openpiv/CMakeFiles/openpivcore.dir/loaders/pnm_image_loader.cpp.o extern/openpiv-c--qt/openpiv/CMakeFiles/openpivcore.dir/__/external/libtiff/4.0.10/tif_stream.cxx.o extern/openpiv-c--qt/openpiv/CMakeFiles/openpivcore.dir/loaders/tiff_image_loader.cpp.o  vcpkg_installed/x64-osx/lib/libtiff.a  vcpkg_installed/x64-osx/lib/liblzma.a  vcpkg_installed/x64-osx/lib/libjpeg.a  vcpkg_installed/x64-osx/lib/libz.a  -lm  vcpkg_installed/x64-osx/lib/libmimalloc.a  /Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/lib/libpthread.tbd && :
  ld: warning: ignoring file vcpkg_installed/x64-osx/lib/libtiff.a, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
  ld: warning: ignoring file vcpkg_installed/x64-osx/lib/liblzma.a, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
  ld: warning: ignoring file vcpkg_installed/x64-osx/lib/libjpeg.a, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
  ld: warning: ignoring file vcpkg_installed/x64-osx/lib/libz.a, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
  ld: warning: ignoring file vcpkg_installed/x64-osx/lib/libmimalloc.a, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
  Undefined symbols for architecture arm64:
    "_TIFFClientOpen", referenced from:
        _tiffStreamOpen(char const*, char const*, void*) in tif_stream.cxx.o
    "_TIFFClose", referenced from:
        openpiv::core::tiff_image_loader::open(std::__1::basic_istream<char, std::__1::char_traits<char> >&) in tiff_image_loader.cpp.o
        openpiv::core::tiff_image_loader::impl::open() in tiff_image_loader.cpp.o
    "_TIFFGetField", referenced from:
        openpiv::core::tiff_image_loader::impl::open() in tiff_image_loader.cpp.o
    "_TIFFReadDirectory", referenced from:
        openpiv::core::tiff_image_loader::impl::open() in tiff_image_loader.cpp.o
    "_TIFFReadScanline", referenced from:
        bool openpiv::core::tiff_image_loader::impl::extract<openpiv::core::g<unsigned short> >(unsigned long, openpiv::core::image<openpiv::core::g<unsigned short> >&) const in tiff_image_loader.cpp.o
        bool openpiv::core::tiff_image_loader::impl::extract<openpiv::core::g<double> >(unsigned long, openpiv::core::image<openpiv::core::g<double> >&) const in tiff_image_loader.cpp.o
        bool openpiv::core::tiff_image_loader::impl::extract<openpiv::core::rgba<unsigned short> >(unsigned long, openpiv::core::image<openpiv::core::rgba<unsigned short> >&) const in tiff_image_loader.cpp.o
        openpiv::core::image<openpiv::core::g<unsigned short> > (anonymous namespace)::copy<openpiv::core::g<unsigned short>, ((anonymous namespace)::planar_config)1, ((anonymous namespace)::sample_format)1, (unsigned short)1, (unsigned short)8>(tiff*, unsigned int, unsigned int) in tiff_image_loader.cpp.o
        openpiv::core::image<openpiv::core::rgba<unsigned short> > (anonymous namespace)::copy<openpiv::core::rgba<unsigned short>, ((anonymous namespace)::planar_config)1, ((anonymous namespace)::sample_format)1, (unsigned short)3, (unsigned short)8>(tiff*, unsigned int, unsigned int) in tiff_image_loader.cpp.o
        openpiv::core::image<openpiv::core::rgba<unsigned short> > (anonymous namespace)::copy<openpiv::core::rgba<unsigned short>, ((anonymous namespace)::planar_config)1, ((anonymous namespace)::sample_format)1, (unsigned short)3, (unsigned short)16>(tiff*, unsigned int, unsigned int) in tiff_image_loader.cpp.o
    "_TIFFScanlineSize", referenced from:
        openpiv::core::image<openpiv::core::g<unsigned short> > (anonymous namespace)::copy<openpiv::core::g<unsigned short>, ((anonymous namespace)::planar_config)1, ((anonymous namespace)::sample_format)1, (unsigned short)1, (unsigned short)8>(tiff*, unsigned int, unsigned int) in tiff_image_loader.cpp.o
        openpiv::core::image<openpiv::core::rgba<unsigned short> > (anonymous namespace)::copy<openpiv::core::rgba<unsigned short>, ((anonymous namespace)::planar_config)1, ((anonymous namespace)::sample_format)1, (unsigned short)3, (unsigned short)8>(tiff*, unsigned int, unsigned int) in tiff_image_loader.cpp.o
        openpiv::core::image<openpiv::core::rgba<unsigned short> > (anonymous namespace)::copy<openpiv::core::rgba<unsigned short>, ((anonymous namespace)::planar_config)1, ((anonymous namespace)::sample_format)1, (unsigned short)3, (unsigned short)16>(tiff*, unsigned int, unsigned int) in tiff_image_loader.cpp.o
    "_TIFFSetDirectory", referenced from:
        openpiv::core::tiff_image_loader::impl::open() in tiff_image_loader.cpp.o
        bool openpiv::core::tiff_image_loader::impl::extract<openpiv::core::g<unsigned short> >(unsigned long, openpiv::core::image<openpiv::core::g<unsigned short> >&) const in tiff_image_loader.cpp.o
        bool openpiv::core::tiff_image_loader::impl::extract<openpiv::core::g<double> >(unsigned long, openpiv::core::image<openpiv::core::g<double> >&) const in tiff_image_loader.cpp.o
        bool openpiv::core::tiff_image_loader::impl::extract<openpiv::core::rgba<unsigned short> >(unsigned long, openpiv::core::image<openpiv::core::rgba<unsigned short> >&) const in tiff_image_loader.cpp.o
  ld: symbol(s) not found for architecture arm64
ErichZimmer commented 2 years ago

@timdewhirst Perhaps you would know what I did wrong?

timdewhirst commented 2 years ago

for some reason the build process is mixing x86_64 and ARM binaries e.g. the line that invokes the compiler contains vcpkg_installed/x64-osx/lib/libtiff.a and indeed the next line says: ld: warning: ignoring file vcpkg_installed/x64-osx/lib/libtiff.a, building for macOS-arm64 but attempting to link with file built for macOS-x86_64