Last active
March 8, 2024 12:16
-
-
Save zekefeu/afb29296db34d2451cdddcc14dbeef3c to your computer and use it in GitHub Desktop.
This script automates the installation of the Intel SDE, to fix compatibility issues with older CPU's that do not support the AVX2 instruction set. It fixes the "Illegal hardware instruction" error.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Solution provided by https://github.com/renhiyama | |
# (https://github.com/Jarred-Sumner/bun/issues/282#issuecomment-1177154684) | |
# License agreement | |
echo "The Intel Software Development Emulator is distributed under the Intel Software License Agreement, available at https://www.intel.com/content/dam/develop/external/us/en/documents/pdf/intel-simplified-software-license-version-august-2021.pdf" | |
echo "" | |
echo "If you do not accept the terms of the license agreement, you have 10 seconds to stop this script (Ctrl+C)" | |
sleep 10 | |
# Create directories | |
[ ! -d /tmp/bun-sde-fix ] && mkdir /tmp/bun-sde-fix | |
[ ! -d ~/.sde ] && mkdir ~/.sde | |
echo "Downloading SDE package" && \ | |
curl -sS https://downloadmirror.intel.com/732268/sde-external-9.7.0-2022-05-09-lin.tar.xz -o /tmp/bun-sde-fix/sde-package.tar.xz && \ | |
echo "Extracting into ~/.sde" && \ | |
tar -xf /tmp/bun-sde-fix/sde-package.tar.xz --strip-components=1 -C ~/.sde | |
# Create aliases | |
[ -f ~/.bashrc ] && echo '[ -d ~/.sde ] && alias bun="~/.sde/sde -chip-check-disable -- bun"' >> ~/.bashrc | |
[ -f ~/.zshrc ] && echo '[ -d ~/.sde ] && alias bun="~/.sde/sde -chip-check-disable -- bun"' >> ~/.zshrc | |
alias bun="~/.sde/sde -chip-check-disable -- bun" | |
echo "The default supported shells are bash and zsh." | |
echo 'For other shells, add [ -d ~/.sde ] && alias bun="~/.sde/sde -chip-check-disable -- bun" to the config file.' | |
echo "When the issue will be fixed, remove ~/.sde." | |
rm -rf /tmp/bun-sde-fix | |
echo "Done, thank you." | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Fixed here https://gist.github.com/spidyhackx/194108a0df2b4fc8df642f126edcc0e5