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

WIP: macOS port #24

Draft
wants to merge 1 commit into
base: devel
Choose a base branch
from
Draft

WIP: macOS port #24

wants to merge 1 commit into from

Conversation

margce
Copy link

@margce margce commented Nov 20, 2023

wip

  • Updated CMakelists.txt for macos support
  • Fixed some of the struct declaration to comply with clang
  • Added libstlink.a which has been compiled on macos 13.5.2 (Ventura) for apple silicon
  • Added libspdlog.a fetched from homebrew

App compiles but fails to create a window in Gui::mainThread() when invoking glfwCreateWindow see more details in #21

- Fixed some of the struct declaration to comply with clang
- Added libstlink.a which has been compiled on macos 13.5.2 (Ventura) for apple silicon
- Added libspdlog.a fetched from homebrew
@margce margce changed the title macOS port WIP: macOS port Nov 20, 2023
@klonyyy klonyyy deleted the branch klonyyy:devel December 3, 2023 17:35
@klonyyy klonyyy closed this Dec 3, 2023
@klonyyy klonyyy reopened this Dec 3, 2023
@klonyyy klonyyy changed the base branch from statistics to devel December 3, 2023 17:42
@klonyyy klonyyy added enhancement New feature or request help wanted Extra attention is needed labels Feb 16, 2024
@phicore
Copy link

phicore commented Apr 24, 2024

if GLFW is only used by imgui and implot, then dropping GLFW and using the metal backend provided in imgui shall be possible.

@klonyyy klonyyy marked this pull request as draft May 23, 2024 14:59
@runger1101001
Copy link

runger1101001 commented Oct 31, 2024

The current main branch (352e8f4 builds on OS X only if I comment out all the stuff related to JLink - since there's no library supplied for the JLink on OS X.

After that it builds and produces an executable which fails with the following error:

runger@Richards-Pro build % ./MCUViewer                       
[2024-10-31 22:11:16.712] [logger] [info] Starting MCUViewer!
[2024-10-31 22:11:16.712] [logger] [info] Version: 1.0.1
[2024-10-31 22:11:16.712] [logger] [info] Commit hash 352e8f4192a528475d7ac5bb04e623f3f9b37adb
[2024-10-31 22:11:16.806] [logger] [info] GDB version: 152
2024-10-31 22:11:16.867 MCUViewer[11089:5680922] *** Assertion failure in -[NSMenu _setMenuName:], NSMenu.m:777

and then just hangs indefinitely.

A few questions:

Added libstlink.a which has been compiled on macos 13.5.2 (Ventura) for apple silicon

Is it still the case that there is the stlink library only for apple silicon? Should I add one for intel?

It seems most of the changes contained in this PR needed to make things compile on apple are already integrated?

On the other hand the addition of JLink support seems to have broken the apple compilation again. Can we make JLink an compile-time option?

@klonyyy
Copy link
Owner

klonyyy commented Nov 1, 2024

Hey! Thanks for the interest in the topic!

Is it still the case that there is the stlink library only for apple silicon? Should I add one for intel?

It seems the x86 version is in the repo already, however i'm not sure if its working.

It seems most of the changes contained in this PR needed to make things compile on apple are already integrated?

I think so - there might be some more changes needed to make it run though.

We sure can add the Jlink support - would you like to undertake this task? If so we could connect in some different way to discuss the plan ;)

@runger1101001
Copy link

Hey and thanks for your reply!

I think so - there might be some more changes needed to make it run though.

I'd like to give it a shot - I can use MCUViewer on my linux boxes or via Parallels, so its not urgent, but it would be cool to get it running on the Mac which I use most.

We sure can add the Jlink support - would you like to undertake this task? If so we could connect in some different way to discuss the plan ;)

My approach was actually to make the JLink optional, so we don't have to include it in Mac. I will do a quick search and see if the same lib is available on Mac, and if its license would allow us to distribute it. If so, I'm happy to give it a try to add it.

I'm happy to connect and have a chat about it, let me know if you have a preferred way? I'm pretty busy at the moment, travelling all next week, so any time after the 18.10 would work for me.

@cosmikwolf
Copy link

cosmikwolf commented Nov 7, 2024

The jlink libraries come with the J-Link Software and Documentation pack for mac:

libjlinkarm.dylib
libjlinkarm.7.dylib

@klonyyy
Copy link
Owner

klonyyy commented Nov 7, 2024

I'm happy to connect and have a chat about it, let me know if you have a preferred way? I'm pretty busy at the moment, travelling all next week, so any time after the 18.10 would work for me.

Great! Let's meet on a call after 18.10 then :) I'll write a private message so that we don't spam here.

Could you give me your email address? I cannot see any contact info in the Github profile.

@avangerp
Copy link

I created a fork (avangerp/MCUViewer-macos) and replaced the OpenGL backend with the Metal backend from imgui. I did the build for x86_64 using Rosetta 2 on my M2 Macbook because I had trouble compiling the stlink library for arm64.

I commented out all the jlink support because I saw the discussion in here and I don't have a jlink device to test/debug.

The build completes, tests pass, and I haven't had any issues using the ui.

I am not sure what it would look like to get the other backend support merged in here, but I am open to discussing and helping.

@klonyyy
Copy link
Owner

klonyyy commented Dec 4, 2024

Thank you very much for the work you've done! I will need some time to go through the changes, and maybe I'll be able to also use actions for creating the MacOS builds. Anyway I will most probably do it after the upcoming mid-December release ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
Status: Future
Development

Successfully merging this pull request may close these issues.

6 participants