-
Notifications
You must be signed in to change notification settings - Fork 67
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
run on M1 Apple Silicon Mac within Docker #154
Comments
I'm afraid not only are there issues with the Homebrew installer (which was designed before the M1 changed the directories), but if you have macOS 12.5 (Monterey), Python 2 is no longer available and I'm not sure how pdfsizeopt can work with Python 3 (requires code updates). Otherwise, one would have to install |
After spending quite a lot of time trying to set it up both on my M1 Mac and on an Ubuntu Linux installation on a virtual machine on that Mac, I have given up and now, every time I need the program, I start an old Intel Machine with a virtual Ubuntu Linux installation where I can run pdfsizeopt without any problems. What a pity that all those innovations cause good and stable programs not to work anymore … |
The key problem I found when trying to make it work natively, rather than in Docker, was that pdfsizeopt relies on an old version of Ghostscript-- and I couldn't find source code to this old version to compile on Apple Silicon. If you find the source, do post a link... |
In fact, I have now managed to get Approximate instructions (there may be things unique to my system that I have forgotten to note, and there are probably things that could be done better - but at least it works): Follow the usual installation instructions for MacOS. For ghostscript:
Apply this patch: (thanks to https://github.com/chrstphrchvz/macports-ports/blob/197bfa253db6d2dcb589197fa99d2bd19793fa10/print/ghostscript/files/patch-base_fapi_ft.c.diff ) i.e. insert the following lines at line 112 of
(
Copy |
@pripple: I was surprised that Docker on a Mac with Apple Silicon fails with Here is a workaround which works with a Mac with Apple Silicon:
Based on the workaround, I have updated the |
Thank you so much for resolving these issues! 🍻 I’ve been reading about your progress in my inbox with excitement, not having the knowledge or time to step in. I just tried the new binary install (without docker, as I wouldn’t need it for anything but pdfsizeopt) and the optimisation worked like a charm! Best regards, Lorenz |
Hi, I experience difficulties installing pdfsizeopt on an M1 (Apple Silicon) Mac. I have installed it successfully before on an Intel Mac, probably using Homebrew, but now it doesn’t work either with Homebrew or with Docker.
Homebrew
With Homebrew, the installation process for the dependency
pts/utils/sam2p
tries to copy a file to a folder with advanced privileges and quits with an error:cp: /usr/local/bin/sam2p: Operation not permitted
Homebrew binaries should be installed to a specific Homebrew directory, that’s probably why it doesn’t work.
Docker
I then tried the suggested installation with Docker. As VirtualBox isn’t available on Apple Silicon, I installed Docker Desktop. However, using the command you provide, I first get the
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
and even though I can overcome this by adding
--platform linux/amd64
to the command, I still get the error messageImportError: No module named site
Help, please!
Is there anyone who could tell me how to get pdfsizeopt running on a M1 (Apple Silicon) Mac?
Thanks,
Lorenz
The text was updated successfully, but these errors were encountered: