diff options
author | EndlessEden | 2021-02-06 20:58:38 +1100 |
---|---|---|
committer | EndlessEden | 2021-02-06 20:58:38 +1100 |
commit | 39cc9a400f8301a31b7f2eed33be9e7dec5bbf99 (patch) | |
tree | 48506f4a49df4631dfa640864d323fbfb5f3f427 | |
parent | 1469b13d11130a9d12f6dc55ec5e540d58a2c70a (diff) | |
download | aur-39cc9a400f8301a31b7f2eed33be9e7dec5bbf99.tar.gz |
aarch64/armv7/armv8 compatibility
-rw-r--r-- | PKGBUILD | 109 |
1 files changed, 96 insertions, 13 deletions
@@ -31,21 +31,104 @@ source=("git+https://github.com/ARM-software/ComputeLibrary.git") sha1sums=('SKIP') build() { + +NEON=0 +case "$CARCH" in + + armv7h) HARCH='armv7a' + if [ $(cat /proc/cpuinfo | grep "Features" | grep -c "neon") -gt "0" ]; then + NEON=1 + else + NEON=0 + fi + ;; + + armv8h) HARCH="$CARCH" + if [ $(cat /proc/cpuinfo | grep "Features" | grep -c "neon") -gt "0" ]; then + NEON=1 + else + NEON=0 + fi + if [ $(cat /proc/cpuinfo | grep "CPU architecture" | tail -1 | sed 's/CPU architecture: //g') == '8.6' ]; then + HARCH='armv8.6-a' + fi + if [ $(cat /proc/cpuinfo | grep "CPU architecture" | tail -1 | sed 's/CPU architecture: //g') == '8.2' ]; then + if [ $(cat /proc/cpuinfo | grep "Features" | grep -c "sve") -gt "0" ]; then + HARCH='armv8.2-a-sve' + else + HARCH='armv8.2-a' + fi + fi + if [ $(cat /proc/cpuinfo | grep "CPU architecture" | tail -1 | sed 's/CPU architecture: //g') == '8' ]; then + HARCH='armv8a' + fi + if [ $HARCH == $CARCH ]; then + echo "Incompatible Arm Architecture. Only Arm version 8 is supported, Please verify your Arm Architecture Version is between 8 and 8.6 on $CARCH." + exit 1 + fi + ;; + + aarch64)HARCH="$CARCH" + if [ $(cat /proc/cpuinfo | grep "Features" | grep -c "neon") -gt "0" ]; then + NEON=1 + else + NEON=0 + fi + if [ $(cat /proc/cpuinfo | grep "CPU architecture" | tail -1 | sed 's/CPU architecture: //g') == '8.6' ]; then + echo "Incompatible Arm Architecture. Arm64 is not compatible with Arm Archtectures greater than 8.2 at this time." + exit 1 + fi + if [ $(cat /proc/cpuinfo | grep "CPU architecture" | tail -1 | sed 's/CPU architecture: //g') == '8.2' ]; then + if [ $(cat /proc/cpuinfo | grep "Features" | grep -c "sve") -gt "0" ]; then + HARCH='arm64-v8.2-a-sve' + else + HARCH='arm64-v8.2-a' + fi + fi + if [ $(cat /proc/cpuinfo | grep "CPU architecture" | tail -1 | sed 's/CPU architecture: //g') == '8' ]; then + HARCH='arm64-v8a' + fi + if [ $HARCH == $CARCH ]; then + echo "Incompatible Arm Architecture. Only Arm version 8 is supported, Please verify your Arm Architecture Version is between 8 and 8.2 on $CARCH." + exit 1 + fi + ;; +esac + cd "${srcdir}/ComputeLibrary" git checkout "v$pkgver" - scons -j`cat /proc/cpuinfo | grep -i "processor" | wc -l` \ - os=linux arch=$CARCH build=native \ - Werror=0 debug=0 asserts=0 \ - neon=1 \ - opencl=1 gles_compute=1 embed_kernels=1 \ - examples=0 \ - set_soname=0 \ - openmp=1 cppthreads=1 \ - pmu=1 \ - mali=1 \ - validation_tests=0 \ - benchmark_tests=0 \ - extra_cxx_flags="-fPIC" + if [ $NEON = "1" ]; then + + scons -j`cat /proc/cpuinfo | grep -i "processor" | wc -l` \ + os=linux arch=$HARCH build=native \ + Werror=0 debug=0 asserts=0 \ + neon=1 \ + opencl=1 gles_compute=1 embed_kernels=1 \ + examples=0 \ + set_soname=0 \ + openmp=1 cppthreads=1 \ + pmu=1 \ + mali=1 \ + validation_tests=0 \ + benchmark_tests=0 \ + extra_cxx_flags="-fPIC" + + else + + scons -j`cat /proc/cpuinfo | grep -i "processor" | wc -l` \ + os=linux arch=$HARCH build=native \ + Werror=0 debug=0 asserts=0 \ + neon=0 \ + opencl=1 gles_compute=1 embed_kernels=1 \ + examples=0 \ + set_soname=0 \ + openmp=1 cppthreads=1 \ + pmu=1 \ + mali=1 \ + validation_tests=0 \ + benchmark_tests=0 \ + extra_cxx_flags="-fPIC" + fi } #check() {} |