From e770aca29f26350ee06b0eaa1f4fa556c5ac8959 Mon Sep 17 00:00:00 2001 From: Huanchen Zhai Date: Fri, 3 Nov 2023 14:37:01 -0700 Subject: [PATCH] fix github workflow for amd cpu --- .github/workflows/build.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8a6e8ace..e68eac06 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -65,6 +65,21 @@ jobs: sudo make sudo cp lib/*.a /usr/lib + - name: fix mkl for amd cpu + if: matrix.os == 'ubuntu-20.04' + env: + CC: gcc-9 + CXX: g++-9 + run: | + lscpu + export CPUTYPE=$(lscpu | grep 'Vendor ID' | awk '{print $3}') + echo $CPUTYPE + if [ "$CPUTYPE" = "AuthenticAMD" ]; then + echo "int mkl_serv_intel_cpu_true() { return 1; }" > fixcpu.c + $CC -shared -fPIC -o libfixcpu.so fixcpu.c + export LD_PRELOAD=$PWD/libfixcpu.so + fi + - name: build gtest (macos) if: matrix.os == 'macos-12' run: |