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

M1 compat #153

Merged
merged 3 commits into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion 3rd_party/bergamot-translator
23 changes: 20 additions & 3 deletions cmake/fix_ruy_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,24 @@ INCLUDE_PATH=I${SRC_PATH}/3rd_party/bergamot-translator/3rd_party/marian-dev/src

cd ${BUILD_DIR}

# mac sed is different from GNU sed...
# Find out the OS
unameOut="$(uname -s)"
case "${unameOut}" in
Linux*) machine=Linux;;
Darwin*) machine=Mac;;
CYGWIN*) machine=Cygwin;;
MINGW*) machine=MinGw;;
*) machine="UNKNOWN:${unameOut}"
esac

# Remove the extra include path
grep -R ${INCLUDE_PATH} | cut -d ":" -f1 | xargs sed -i "s\\-${INCLUDE_PATH}\\\\g"
# There's a /profiler in one of them that is not captured, so remove it manually
grep -R " /profiler " | cut -d ":" -f1 | xargs sed -i "s\\ /profiler \\\\g"
if [ "$machine" = "Mac" ]; then
grep -R ${INCLUDE_PATH} | cut -d ":" -f1 | xargs sed -i '' -e "s#-${INCLUDE_PATH}##g"
# There's a /profiler in one of them that is not captured, so remove it manually
grep -R " /profiler " | cut -d ":" -f1 | xargs sed -i '' -e "s# /profiler ##g"
else
grep -R ${INCLUDE_PATH} | cut -d ":" -f1 | xargs sed -i "s\\-${INCLUDE_PATH}\\\\g"
# There's a /profiler in one of them that is not captured, so remove it manually
grep -R " /profiler " | cut -d ":" -f1 | xargs sed -i "s\\ /profiler \\\\g"
fi
4 changes: 2 additions & 2 deletions dist/cpu_feature.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ if [ "$machine" = "Linux" ]; then
elif grep -q ssse3 /proc/cpuinfo; then
echo "ssse3"
else
echo "old_or_non_x86"
echo `uname -m`
fi
elif [ "$machine" = "Mac" ]; then
if /usr/sbin/sysctl -n machdep.cpu.features machdep.cpu.leaf7_features | grep -q AVX512; then
Expand All @@ -32,7 +32,7 @@ elif [ "$machine" = "Mac" ]; then
elif /usr/sbin/sysctl -n machdep.cpu.features machdep.cpu.leaf7_features | grep -q SSSE3; then
echo "ssse3"
else
echo "old_or_non_x86"
echo `uname -m`
fi
else
echo "Unsupported platform"
Expand Down
Loading