From 6d336487ff55dcaf97c160e2892b99ac93dfa842 Mon Sep 17 00:00:00 2001 From: Darshal Shetty Date: Sat, 2 Nov 2024 12:48:46 -0400 Subject: [PATCH] Add POCL fix --- .github/workflows/ci.yml | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eb08e63..4bc97c8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,16 +26,32 @@ jobs: - name: Install Intel OpenCL Runtime run: | # download the key to system keyring - wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB \ - | gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null + #wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB \ + #| gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null # add signed entry to apt sources and configure the APT client to use Intel repository: - echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list + #echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list sudo apt update #sudo apt-get install -y pocl-opencl-icd intel-oneapi-runtime-opencl - sudo apt-get install -y intel-oneapi-runtime-opencl + sudo apt-get install -y pocl-opencl-icd + - name: Fix POCL + # Fix from https://github.com/joanbm/lib842/blob/a82d393678fea9e56fb610bc1acf4068f88ca7e4/.github/workflows/build-and-test.yml#L65 + run: | + cat << EOF > pocl-hack.c + #include + struct FakeStringRef { + const char *data; + size_t len; + }; + struct FakeStringRef _ZN4llvm3sys14getHostCPUNameEv() { + return (struct FakeStringRef){ .data = "x86-64", .len = 6 }; + } + EOF + + $CC pocl-hack.c -fPIC -shared -o pocl-hack.so + echo "LD_PRELOAD=$PWD/pocl-hack.so" >> $GITHUB_ENV - uses: Bogdanp/setup-racket@v1.9.1 with: architecture: x64