mathworks / libmexclass

libmexclass is a MATLAB framework which enables users to implement the functionality of MATLAB classes in terms of equivalent C++ classes using MEX.
BSD 3-Clause "New" or "Revised" License
5 stars 1 forks source link

`libmexclass` build sporadically fails on macOS and win64 GitHub Actions Runner #58

Closed kevingurney closed 11 months ago

kevingurney commented 1 year ago

There appears to be a sporadic failure when building libmexclass client code on a macOS GitHub Actions Runner.

Included below is a snippet of the failure from mathworks/arrow:

.
.
.
[1/35] Creating directories for 'arrow_ep'
[2/35] No download step for 'arrow_ep'
[3/35] No update step for 'arrow_ep'
[4/35] No patch step for 'arrow_ep'
[5/35] Building CXX object _deps/libmexclass-build/CMakeFiles/mexclass.dir/source/libmexclass/action/TypeFactory.cpp.o
[6/35] Building CXX object _deps/libmexclass-build/CMakeFiles/mexclass.dir/source/libmexclass/action/Unsupported.cpp.o
[7/35] Building CXX object _deps/libmexclass-build/CMakeFiles/mexclass.dir/source/libmexclass/action/MethodCall.cpp.o
[8/35] Building CXX object _deps/libmexclass-build/CMakeFiles/mexclass.dir/source/libmexclass/action/Destroy.cpp.o
[9/35] Building CXX object _deps/libmexclass-build/CMakeFiles/mexclass.dir/source/libmexclass/action/Create.cpp.o
[10/35] Building CXX object _deps/libmexclass-build/CMakeFiles/mexclass.dir/source/libmexclass/proxy/Proxy.cpp.o
[11/35] Building CXX object _deps/libmexclass-build/CMakeFiles/mexclass.dir/source/libmexclass/proxy/ProxyManager.cpp.o
[12/35] Linking CXX shared library _deps/libmexclass-build/libmexclass.dylib
FAILED: _deps/libmexclass-build/libmexclass.dylib 
: && /Applications/Xcode_14.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++  -isysroot /Applications/Xcode_14.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk -mmacosx-version-min=12.6 -dynamiclib -Wl,-headerpad_max_install_names  -o _deps/libmexclass-build/libmexclass.dylib -install_name @rpath/libmexclass.dylib _deps/libmexclass-build/CMakeFiles/mexclass.dir/source/libmexclass/action/TypeFactory.cpp.o _deps/libmexclass-build/CMakeFiles/mexclass.dir/source/libmexclass/action/Unsupported.cpp.o _deps/libmexclass-build/CMakeFiles/mexclass.dir/source/libmexclass/action/Create.cpp.o _deps/libmexclass-build/CMakeFiles/mexclass.dir/source/libmexclass/action/Destroy.cpp.o _deps/libmexclass-build/CMakeFiles/mexclass.dir/source/libmexclass/action/MethodCall.cpp.o _deps/libmexclass-build/CMakeFiles/mexclass.dir/source/libmexclass/proxy/Proxy.cpp.o _deps/libmexclass-build/CMakeFiles/mexclass.dir/source/libmexclass/proxy/ProxyManager.cpp.o  -Wl,-rpath,/Applications/MATLAB_R2023a/MATLAB_R2023a.app/bin/maci64  /Applications/MATLAB_R2023a/MATLAB_R2023a.app/bin/maci64/libmex.dylib && :
Undefined symbols for architecture x86_64:
  "_get_function_ptr", referenced from:
      int (*matlab::data::detail::resolveFunction<int (*)(matlab::data::impl::ArrayFactoryImpl**)>(matlab::data::detail::FunctionType))(matlab::data::impl::ArrayFactoryImpl**) in Create.cpp.o
      void (*matlab::data::detail::resolveFunction<void (*)(matlab::data::impl::ArrayFactoryImpl*)>(matlab::data::detail::FunctionType))(matlab::data::impl::ArrayFactoryImpl*) in Create.cpp.o
      int (*matlab::data::detail::resolveFunction<int (*)(matlab::data::impl::ArrayFactoryImpl*, int, void const*, matlab::data::impl::ArrayImpl**)>(matlab::data::detail::FunctionType))(matlab::data::impl::ArrayFactoryImpl*, int, void const*, matlab::data::impl::ArrayImpl**) in Create.cpp.o
      void (*matlab::data::detail::resolveFunction<void (*)(matlab::data::impl::ArrayImpl*)>(matlab::data::detail::FunctionType))(matlab::data::impl::ArrayImpl*) in Create.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
[13/35] Performing configure step for 'arrow_ep'

Note the text Undefined symbols for architecture x86_64: "_get_function_ptr".

It looks like this might have something to do with not properly linking against the MATLAB Data Array APIs.

kevingurney commented 1 year ago

This has shown up again: https://github.com/apache/arrow/pull/36190#issuecomment-1599741687.