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

Fix qt-gui-cpp cross-compile for osx-arm64 #72

Open
Tobias-Fischer opened this issue Jan 16, 2022 · 5 comments
Open

Fix qt-gui-cpp cross-compile for osx-arm64 #72

Tobias-Fischer opened this issue Jan 16, 2022 · 5 comments
Labels
bug Something isn't working help wanted Extra attention is needed osx

Comments

@Tobias-Fischer
Copy link
Contributor

Tobias-Fischer commented Jan 16, 2022

mimick-vendor and qt-gui-cpp currently only compile natively - cross compile doesn't work.

For mimick-vendor, it is probably sufficient to simply forward the CMAKE_ARGS to the mimick build.

For qt-gui-cpp, we need to install sip-build and qt-main (also) in the build env, and point SIP_EXECUTABLE to $BUILD_PREFIX/bin/sip-build. Similarly we need to point QMAKE_EXECUTABLE to $BUILD_PREFIX/bin/qmake. Not sure what else needs doing beyond that.

@Tobias-Fischer Tobias-Fischer added bug Something isn't working help wanted Extra attention is needed labels Jan 16, 2022
@Tobias-Fischer Tobias-Fischer changed the title Fix mimick-vendor cross-compile for osx-arm64 Fix mimick-vendor and qt-gui-cpp cross-compile for osx-arm64 Jan 17, 2022
@Tobias-Fischer Tobias-Fischer changed the title Fix mimick-vendor and qt-gui-cpp cross-compile for osx-arm64 Fix qt-gui-cpp cross-compile for osx-arm64 Jan 18, 2022
@Tobias-Fischer
Copy link
Contributor Author

Fixed the mimick-vendor cross-compile; qt-gui-cpp seems trickier.

@michtesar
Copy link

I am investigating qt-gui-cpp.

@michtesar
Copy link

After some testing, I tried to compile qt-gui-cpp for osx-64 and osx-arm64 on Intel based MacBook Pro.

In recipe.yaml I added followings host libraries:

- qt-main
- pyqt-builder
- libfido2
- qt

I found issues with incompatibility of versions of qt. During build I see package qt-main-5.15.2-hfad5ee4_0 has constraint qt 5.15.2 conflicting with qt-5.12.1-h1b46049_0.

For cross-platform build for osx-arm64 it goes until almost end and complains on C lang compiler as manifested as follows:

ld: library not found for -lSystem
    clang-12: error: linker command failed with exit code 1 (use -v to see invocation)
    ninja: build stopped: subcommand failed.
    
  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:2 (project)

Its noteworthy that in recipe.yaml for osx-arm64 I commented out qt package otherwise, there are no sources to qt 5.12.*.

I include log file for both to start investigating.

report_arm-x64.log
report_x64.log

@michtesar
Copy link

michtesar commented Jan 18, 2022

It seems I can build it on osx-64, with osx-arm64 I struggle with qt versions.
Archive.zip

@Tobias-Fischer
Copy link
Contributor Author

Good start!

I forgot to tell you one piece that explains the qt issues. For the osx-arm64 build, we only use the qt-main package. This is already configured properly in https://github.com/RoboStack/ros-galactic/blob/main/robostack.yaml - however, you need to tell vinca that you want to create recipes for osx-arm64 rather than osx-64. You do so by running vinca --multiple --platform=osx-arm64. Then qt should disappear in the recipe.yaml.

The error ld: library not found for -lSystem can be explained as CONDA_BUILD_SYSROOT needs to be set on your machine:

CONDA_BUILD_SYSROOT:
- /Applications/Xcode_13.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk # [osx and arm64]
- simply add a new entry with the path to your SDK. You can download the 11.3 SDK from https://github.com/phracker/MacOSX-SDKs/releases/tag/11.3 and point to that path.

Let us know how you go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed osx
Projects
None yet
Development

No branches or pull requests

2 participants