question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support macOS ARM64 (Apple Silicon)

See original GitHub issue

Is your feature request related to a problem? Please describe

Not a problem. Enhancement.

Describe the solution you’d like

  • Generate a build variant for osx-arm64.

Describe alternatives you’ve considered

None available

Additional context

If the build system for the native shared libraries uses the XCode toolchain on macOS, this enhancement should be trivial to produce.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:26 (9 by maintainers)

github_iconTop GitHub Comments

3reactions
timdinhdotcomcommented, Nov 11, 2021

I have an Apple M1 and a project that utilize Magick.NET. I’m getting an error at runtime and was hoping someone can point me to the right direction to resolve.

Please note: we only get the error when running on dotnet 6.0 with Apple M1. Running on dotnet 5.0 with x64 is fine.

In my csproj file, I have the following defined

<PackageReference Include="Magick.NET.Core" Version="8.3.3" />
<PackageReference Include="Magick.NET-Q8-AnyCPU" Version="8.3.3" />

At rumtime, we get this error

Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware: Error: An unhandled exception has occurred while executing the request.

System.TypeInitializationException: The type initializer for 'NativeMagickSettings' threw an exception.
 ---> System.DllNotFoundException: Unable to load shared library 'Magick.Native-Q8-x64.dll' or one of its dependencies. In order to help diagnose loading problems, consider setting the DYLD_PRINT_LIBRARIES environment variable: dlopen(libMagick.Native-Q8-x64.dll, 0x0001): tried: 'libMagick.Native-Q8-x64.dll' (no such file), '/usr/local/lib/libMagick.Native-Q8-x64.dll' (no such file), '/usr/lib/libMagick.Native-Q8-x64.dll' (no such file), '/Users/tiendinh/Projects/oraid/OraIdApi/OraIdApi/libMagick.Native-Q8-x64.dll' (no such file), '/usr/local/lib/libMagick.Native-Q8-x64.dll' (no such file), '/usr/lib/libMagick.Native-Q8-x64.dll' (no such file)
   at ImageMagick.Environment.NativeMethods.X64.Environment_Initialize()
   at ImageMagick.Environment.NativeEnvironment.Initialize() in /_/src/Magick.NET/Native/Helpers/Environment.cs:line 47
   at ImageMagick.Environment.Initialize() in /_/src/Magick.NET/Helpers/Environment.cs:line 19
   at ImageMagick.MagickSettings.NativeMagickSettings..cctor() in /_/src/Magick.NET/Native/Settings/MagickSettings.cs:line 230
   --- End of inner exception stack trace ---
   at ImageMagick.MagickSettings.NativeMagickSettings..ctor() in /_/src/Magick.NET/Native/Settings/MagickSettings.cs:line 246
   at ImageMagick.MagickSettings..ctor() in /_/src/Magick.NET/Settings/MagickSettings.cs:line 33
   at ImageMagick.MagickImage..ctor() in /_/src/Magick.NET/MagickImage.cs:line 39
   at ImageMagick.MagickImage..ctor(Stream stream) in /_/src/Magick.NET/MagickImage.cs:line 187

The line of code that throw the error is

var image = new MagickImage(stream);

It looks like it trying to find the file Magick.Native-Q8-x64.dll. Not sure why, our project is referencing Magick.NET-Q8-AnyCPU

2reactions
JunielKatarncommented, Sep 28, 2021

Is it possible to build Magick.NET and Magick.Native locally for arm64?

It very much should. Assuming @dlemstra uses “standard” macOS tools to build the native bits, it should be pretty simple to just add the arm64 target and it should build the same.

For building, you don’t even need an Apple Silicon machine; just their latest OS (Big Sur).

I may take a stab at it this week.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Mac computers with Apple silicon
Mac computers with Apple silicon: MacBook Pro introduced in 2021 or later, plus MacBook Pro (13-inch, M1, 2020); MacBook Air introduced in ...
Read more >
Porting Your macOS Apps to Apple Silicon
Overview. Port your existing macOS app to Apple silicon by creating a universal binary and modifying your code to handle architectural differences.
Read more >
Addressing Architectural Differences in Your macOS Code
Fix problems that stem from architectural differences between Apple silicon and Intel-based Mac computers.
Read more >
Building a Universal macOS Binary
A universal binary runs natively on both Apple silicon and Intel-based Mac computers, ... Universal macOS apps support the arm64 and x86_64 architectures, ......
Read more >
Mac transition to Apple silicon
All Apple apps included with macOS Big Sur are compatible with x86-64 and ARM architectures. Many third-party apps are similarly being made dual-platform, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found