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

没有 linux arm? #145

Open
a224327780 opened this issue Oct 3, 2022 · 5 comments
Open

没有 linux arm? #145

a224327780 opened this issue Oct 3, 2022 · 5 comments

Comments

@a224327780
Copy link

uname -a
Linux arm-sj 5.4.0-90-generic #101-Ubuntu SMP Fri Oct 15 20:02:26 UTC 2021 aarch64 aarch64 aarch64 GNU/Linux

root@arm-sj:/data/python/Imagine/bin/darwin/arm64# ./moz-cjpeg -version
-bash: ./moz-cjpeg: cannot execute binary file: Exec format error
root@arm-sj:/data/python/Imagine/bin/darwin/arm64# cd ../x64/
root@arm-sj:/data/python/Imagine/bin/darwin/x64# ./moz-cjpeg -version
-bash: ./moz-cjpeg: cannot execute binary file: Exec format error
@meowtec
Copy link
Owner

meowtec commented Oct 8, 2022

yes.
其实 Mac Arm64 的这几个二进制可执行文件也是 x64 的

@ghost
Copy link

ghost commented Oct 23, 2022

yes. 其实 Mac Arm64 的这几个二进制可执行文件也是 x64 的

Imagine/bin/darwin/arm64
├── cwebp
├── libjpeg.62.dylib
├── libpng16.16.dylib
├── moz-cjpeg
└── pngquant

0 directories, 5 files

这几个文件除了moz-cjpeg之外,其余几个我都从克隆原仓库到M1 Mac本地构建了arm64版本,请问moz-cjpeg是哪个开源仓库?我只找到mozjpeg仓库,构建好也只有libjpeg.62.dylib,arm64版作者需要的话我可以打包上传

之所以执着arm64,是之前在另外一个开源项目做过real-esrgan测试x86_64和arm64的执行效率,arm64处理在m1 max上快46%,因此想把imagine的可执行程序也都换成arm64提高处理效率

@ghost
Copy link

ghost commented Oct 24, 2022

bin.zip
arm64 版本的bin,替换仓库里的同名文件夹即可,m1 max实测可以正常运行,转换速度比x64稍快,图片越大越多,速度差异越明显

@ghost
Copy link

ghost commented Oct 29, 2022

bin for arm64.zip
重新更新下arm64的bin文件,亲测可用,且brew方式能尽可能在省力的前提下确保是最新版本的,获取方式如下,不放心bin.zip的同学可以通过brew自己获取,里面*****是你自己的username

# cwebp for arm64
brew install webp
cp /opt/homebrew/Cellar/webp/1.2.4/bin/cwebp /Users/*****/Downloads

# libpng16.16.dylib for arm64
brew install libpng
cp /opt/homebrew/Cellar/libpng/1.6.38/lib/libpng16.16.dylib /Users/*****/Downloads

# moz-cjpeg for arm64
brew install mozjpeg
cp /opt/homebrew/Cellar/mozjpeg/4.1.1/bin/cjpeg /Users/*****/Downloads
mv /Users/*****/Downloads/cjpeg /Users/*****/Downloads/moz-cjpeg

# pngquant for arm64
brew install pngquant
cp /opt/homebrew/Cellar/pngquant/2.17.0/bin/pngquant /Users/*****/Downloads

# libjpeg.62.dylib for arm64
cd Downloads
git clone --recurse-submodules https://github.com/mozilla/mozjpeg.git
cd mozjpeg
cmake -G"Unix Makefiles"
make all
cp /Users/*****/Downloads/mozjpeg/libjpeg.62.3.0.dylib /Users/*****/Downloads
mv /Users/*****/Downloads/libjpeg.62.3.0.dylib /Users/*****/Downloads/libjpeg.62.dylib

@ghost
Copy link

ghost commented Oct 29, 2022

bin for arm64.zip
重新更新下arm64的bin文件,亲测可用,且brew方式能尽可能在省力的前提下确保是最新版本的,获取方式如下,不放心bin.zip的同学可以通过brew自己获取,前提是apple芯片的mac,里面*****是你自己的username

# cwebp for arm64
brew install webp
cp /opt/homebrew/Cellar/webp/1.2.4/bin/cwebp /Users/*****/Downloads

# libpng16.16.dylib for arm64
brew install libpng
cp /opt/homebrew/Cellar/libpng/1.6.38/lib/libpng16.16.dylib /Users/*****/Downloads

# moz-cjpeg for arm64
brew install mozjpeg
cp /opt/homebrew/Cellar/mozjpeg/4.1.1/bin/cjpeg /Users/*****/Downloads
mv /Users/*****/Downloads/cjpeg /Users/*****/Downloads/moz-cjpeg

# pngquant for arm64
brew install pngquant
cp /opt/homebrew/Cellar/pngquant/2.17.0/bin/pngquant /Users/*****/Downloads

# libjpeg.62.dylib for arm64
cd Downloads
git clone --recurse-submodules https://github.com/mozilla/mozjpeg.git
cd mozjpeg
cmake -G"Unix Makefiles"
make all
cp /Users/*****/Downloads/mozjpeg/libjpeg.62.3.0.dylib /Users/*****/Downloads
mv /Users/*****/Downloads/libjpeg.62.3.0.dylib /Users/*****/Downloads/libjpeg.62.dylib

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@meowtec @a224327780 and others