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

FR: M1 support #1327

Open
kr15uk opened this issue Jun 18, 2021 · 40 comments
Open

FR: M1 support #1327

kr15uk opened this issue Jun 18, 2021 · 40 comments
Labels
help wanted Someone can do the work and submit a pull request?

Comments

@kr15uk
Copy link

kr15uk commented Jun 18, 2021

Feature Request: M1 AppleSilicone aka ARM support, PrusaSlicer does that from v2.3.1 so should be piece of cake, maybe?! Thanks.

@supermerill
Copy link
Owner

supermerill commented Jun 18, 2021

I don' know how to compile for it. I don't have a mac either.
Also Apple forbid me to create a macos vm on a not-macos os.

@supermerill supermerill added the help wanted Someone can do the work and submit a pull request? label Jun 18, 2021
@boardthatpowder
Copy link

On my M1 Superslicer sometimes crashed, but most times it would hang forever when attempting to slice. I followed the instructions from https://github.com/supermerill/SuperSlicer/blob/master/.github/workflows/ccpp_mac.yml to build from source as a workaround, and happy to report all working no issues. The only thing I changed in the instructions was the target osx version.

@supermerill
Copy link
Owner

If you want to share your natively compiled release i can add it to the release page.
I hope that github will add m1 vms quickly.

@dianlight
Copy link

@boardthatpowder what version CMAKE_OSX_DEPLOYMENT_TARGET do you use for compiling in m1 native?

@hoppelfuss
Copy link

Just use the latest version 11.5.2, works perfectly fine.

@RayPS
Copy link

RayPS commented Oct 25, 2021

On my M1 Superslicer sometimes crashed, but most times it would hang forever when attempting to slice. I followed the instructions from https://github.com/supermerill/SuperSlicer/blob/master/.github/workflows/ccpp_mac.yml to build from source as a workaround, and happy to report all working no issues. The only thing I changed in the instructions was the target osx version.

Hi, I having trouble on building because of a dependency error of QT5Core, can you share you compile? Thanks!

@hoppelfuss
Copy link

@RayPS
Copy link

RayPS commented Oct 25, 2021

Sure! I hope it will work!

https://github.com/hoppelfuss/superslicer-apple-m1/blob/69656800adab0cf5e454d8731fb16a3fb4d072a9/SuperSlicer.zip

Thank you! It works smooth and perfectly!

@thatguychad
Copy link

thatguychad commented Oct 25, 2021

Sure! I hope it will work!

https://github.com/hoppelfuss/superslicer-apple-m1/blob/69656800adab0cf5e454d8731fb16a3fb4d072a9/SuperSlicer.zip

This gives me an error when launching that the file is damaged (the app, not the zip or the dmg). I re-downloaded it and had the same issue (MacBook Pro M1, MacOS 12.0.1).

@hoppelfuss
Copy link

Sure! I hope it will work!
https://github.com/hoppelfuss/superslicer-apple-m1/blob/69656800adab0cf5e454d8731fb16a3fb4d072a9/SuperSlicer.zip

This gives me an error when launching that the file is damaged (the app, not the zip or the dmg). I re-downloaded it and had the same issue (MacBook Pro M1, MacOS 12.0.1).

This was compiled on MacOS 11.52 iirc, that might be the problem.

@RayPS
Copy link

RayPS commented Oct 25, 2021

@thatguychad

Run this in terminal:

xattr -cr /Applications/SuperSlicer.app

@thatguychad
Copy link

@thatguychad

Run this in terminal:

xattr -cr /Applications/SuperSlicer.app

That worked, thanks!

@samwiseg0
Copy link

Here is version 2.3.57.6 compiled for arm MacOS (11.6).

https://www.dropbox.com/sh/34syqj6e7c20mz6/AAA097uOTzWH7Ih8kqJkgtxWa?dl=0

@jallen810
Copy link

Has anyone tried to build for MacOS 12.x?? I just got a 14" MBP M1Pro. I'm currently running SS with the normal Mac build and it seems fine but I'm curious if there would be advantages to installing the native code? TIA

@samwiseg0
Copy link

Has anyone tried to build for MacOS 12.x?? I just got a 14" MBP M1Pro. I'm currently running SS with the normal Mac build and it seems fine but I'm curious if there would be advantages to installing the native code? TIA

The ones I built in the comment above yours should work just fine.

@radaiko
Copy link

