Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build for Apple Silicon using Xcode 15 #217

Open
wants to merge 1 commit into
base: v3.2_for_ie_master
Choose a base branch
from

Conversation

pedrolinhares
Copy link

Description

Fixes to build on Apple Silicon using cmake's Xcode generator. Due to library being built only with OBJECT libraries, Xcode is unable to correctly build the library. In this case, we need to add at least one cpp source to the library build in order to Xcode to correctly build the target.

Fixes # (github issue)

Checklist

General

  • Do all unit and benchdnn tests (make test and make test_benchdnn_*) pass locally for each commit?
  • Have you formatted the code using clang-format?

Performance improvements

  • Have you submitted performance data that demonstrates performance improvements?

New features

  • Have you published an RFC for the new feature?
  • Was the RFC approved?
  • Have you added relevant tests?

Bug fixes

  • Have you included information on how to reproduce the issue (either in a github issue or in this PR)?
  • Have you added relevant regression tests?

RFC PR

  • Does RFC document follow the template?
  • Have you added a link to the rendered document?

@vpirogov
Copy link

@pedrolinhares, thanks for bringing up the issue. Proposed solution looks a bit like a workaround, as it adds a dummy C++ file to trick XCode into doing the right thing. What would be the proper way to link object libraries with XCode?

@pedrolinhares
Copy link
Author

@vpirogov This workaround seems to be the recommended solution. We need to add a real source since I didn't know which real source to link (since it's already in the object lib), adding a dummy cpp solves the problem. Also, from cmake's documentation:
"Some native build systems (such as Xcode) may not like targets that have only object files, so consider adding at least one real source file to any target that references $<TARGET_OBJECTS:objlib>." https://cmake.org/cmake/help/latest/command/add_library.html#object-libraries

If you could help point out which real sources to build the library with that would be ideal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants