From d2894778aac7d27ba78118354e3b1bc098948872 Mon Sep 17 00:00:00 2001 From: Nikolay Bogoychev Date: Tue, 19 Sep 2023 21:21:47 +0100 Subject: [PATCH 1/3] Tidy up scripts to work on mac --- cmake/fix_ruy_build.sh | 23 ++++++++++++++++++++--- dist/cpu_feature.sh | 4 ++-- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/cmake/fix_ruy_build.sh b/cmake/fix_ruy_build.sh index 7c1c5a3..8dce900 100755 --- a/cmake/fix_ruy_build.sh +++ b/cmake/fix_ruy_build.sh @@ -9,7 +9,24 @@ INCLUDE_PATH=I${SRC_PATH}/3rd_party/bergamot-translator/3rd_party/marian-dev/src cd ${BUILD_DIR} +# mac grep is different from GNU grep... +# 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 diff --git a/dist/cpu_feature.sh b/dist/cpu_feature.sh index 658bf02..cf4c911 100755 --- a/dist/cpu_feature.sh +++ b/dist/cpu_feature.sh @@ -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 @@ -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" From f6468d4d56034f48bcf2f1334555f1a4e551ee17 Mon Sep 17 00:00:00 2001 From: Nikolay Bogoychev Date: Tue, 19 Sep 2023 21:31:41 +0100 Subject: [PATCH 2/3] grep -> sed --- cmake/fix_ruy_build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/fix_ruy_build.sh b/cmake/fix_ruy_build.sh index 8dce900..328f9ab 100755 --- a/cmake/fix_ruy_build.sh +++ b/cmake/fix_ruy_build.sh @@ -9,7 +9,7 @@ INCLUDE_PATH=I${SRC_PATH}/3rd_party/bergamot-translator/3rd_party/marian-dev/src cd ${BUILD_DIR} -# mac grep is different from GNU grep... +# mac sed is different from GNU sed... # Find out the OS unameOut="$(uname -s)" case "${unameOut}" in From 7b5ebb5b0f569d309dd3399e5892d539c5ac1ade Mon Sep 17 00:00:00 2001 From: Nikolay Bogoychev Date: Wed, 20 Sep 2023 11:16:50 +0100 Subject: [PATCH 3/3] Update submodule --- 3rd_party/bergamot-translator | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/3rd_party/bergamot-translator b/3rd_party/bergamot-translator index 0b069ac..321be8a 160000 --- a/3rd_party/bergamot-translator +++ b/3rd_party/bergamot-translator @@ -1 +1 @@ -Subproject commit 0b069acce6076bf6d01d6fab132a332ca26ef076 +Subproject commit 321be8ae0486de3af67307c4cb2e005994593597