radaiko commented Dec 12, 2021

@thatguychad

Run this in terminal:

xattr -cr /Applications/SuperSlicer.app

This should be in the release notes for 2.3.57.7.

@spuder
Copy link

spuder commented Dec 13, 2021

I tried the builds, but they show as corrupt for me #2055

@radaiko
Copy link

radaiko commented Dec 13, 2021

I tried the builds, but they show as corrupt for me #2055

Look at my comment. You have to run the terminal command when switching from INTEL to APPLE Silicon version.

@jallen810
Copy link

jallen810 commented Dec 21, 2021

I tried the builds, but they show as corrupt for me #2055

Look at my comment. You have to run the terminal command when switching from INTEL to APPLE Silicon version.

Sorry for the delay, finally got around to downloading the latest Stable (Sanjay Ver) and today's nightly. After running the xattr -cr /Applications/SuperSlicer.app terminal command in terminal as suggested. I am also still getting the "app is corrupt, you should delete it" error. Has anyone made any progress on this front? I read in the #2055 that we might need to have SS certified under an Apple Dev credentials, is that the reason we can't run this? (Sorry not an AppDev) trying to learn a little bit about this to understand the issue

@samwiseg0
Copy link

@jallen810 It does indeed work after running that command. Are you sure you are installing it to you application folder and running that version after you run the command?

Keep in mind that if the image is still mounted finder will try and launch the one in the image instead of the one in your application folder if you search for it in spotlight.

@kr15uk
Copy link
Author

kr15uk commented Dec 21, 2021

M1 2020 MBP Monterey clean install, downloaded DMG, app dumped in Applications, xattr command on app, right click open and all good. Make sure you haven't done "keep both" when copied across and xattr is pointing at the app copy you are trying to run, also it's copied locally and not run from DMG.

@jallen810
Copy link

@jallen810 It does indeed work after running that command. Are you sure you are installing it to you application folder and running that version after you run the command?

Keep in mind that if the image is still mounted finder will try and launch the one in the image instead of the one in your application folder if you search for it in spotlight.

I figured it out. I'm a dumb dumb, I have several versions installed and I post-script the name as "SuperSlicer.ARM12.20.21" so I had to adjust the terminal command to match... now it works fine. Thanks guys

@mikhailbot
Copy link

Attempted to run ./BuildMacOS.sh -ia on the 23dc9d0 which is what 2.3.57.9 was tagged against but getting the below error, anything to try?

Mac Mini M1 on macOS 12.1

$ xattr -cr /Applications/SuperSlicer.app

$ open /Applications/SuperSlicer.app     
The application cannot be opened for an unexpected reason, error=Error Domain=NSOSStatusErrorDomain Code=-10827 "kLSNoExecutableErr: The executable is missing" UserInfo={_LSLine=3829, _LSFunction=_LSOpenStuffCallLocal}

@supermerill
Copy link
Owner

I don't know. I can only debug when building from intel cpu. Someone with an arm one can debug?

@samwiseg0
Copy link

samwiseg0 commented Jan 30, 2022

Attempted to run ./BuildMacOS.sh -ia on the 23dc9d0 which is what 2.3.57.9 was tagged against but getting the below error, anything to try?

Mac Mini M1 on macOS 12.1

$ xattr -cr /Applications/SuperSlicer.app



$ open /Applications/SuperSlicer.app     

The application cannot be opened for an unexpected reason, error=Error Domain=NSOSStatusErrorDomain Code=-10827 "kLSNoExecutableErr: The executable is missing" UserInfo={_LSLine=3829, _LSFunction=_LSOpenStuffCallLocal}

Not sure what your issue might be but it does build and run fine on arm based macs.

You can find a working arm build here https://www.dropbox.com/sh/34syqj6e7c20mz6/AAA097uOTzWH7Ih8kqJkgtxWa?dl=0

You may need to run through each build command manually to see where the error may be.

@mikhailbot
Copy link

mikhailbot commented Feb 5, 2022

Thanks for that, will try it slowly when I have time--I grabbed the prebuilt one and it runs much smoother and faster!

Is there any CI/CD provider that supports Apple Silicone yet? Or maybe we need to chip in to get @supermerill an M1!

@tkodev
Copy link

tkodev commented Feb 11, 2022

@thatguychad

Run this in terminal:

xattr -cr /Applications/SuperSlicer.app

Is this something that can be incorporated into the build process? (I'm assuming this project uses some kind of build pipeline?)

@tkodev
Copy link

tkodev commented Feb 11, 2022

Thanks for that, will try it slowly when I have time--I grabbed the prebuilt one and it runs much smoother and faster!

Is there any CI/CD provider that supports Apple Silicone yet? Or maybe we need to chip in to get @supermerill an M1!

Apple silicone :p

I know of several but it is likely better if we see if the existing CI/CD service used (assuming there is one) supports it.

I worked with Microsoft AppCenter to build iOS applications - possibly a service we can research into

@supermerill
Copy link
Owner

HI
With the 2.4, i have a bit of difficulties to build for arm.
It's the boost::locale that doesn't find the iconv lib anymore

here is a little part of the build log for 2.4:


2022-02-21T11:50:20.2783580Z Performing configuration checks
2022-02-21T11:50:20.2845870Z 
2022-02-21T11:50:20.2949200Z     - default address-model    : 64-bit (cached)
2022-02-21T11:50:20.3050530Z     - default architecture     : x86 (cached)
2022-02-21T11:50:20.3511100Z     - has stat::st_mtim        : no  (cached)
2022-02-21T11:50:20.3525240Z     - has stat::st_mtimensec   : no  (cached)
2022-02-21T11:50:20.3627100Z     - has stat::st_mtimespec   : yes (cached)
2022-02-21T11:50:20.3634000Z     - has stat::st_birthtim    : no  (cached)
2022-02-21T11:50:20.3642570Z     - has stat::st_birthtimensec : no  (cached)
2022-02-21T11:50:20.3656220Z     - has stat::st_birthtimespec : yes (cached)
2022-02-21T11:50:20.3657070Z     - has statx                : no  (cached)
2022-02-21T11:50:20.3657660Z     - has statx syscall        : no  (cached)
2022-02-21T11:50:20.4061070Z     - zlib                     : no  (cached)
2022-02-21T11:50:20.4119590Z     - bzip2                    : no  (cached)
2022-02-21T11:50:20.4130820Z     - lzma                     : no  (cached)
2022-02-21T11:50:20.4164540Z     - zstd                     : no  (cached)
2022-02-21T11:50:20.4243210Z     - lzma                     : no  (cached)
2022-02-21T11:50:20.4329780Z     - has_lzma_cputhreads builds : no  (cached)
2022-02-21T11:50:20.4659460Z     - iconv (libc)             : no  (cached)
2022-02-21T11:50:20.4760800Z     - iconv (separate)         : no  (cached)
2022-02-21T11:50:20.4862320Z - Boost.Locale needs either iconv or ICU library to be built.
2022-02-21T11:50:20.4963830Z -- Performing Test OPENEXR_IMF_HAVE_SYSCONF_NPROCESSORS_ONLN - Success
2022-02-21T11:50:20.5065850Z -- Performing Test OPENEXR_IMF_HAVE_GCC_INLINE_ASM_AVX
2022-02-21T11:50:20.5167260Z - Boost.Locale needs either iconv or ICU library to be built.

and here is the one from 2.3.57:

2022-02-13T19:33:26.1187120Z     - iconv (libc)             : no
2022-02-13T19:33:26.2780640Z     - iconv (separate)         : yes
[...]
2022-02-13T19:43:02.9475210Z -- Found Iconv: /Applications/Xcode_13.2.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/lib/libiconv.tbd

I searched, and the iconv lib is still here. But it's not found or useable anymore. Maybe because the boost version has changed...
I tried some things to be able to have a good iconv (trying things via brew like for zstd) but no luck so far.
Do you have some input to share? @claytono @samwiseg0

Pusa is now outputting a "universal" dmg. Do you know how to compile one?

@claytono
Copy link

I looked at how Prusa does this and I can't find any information about how they build those binaries. The easiest option would be to build both the M1 and x86 binaries and glue them together at the end of the build using lipo.

As far as the build problems above, this does sound familiar. What branch are you testing on?

@supermerill
Copy link
Owner

supermerill commented Feb 22, 2022

I'm testing on master_dev

@claytono
Copy link

I did manage to build this for arm, with no libiconv issues. I did run into a separate issue, I get an error when linking the final binary saying that Slicr is a directory that already exists. It is true that there is a directory named slicr in the build directory, and since MacOS FS is case insensitive, it can't create the binary. In the short term I've worked around it by having it link to Slicr.bin.

Are you building for arm or x86? I'll try an x86 cross compile in a bit. I don't have an x86 mac anymore, but probably will in a few days.

@supermerill
Copy link
Owner

supermerill commented Feb 22, 2022

It's a cross-compile, yes. Using the macos-11 github VM.

For the slic3r problem, maybe an error on my side, forgetting to rename it.

@claytono
Copy link

Ok, that makes sense. I've reproduced it locally doing a cross-compile. I do remember seeing something like this when I was doing the initial work, so hopefully looking into it will remind me of the previous issue.

@claytono
Copy link

I haven't determined why, but it appears that only the linkflags are being passed into b2 when configuring boost, and the cflags variants are being left out:

cd /Users/coneill/dist/SuperSlicer/deps/build/dep_Boost-prefix/src/dep_Boost && ./b2 cflags=-fPIC cxxflags=-fPIC "linkflags=-arch x86_64" -j10 --with-system --with-iostreams --with-filesystem --with-thread --with-log --with-locale --with-regex --with-date_time --layout=versioned --debug-configuration toolset=clang address-model=64 link=static threading=multi boost.locale.icu=off --disable-icu release stage

the cflags/cxxflags should have -arch x86_64 here like the linkflags do.

@claytono
Copy link

The problem is this block:

set(_boost_flags "")
if (UNIX)
set(_boost_flags "cflags=-fPIC;cxxflags=-fPIC")
elseif(APPLE)
set(_boost_flags
"cflags=-fPIC ${_arch_flags} -mmacosx-version-min=${DEP_OSX_TARGET};"
"cxxflags=-fPIC ${_arch_flags} -mmacosx-version-min=${DEP_OSX_TARGET};"
"mflags=-fPIC ${_arch_flags} -mmacosx-version-min=${DEP_OSX_TARGET};"
"mmflags=-fPIC ${_arch_flags} -mmacosx-version-min=${DEP_OSX_TARGET}")
endif()

Because UNIX is true on MacOS, the APPLE block never gets run. The fix is to reverse the order of the test like this:

@@ -109,14 +109,14 @@ if (IS_CROSS_COMPILE AND APPLE)
 endif ()

 set(_boost_flags "")
-if (UNIX)
-    set(_boost_flags "cflags=-fPIC;cxxflags=-fPIC")
-elseif(APPLE)
+if(APPLE)
     set(_boost_flags
         "cflags=-fPIC ${_arch_flags} -mmacosx-version-min=${DEP_OSX_TARGET};"
         "cxxflags=-fPIC ${_arch_flags} -mmacosx-version-min=${DEP_OSX_TARGET};"
         "mflags=-fPIC ${_arch_flags} -mmacosx-version-min=${DEP_OSX_TARGET};"
         "mmflags=-fPIC ${_arch_flags} -mmacosx-version-min=${DEP_OSX_TARGET}")
+elseif (UNIX)
+    set(_boost_flags "cflags=-fPIC;cxxflags=-fPIC")
 endif()

 set(_build_cmd ${_build_cmd}

That gets boost to cross compiling properly, but I'm still seeing other libraries like libjpeg that look to also be failing due to missing arch flags. I haven't had time to look into that.

@sammcj
Copy link

sammcj commented Apr 10, 2023

It looks like the latest builds (nightly included) are still intel only.

  • Is there anything I can do to help test builds for this?

@sammcj
Copy link

sammcj commented Apr 15, 2023

I had a crack at doing a build for Apple Silicon/ARM but ended up with so many errors I couldn't get it to work 🥲, if anyone has a build of the latest version please share it and I'll do some testing.

@thatguychad
Copy link

I had a crack at doing a build for Apple Silicon/ARM but ended up with so many errors I couldn't get it to work 🥲, if anyone has a build of the latest version please share it and I'll do some testing.

I was able to build 2.5.59.2 on my M1 MacBook Pro without issue, what are you getting hung up on? What does "brew doctor" say?

@sammcj
Copy link

sammcj commented Apr 19, 2023

@thatguychad interesting - I must be doing something wrong then 🤔.

There's a lot of problems but I don't want to hijack this thread - I see this repo has discussions enabled so I might start a thread there although I see someone has done a build and uploaded it already which I must just use - #3692

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Someone can do the work and submit a pull request?
Projects
None yet
Development

No branches or pull requests