2
0
Эх сурвалжийг харах

Script updates for squish-ccr on Linux aarch64 (ARM64) (#192)

* Enable Docker support for squish-ccr
* Updates to support arm64 (through neon)
* Enable cross compilation for aarch64 on an amd64 machine
* Add squish-ccr to the linux-aarch64 package list and small tab fix
* Add copying of license file from sse2neon to the package
* Update Findsquish-ccr.cmake based on PR review
* Updated 'custom_build_cmd' and 'custom_install_cmd' to use the list as a command + optional arguments list to reduce unnecessary scripts per platform
* Updated 'custom_build_cmd' for squish to use the new arguments and removed unnecessary build-linux-*.sh scripts
* Updated the QT build_config.json scripts use of 'custom_build_cmd' to eliminate a call to 'install_windows_extras.py' and use the built-in 'additional_download_packages' instead
* Replace manual command line construction + quoting with shlex
* Add the printing of the docker run command (interactively) to troubleshoot if an error occurs within the docker container

Signed-off-by: Steve Pham <[email protected]>
Steve Pham 2 жил өмнө
parent
commit
d7e733200b

+ 27 - 16
Scripts/extras/pull_and_build_from_git.py

@@ -14,6 +14,7 @@ import os
 import pathlib
 import platform
 import re
+import shlex
 import shutil
 import string
 import subprocess
@@ -91,13 +92,18 @@ The following keys can only exist at the target platform level as they describe
 
 * cmake_build_args                        : Additional build args to pass to cmake during the cmake build command
 
-* custom_build_cmd                        : A list of custom scripts to run to build from the source that was pulled from git. This option is
-                                            mutually exclusive from the cmake_generate_args and cmake_build_args options.
+* custom_build_cmd                        : A custom build script and arguments to build from the source that was pulled from git. This is a list 
+                                            starting with the script to execute along with a list of optional arguments to the script. This is mutually
+                                            exclusive from the cmake_generate_args and cmake_build_args options.
+                                            Note: If the command is a python script, format the command with a {python} variable, for example: "{python} build_me.py"
+                                                  This will invoke the same python interpreter that is used to launch the build package script
                                             see the note about environment variables below.
 
-* custom_install_cmd                      : A list of custom scripts to run (after the custom_build_cmd) to copy and assemble the built binaries
-                                            into the target package folder.
-                                            this argument is optional.  You could do the install in your custom build command instead.
+* custom_install_cmd                      : A custom script and arguments to run (after the custom_build_cmd) to copy and assemble the built binaries
+                                            into the target package folder. This is a list starting with the script to execute along with a list of optional
+                                            arguments to the script. This argument is optional.  You could do the install in your custom build command instead.
+                                            Note: If the command is a python script, format the command with a {python} variable, for example: "{python} install_me.py"
+                                                  This will invoke the same python interpreter that is used to launch the build package script
                                             see the note about environment variables below.
 
 * custom_install_json                     : A list of files to copy into the target package folder from the built SDK. This argument is optional.
@@ -780,30 +786,35 @@ class BuildInfo(object):
 
         env_to_use = self.create_custom_env()
         custom_build_cmds = self.platform_config.get('custom_build_cmd', [])
-        for custom_build_cmd in custom_build_cmds:
-            # Support the user specifying {python} in the custom_build_cmd to invoke
-            # the Python executable that launched this build script
-            call_result = subprocess.run(custom_build_cmd.format(python=sys.executable),
+        if custom_build_cmds:
+
+            # Construct the custom build command to execute
+            full_custom_build_cmd = shlex.join(custom_build_cmds).format(python=sys.executable)
+
+            call_result = subprocess.run(full_custom_build_cmd,
                                          shell=True,
                                          capture_output=False,
                                          cwd=str(self.base_folder),
                                          env=env_to_use)
             if call_result.returncode != 0:
-                raise BuildError(f"Error executing custom build command {custom_build_cmd}")
+                raise BuildError(f"Error executing custom build command {full_custom_build_cmd}")
 
         custom_install_cmds = self.platform_config.get('custom_install_cmd', [])
 
-        for custom_install_cmd in custom_install_cmds:
-            # Support the user specifying {python} in the custom_install_cmd to invoke
-            # the Python executable that launched this build script
-            call_result = subprocess.run(custom_install_cmd.format(python=sys.executable),
+        if custom_install_cmds:
+
+            # Construct the custom install command to execute
+            full_custom_install_cmd = shlex.join(custom_install_cmds).format(python=sys.executable)
+
+            call_result = subprocess.run(full_custom_install_cmd,
+
                                          shell=True,
                                          capture_output=False,
                                          cwd=str(self.base_folder),
                                          env=env_to_use)
             if call_result.returncode != 0:
-                raise BuildError(f"Error executing custom install command {custom_install_cmd}")
-
+                raise BuildError(f"Error executing custom install command {full_custom_install_cmd}")
+                
         # Allow libraries to define a list of files to include via a json script that stores folder paths and
         # individual files in the "Install_Paths" array
         custom_install_jsons = self.platform_config.get('custom_install_json', [])

+ 4 - 1
package-system/Qt/build_config.json

@@ -18,8 +18,11 @@
                     ["tiff-4.2.0.15-rev3-windows", "c6000a906e6d2a0816b652e93dfbeab41c9ed73cdd5a613acd53e553d0510b60", ""],
                     ["zlib-1.2.11-rev5-windows", "8847112429744eb11d92c44026fc5fc53caa4a06709382b5f13978f3c26c4cbd", ""]
                 ],
+                "additional_download_packages":[ 
+                    ["http://download.qt.io/official_releases/jom/jom.zip", "128fdd846fe24f8594eed37d1d8929a0ea78df563537c0c1b1861a635013fff8", "sha256"],
+                    ["https://github.com/unicode-org/icu/releases/download/release-65-1/icu4c-65_1-Win64-MSVC2017.zip", "cfaf7477d65272e9e01c739951f0607642c0510235e46befc109f6a3addd4f43", "sha256"]
+                ],
                 "custom_build_cmd": [
-                    "install_windows_extras.py",
                     "build-windows.bat"
                 ],
                 "custom_install_cmd": [

+ 0 - 54
package-system/Qt/install_windows_extras.py

@@ -1,54 +0,0 @@
-#
-# Copyright (c) Contributors to the Open 3D Engine Project.
-# For complete copyright and license terms please see the LICENSE at the root of this distribution.
-#
-# SPDX-License-Identifier: Apache-2.0 OR MIT
-#
-#
-
-import os
-import urllib.request
-import zipfile
-
-
-# On Windows, we also need to install jom and ICU, so we will download them
-# and install them locally just for this build
-dependencies = {
-    "jom": "http://download.qt.io/official_releases/jom/jom.zip",
-    "icu": "https://github.com/unicode-org/icu/releases/download/release-65-1/icu4c-65_1-Win64-MSVC2017.zip"
-}
-
-current_dir = os.getcwd()
-
-try:
-
-    # Set the current working directory to temp
-    current_dir = os.getcwd()
-    os.chdir("temp")
-    temp_dir = os.getcwd()
-
-    for name in dependencies:
-        print(f"Attempting to install {name}")
-
-        installer_link = dependencies[name]
-        file_name = os.path.basename(installer_link)
-
-        # Download the zip if needed
-        if not os.path.exists(file_name):
-            print(f"Downloading {name} from {installer_link}")
-
-            urllib.request.urlretrieve(installer_link, file_name)
-
-            print(f"Download of {name} complete => {os.path.abspath(file_name)}")
-
-        # We will unzip the package into the local temp directory
-        install_dir = os.path.abspath(os.path.join(temp_dir, name))
-        print(f"Installing {name} to {install_dir}")
-
-        with zipfile.ZipFile(file_name, 'r') as dep_zip:
-            dep_zip.extractall(install_dir)
-
-        print(f"Successfully installed {name}") 
-
-finally:
-    os.chdir(current_dir)

+ 16 - 6
package-system/squish-ccr/CMakeLists.txt

@@ -6,7 +6,7 @@
 #
 
 # CMake definition for squish-ccr 2.00 alpha2
-cmake_minimum_required(VERSION 3.17)
+cmake_minimum_required(VERSION 3.16)
 
 project(squish-ccr)
 
@@ -74,6 +74,8 @@ set(SQUISH_HEADER_FILES
     hdrsinglefit.h
     hdrsinglesnap.h
     maths.h
+    maths_sse.h
+    maths_std.h
     paletteblock.h
     palettechannelfit.h
     paletteclusterfit.h
@@ -107,13 +109,21 @@ set(SQUISH_PUBLIC_INCLUDE_FILES
 )
 
 add_library(squish-ccr SHARED ${SQUISH_SOURCE_FILES} ${SQUISH_HEADER_FILES} ${SQUISH_INLINE_FILES})
-target_include_directories(squish-ccr PRIVATE ${CMAKE_CURRENT_LIST_DIR})
-target_compile_definitions(squish-ccr PRIVATE SQUISH_USE_SSE=2 SQUISH_USE_CPP SQUISH_USE_CCR)
+
 
 if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
-    target_compile_options(squish-ccr PRIVATE -msse2 -Wno-unused-value)
+    if(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
+        target_include_directories(squish-ccr PRIVATE ${CMAKE_CURRENT_LIST_DIR} /data/workspace/sse2neon)
+        target_compile_definitions(squish-ccr PRIVATE SQUISH_USE_NEON=1 SQUISH_USE_SSE=2 SQUISH_USE_CPP SQUISH_USE_CCR)
+        target_compile_options(squish-ccr PRIVATE -march=armv8-a+fp+simd+crypto+crc -Wno-unused-value -Wno-c++20-extensions -Wno-shift-op-parentheses -Wno-tautological-constant-out-of-range-compare -Wno-array-bounds -Wno-switch)
+    else()
+        target_include_directories(squish-ccr PRIVATE ${CMAKE_CURRENT_LIST_DIR})
+        target_compile_definitions(squish-ccr PRIVATE SQUISH_USE_NEON=0 SQUISH_USE_SSE=2 SQUISH_USE_CPP SQUISH_USE_CCR)
+        target_compile_options(squish-ccr PRIVATE -msse2 -Wno-unused-value -Wno-switch)
+    endif()
 elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
-    target_compile_definitions(squish-ccr PRIVATE NDEBUG USE_CPP)
+    target_include_directories(squish-ccr PRIVATE ${CMAKE_CURRENT_LIST_DIR})
+    target_compile_definitions(squish-ccr PRIVATE NDEBUG USE_CPP SQUISH_USE_NEON=0 SQUISH_USE_SSE=2 SQUISH_USE_CPP SQUISH_USE_CCR)
 endif()
 
 set_target_properties(squish-ccr
@@ -135,4 +145,4 @@ install(TARGETS squish-ccr
             DESTINATION ${CMAKE_INSTALL_BINDIR}
         FRAMEWORK
             DESTINATION ${CMAKE_INSTALL_BINDIR}
-)
+)

+ 40 - 0
package-system/squish-ccr/Dockerfile.aarch64

@@ -0,0 +1,40 @@
+
+# Copyright (c) Contributors to the Open 3D Engine Project.
+# For complete copyright and license terms please see the LICENSE at the root of this distribution.
+#
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+#
+
+FROM arm64v8/ubuntu:20.04
+ 
+WORKDIR /data/workspace
+
+ARG DOCKER_BUILD_SCRIPT
+
+# Initilize apt cache
+RUN apt-get clean && apt-get update
+
+# Install the development packages needed to build Qt from source
+RUN DEBIAN_FRONTEND="noninteractive" apt-get install -y git \
+                                                        build-essential \
+                                                        cmake \
+                                                        ninja-build \
+                                                        clang
+
+RUN apt upgrade -y
+
+# Use the sse2neon header to provide a translation between sse to neon for arm processing
+RUN git clone https://github.com/DLTcollab/sse2neon.git /data/workspace/sse2neon && \
+    git -C /data/workspace/sse2neon checkout v1.6.0
+
+
+# Prepare a target folder within the container to install the build artifacts tp
+RUN mkdir -p /data/workspace/build && \
+    mkdir -p /data/workspace/src
+
+ARG CACHEBUST=1
+
+# Copy the build script specific to this Docker script in order to execute the build
+COPY ${DOCKER_BUILD_SCRIPT} /data/workspace/
+COPY src /data/workspace/src/
+

+ 35 - 0
package-system/squish-ccr/Dockerfile.x86_64

@@ -0,0 +1,35 @@
+
+# Copyright (c) Contributors to the Open 3D Engine Project.
+# For complete copyright and license terms please see the LICENSE at the root of this distribution.
+#
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+#
+
+FROM amd64/ubuntu:20.04
+ 
+WORKDIR /data/workspace
+
+ARG DOCKER_BUILD_SCRIPT
+
+# Initilize apt cache
+RUN apt-get clean && apt-get update
+
+# Install the development packages needed to build Qt from source
+RUN DEBIAN_FRONTEND="noninteractive" apt-get install -y build-essential \
+                                                        cmake \
+                                                        ninja-build \
+                                                        clang
+
+RUN apt upgrade -y
+
+# Prepare a target folder within the container to install the build artifacts tp
+RUN mkdir -p /data/workspace/build && \
+    mkdir -p /data/workspace/src
+
+
+ARG CACHEBUST=1
+
+# Copy the build script specific to this Docker script in order to execute the build
+COPY ${DOCKER_BUILD_SCRIPT} /data/workspace/
+COPY src /data/workspace/src/
+

+ 42 - 0
package-system/squish-ccr/Findsquish-ccr.cmake

@@ -0,0 +1,42 @@
+#
+# Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution.
+# 
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+#
+
+# this file actually ingests the library and defines targets.
+
+set(LIB_NAME "squish-ccr")
+set(TARGET_WITH_NAMESPACE "3rdParty::${LIB_NAME}")
+if (TARGET ${TARGET_WITH_NAMESPACE})
+    return()
+endif()
+
+set(${LIB_NAME}_INCLUDE_DIR ${CMAKE_CURRENT_LIST_DIR}/${LIB_NAME}/include)
+set(${LIB_NAME}_LIBRARY_DIR ${CMAKE_CURRENT_LIST_DIR}/${LIB_NAME}/bin)
+
+add_library(${TARGET_WITH_NAMESPACE} SHARED IMPORTED GLOBAL)
+
+# add include directory
+ly_target_include_system_directories(TARGET ${TARGET_WITH_NAMESPACE} INTERFACE ${${LIB_NAME}_INCLUDE_DIR})
+
+if (${PAL_PLATFORM_NAME} STREQUAL "Windows")
+    set_target_properties(${TARGET_WITH_NAMESPACE} PROPERTIES
+        IMPORTED_LOCATION ${${LIB_NAME}_LIBRARY_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}${LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}
+        IMPORTED_IMPLIB   ${${LIB_NAME}_LIBRARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}${LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}
+    )
+else()
+    set_target_properties(${TARGET_WITH_NAMESPACE} PROPERTIES
+        IMPORTED_LOCATION ${${LIB_NAME}_LIBRARY_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}${LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}
+    )
+endif()
+
+# using squish causes your target to get a USING_SQUISH_SDK applied to it.
+target_compile_definitions(${TARGET_WITH_NAMESPACE} INTERFACE 
+    USING_SQUISH_SDK
+    SQUISH_USE_SSE=2
+    SQUISH_USE_CPP
+    SQUISH_USE_CCR
+    )
+
+set(${LIB_NAME}_FOUND True)

+ 0 - 45
package-system/squish-ccr/Findsquish-ccr.cmake.template

@@ -1,45 +0,0 @@
-#
-# Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution.
-# 
-# SPDX-License-Identifier: Apache-2.0 OR MIT
-#
-
-# this file actually ingests the library and defines targets.
-
-set(LIB_NAME "squish-ccr")
-set(TARGET_WITH_NAMESPACE "3rdParty::$${LIB_NAME}")
-if (TARGET $${TARGET_WITH_NAMESPACE})
-    return()
-endif()
-
-set($${LIB_NAME}_INCLUDE_DIR $${CMAKE_CURRENT_LIST_DIR}/$${LIB_NAME}/include)
-set($${LIB_NAME}_LIBRARY_DIR $${CMAKE_CURRENT_LIST_DIR}/$${LIB_NAME}/bin)
-
-add_library($${TARGET_WITH_NAMESPACE} INTERFACE IMPORTED GLOBAL)
-
-# add include directory
-ly_target_include_system_directories(TARGET $${TARGET_WITH_NAMESPACE} INTERFACE $${$${LIB_NAME}_INCLUDE_DIR})
-
-if ($${PAL_PLATFORM_NAME} STREQUAL "Windows")
-    set($${LIB_NAME}_LIBRARY   $${$${LIB_NAME}_LIBRARY_DIR}/$${LIB_NAME}.lib)
-else()
-    set($${LIB_NAME}_LIBRARY   $${$${LIB_NAME}_LIBRARY_DIR}/$${CMAKE_SHARED_LIBRARY_PREFIX}$${LIB_NAME}$${CMAKE_SHARED_LIBRARY_SUFFIX})
-endif()
-
-set($${LIB_NAME}_RUNTIME_DEPENDENCIES $${$${LIB_NAME}_LIBRARY_DIR}/$${CMAKE_SHARED_LIBRARY_PREFIX}$${LIB_NAME}$${CMAKE_SHARED_LIBRARY_SUFFIX})
-
-# for linking
-target_link_libraries($${TARGET_WITH_NAMESPACE} INTERFACE $${$${LIB_NAME}_LIBRARY})
-
-# add runtime dependencies
-ly_add_target_files(TARGETS $${TARGET_WITH_NAMESPACE} FILES $${$${LIB_NAME}_RUNTIME_DEPENDENCIES})
-
-# using squish causes your target to get a USING_SQUISH_SDK applied to it.
-target_compile_definitions($${TARGET_WITH_NAMESPACE} INTERFACE 
-    USING_SQUISH_SDK
-    SQUISH_USE_SSE=2
-    SQUISH_USE_CPP
-    SQUISH_USE_CCR
-    )
-
-set($${LIB_NAME}_FOUND True)

+ 164 - 0
package-system/squish-ccr/build-linux.sh

@@ -0,0 +1,164 @@
+#!/bin/bash
+
+#
+# Copyright (c) Contributors to the Open 3D Engine Project.
+# For complete copyright and license terms please see the LICENSE at the root of this distribution.
+#
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+#
+
+# TEMP_FOLDER and TARGET_INSTALL_ROOT get set from the pull_and_build_from_git.py script
+
+LIB_NAME=squish_ccr
+
+# Determine the host architecture
+CURRENT_HOST_ARCH=$(uname -m)
+
+# Use the host architecture if not supplied
+TARGET_ARCH=${1:-$(uname -m)}
+
+# If the host and target architecture does not match, make sure the necessary cross compilation packages are installed
+if [ "${CURRENT_HOST_ARCH}" != ${TARGET_ARCH} ]
+then
+    echo "Checking cross compiling requirements."
+    for package_check in docker-ce qemu binfmt-support qemu-user-static
+    do
+        echo "Checking package $package_check"
+        dpkg -s $package_check > /dev/null 2>&1
+        if [ $? -ne 0 ]
+        then
+            echo ""
+            echo "Missing package $package_check. Make sure to install it with your local package manager." 
+            echo ""
+            exit 1
+        fi
+    done
+
+    # Only cross compilation of an ARM64 image on an x86_64 host is supported
+    if [ "${TARGET_ARCH}" = "aarch64" ]
+    then
+        # Make sure qemu-aarch64 is installed properly
+        QEMU_AARCH_COUNT=$(update-binfmts --display | grep qemu-aarch64 | wc -l)
+        if [ $QEMU_AARCH_COUNT -eq 0 ]
+        then
+            echo ""
+            echo "QEMU aarch64 binary format not registered."
+            echo "Run the following command to register"
+            echo ""
+            echo "sudo docker run --rm --privileged multiarch/qemu-user-static --reset -p yes"
+            echo ""
+            exit 1
+        fi
+        echo ""
+        echo "Cross compiling aarch64 on an amd64 machine validated."
+        echo ""
+    fi
+else
+    echo "Building ${TARGET_ARCH} natively."
+fi
+
+# Setup the docker arguments for the target architecture
+if [ "${TARGET_ARCH}" = "x86_64" ]
+then
+    echo "Processing Docker for x86_64"
+    TARGET_DOCKER_FILE=Dockerfile.x86_64
+    TARGET_DOCKER_PLATFORM_ARG=linux/amd64
+    DOCKER_IMAGE_NAME=${LIB_NAME}_linux_3p
+elif [ "${TARGET_ARCH}" = "aarch64" ] 
+then
+    echo "Processing Docker for aarch64"
+    TARGET_DOCKER_FILE=Dockerfile.aarch64
+    TARGET_DOCKER_PLATFORM_ARG=linux/arm64/v8
+    DOCKER_IMAGE_NAME=${LIB_NAME}_linux_aarch64_3p
+else
+    echo "Unsupported architecture ${TARGET_ARCH}"
+    exit 1
+fi
+
+# Make sure docker is installed
+DOCKER_VERSION=$(docker --version)
+if [ $? -ne 0 ]
+then
+    echo "Required package docker is not installed"
+    echo "Follow instructions on https://docs.docker.com/engine/install/ubuntu/ to install docker properly"
+    exit 1
+fi
+echo "Detected Docker Version $DOCKER_VERSION"
+
+DOCKER_BUILD_SCRIPT=docker_build_linux.sh
+
+if [ ! -f $DOCKER_BUILD_SCRIPT ]
+then
+    echo "Invalid docker build script ${DOCKER_BUILD_SCRIPT}"
+    exit 1
+fi
+
+# Prepare the docker file and use the temp folder as the context root
+cp -f ${DOCKER_BUILD_SCRIPT} temp/
+
+pushd temp
+
+# Build the Docker Image
+echo "Building the docker build script for ${DOCKER_IMAGE_NAME}"
+docker build --build-arg DOCKER_BUILD_SCRIPT=$DOCKER_BUILD_SCRIPT -f ../${TARGET_DOCKER_FILE} -t ${DOCKER_IMAGE_NAME}:latest . 
+if [ $? -ne 0 ]
+then
+    echo "Error occurred creating Docker image ${DOCKER_IMAGE_NAME}:latest." 
+    exit 1
+fi
+
+
+# Capture the Docker Image ID
+IMAGE_ID=$(docker images -q ${DOCKER_IMAGE_NAME}:latest)
+if [ -z $IMAGE_ID ]
+then
+    echo "Error: Cannot find Image ID for ${DOCKER_IMAGE_NAME}"
+    exit 1
+fi
+
+
+# Run the Docker Image
+echo "Running build script in the docker image"
+docker run --platform ${TARGET_DOCKER_PLATFORM_ARG} --tty ${DOCKER_IMAGE_NAME}:latest /data/workspace/${DOCKER_BUILD_SCRIPT}
+if [ $? -ne 0 ]
+then
+    echo Failed to build from docker image ${DOCKER_IMAGE_NAME}:latest
+    echo "To log into and troubleshoot the docker container, run the following command:"
+    echo ""
+    echo "docker run --platform ${TARGET_DOCKER_PLATFORM_ARG} -it --tty ${DOCKER_IMAGE_NAME}:latest"
+    echo ""
+    exit 1
+fi
+
+
+# Capture the container ID
+echo "Capturing the Container ID"
+CONTAINER_ID=$(docker container ls -l -q --filter "ancestor=${DOCKER_IMAGE_NAME}:latest")
+if [ -z $CONTAINER_ID ]
+then
+    echo "Error: Cannot find Container ID for Image ${DOCKER_IMAGE_NAME}"
+    exit 1
+fi
+
+
+# Copy the build artifacts from the Docker Container
+echo "Copying the built contents from the docker container for image ${DOCKER_IMAGE_NAME}"
+
+mkdir -p build
+docker cp --quiet $CONTAINER_ID:/data/workspace/package/. build  
+if [ $? -ne 0 ]
+then
+    echo "Error occurred copying build artifacts from Docker container ($CONTAINER_ID)" 
+    exit 1
+fi
+
+# Clean up the docker image and container
+echo "Cleaning up container"
+docker container rm $CONTAINER_ID || (echo "Warning: unable to clean up container for image ${DOCKER_IMAGE_NAME}")
+
+echo "Cleaning up image"
+docker rmi --force $IMAGE_ID  || (echo "Warning: unable to clean up image ${DOCKER_IMAGE_NAME}")
+
+popd
+
+exit 0

+ 21 - 21
package-system/squish-ccr/build_config.json

@@ -7,7 +7,7 @@
    "package_url":"http://sjbrown.co.uk/2006/01/19/dxt-compression-techniques/",
    "package_license":"MIT",
    "package_license_file":"LICENSE.txt",
-   "cmake_find_template":"Findsquish-ccr.cmake.template",
+   "cmake_find_source":"Findsquish-ccr.cmake",
    "cmake_find_target":"Findsquish-ccr.cmake",
    "patch_file":"squish-ccr-deb557d-rev1.patch",
    "additional_src_files":[
@@ -55,24 +55,24 @@
         }
       },
       "Linux":{
-         "Linux":{
-            "custom_cmake_install":true,
-            "cmake_generate_args_release": [
-                "-G",
-                "Unix\\ Makefiles",
-                "-DCMAKE_C_COMPILER=clang-6.0",
-                "-DCMAKE_CXX_COMPILER=clang++-6.0",
-                "-DCMAKE_CXX_FLAGS=\"-fPIC -O2\"",
-                "-DCMAKE_CXX_STANDARD=17",
-                "-DCMAKE_BUILD_TYPE=Release"
-            ],
-            "cmake_build_args":[
-               "-j"
-            ],
-            "build_configs":[
-                "Release"
-            ]
-         }
-      }
+            "Linux":{
+               "custom_build_cmd": [
+                    "./build-linux.sh",
+                    "x86_64"
+                ],
+                "custom_install_cmd": [
+                    "./package-linux.sh"
+               ]
+            },
+            "Linux-aarch64":{
+               "custom_build_cmd": [
+                    "./build-linux.sh",
+                    "aarch64"
+                ],
+                "custom_install_cmd": [
+                    "./package-linux.sh"
+               ]
+            }
+        }
    }
-}
+}

+ 29 - 0
package-system/squish-ccr/docker_build_linux.sh

@@ -0,0 +1,29 @@
+#!/bin/bash
+
+# Copyright (c) Contributors to the Open 3D Engine Project.
+# For complete copyright and license terms please see the LICENSE at the root of this distribution.
+#
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+
+# Build the release version of the library
+cmake -S src -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_CXX_FLAGS="-fPIC -O2" -DCMAKE_CXX_STANDARD=17 -DCMAKE_INSTALL_PREFIX=/data/workspace/package
+if [ $? -ne 0 ]
+then
+    echo "Error configuring cmake for squish-ccr (${build_config})"
+    exit 1
+fi
+
+cmake --build build --target install
+if [ $? -ne 0 ]
+then
+    echo "Failed to build squish-ccr for Linux (${build_config})"
+    exit 1
+fi
+
+# If sse2neon was installed on this docker container, include its license file
+if [ -f /data/workspace/sse2neon/LICENSE ]
+then
+    cp /data/workspace/sse2neon/LICENSE /data/workspace/package/LICENSE.sse2neon
+fi
+
+exit 0

+ 18 - 0
package-system/squish-ccr/package-linux.sh

@@ -0,0 +1,18 @@
+#!/bin/bash
+
+# Copyright (c) Contributors to the Open 3D Engine Project.
+# For complete copyright and license terms please see the LICENSE at the root of this distribution.
+#
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+
+
+
+cp -r temp/build/include $TARGET_INSTALL_ROOT
+cp -r temp/build/bin $TARGET_INSTALL_ROOT
+
+if [ -f temp/build/LICENSE.sse2neon ]
+then
+    cp temp/build/LICENSE.sse2neon $TARGET_INSTALL_ROOT/
+fi
+
+exit 0 

+ 129 - 81
package-system/squish-ccr/squish-ccr-deb557d-rev1.patch

@@ -139,6 +139,27 @@ index d9c3808..b58c36a 100644
      v *= Reciprocal(HorizontalMax(Abs(v)));
    }
  #if POWER_ITERATION_COUNT <= 0
+diff --git a/maths_sse.h b/maths_sse.h
+index eeff0d5..2a8eb89 100644
+--- a/maths_sse.h
++++ b/maths_sse.h
+@@ -25,11 +25,15 @@
+ 
+ #ifndef SQUISH_MATH_SSE_H
+ #define SQUISH_MATH_SSE_H
+-
++#if SQUISH_USE_NEON && __ARM_NEON
++#include <sse2neon.h>
++#else
+ #include <xmmintrin.h>
+ #if ( SQUISH_USE_SSE > 1 )
+ #include <emmintrin.h>
+ #endif
++#endif
++
+ #if ( SQUISH_USE_SSE >= 3 )
+ #include <pmmintrin.h>
+ #endif
 diff --git a/paletteclusterfit.cpp b/paletteclusterfit.cpp
 index 2d6f5a1..b98e975 100644
 --- a/paletteclusterfit.cpp
@@ -181,8 +202,21 @@ index bee740c..8c7aea0 100644
      }
    }
  }
+diff --git a/simd_float.h b/simd_float.h
+index f401b68..668bb61 100644
+--- a/simd_float.h
++++ b/simd_float.h
+@@ -833,7 +833,7 @@ public:
+   template<const int n, const int p>
+   friend void ConcBits(Col4::Arg left, Col4 &right )
+   {
+-    right  = ShiftLeft<32>( right );
++    right  = ShiftLeft<64>( right );
+     if (n > 0)
+       right += ExtrBits<n, p>( left );
+   }
 diff --git a/simd_sse.h b/simd_sse.h
-index f959e20..1a2f6b8 100644
+index f959e20..542fbba 100644
 --- a/simd_sse.h
 +++ b/simd_sse.h
 @@ -1,7 +1,7 @@
@@ -194,15 +228,26 @@ index f959e20..1a2f6b8 100644
  
  	Permission is hereby granted, free of charge, to any person obtaining
  	a copy of this software and associated documentation files (the
-@@ -33,6 +33,7 @@
+@@ -27,12 +27,18 @@
+ #ifndef SQUISH_SIMD_SSE_H
+ #define SQUISH_SIMD_SSE_H
+ 
++#if SQUISH_USE_NEON && __ARM_NEON
++#include <sse2neon.h>
++#else
+ #include <xmmintrin.h>
+ #if ( SQUISH_USE_SSE > 1 )
+ #include <emmintrin.h>
  #endif
++#endif
++
  #if ( SQUISH_USE_SSE >= 3 )
  #include <pmmintrin.h>
 +#include <smmintrin.h>
  #endif
  #if ( SQUISH_USE_SSE >= 4 )
  #include <smmintrin.h>
-@@ -69,6 +70,12 @@
+@@ -69,6 +75,12 @@
  
  namespace squish {
  
@@ -215,7 +260,7 @@ index f959e20..1a2f6b8 100644
  #define COL4_CONST( X ) Col4( X )
  
  
-@@ -263,7 +270,7 @@ public:
+@@ -263,7 +275,7 @@ public:
  	Col3& operator/=( short v )
  	{
  		__m128
@@ -224,7 +269,7 @@ index f959e20..1a2f6b8 100644
  		fp = _mm_cvtepi32_ps(m_v);
  		fp = _mm_div_ps(fp, _mm_set1_ps(v));
  		m_v = _mm_cvttps_epi32(fp);
-@@ -351,64 +358,18 @@ public:
+@@ -351,64 +363,18 @@ public:
  
  	template<const int n>
  	friend Col3 ShiftLeft( Arg a );
@@ -292,7 +337,7 @@ index f959e20..1a2f6b8 100644
  
  	template<const int r, const int g, const int b>
  	friend Col3 ShiftLeftLo( Arg v )
-@@ -422,140 +383,24 @@ public:
+@@ -422,140 +388,24 @@ public:
  
  	template<const int n, const int p>
  	friend Col3 MaskBits( Arg a );
@@ -436,7 +481,7 @@ index f959e20..1a2f6b8 100644
  
  	friend Col3 Mul16x16u( Arg a, Arg b )
  	{
-@@ -652,18 +497,7 @@ public:
+@@ -652,18 +502,7 @@ public:
  	template<const int f, const int t>
  	friend Col3 Exchange( Arg a );
  	template<const int f, const int t>
@@ -456,7 +501,7 @@ index f959e20..1a2f6b8 100644
  
  	friend Col3 HorizontalAdd( Arg a )
  	{
-@@ -751,7 +585,7 @@ public:
+@@ -751,7 +590,7 @@ public:
  		return HorizontalAdd( a, b );
  #endif
  	}
@@ -465,7 +510,7 @@ index f959e20..1a2f6b8 100644
  	friend Col3 HorizontalMaxTiny( Arg a )
  	{
  #if ( SQUISH_USE_SSE >= 4 ) && 0
-@@ -867,7 +701,7 @@ public:
+@@ -867,7 +706,7 @@ public:
  
  	      return Col3( _mm_castps_si128 ( resc ) );
  	}
@@ -474,7 +519,7 @@ index f959e20..1a2f6b8 100644
  	friend bool CompareFirstLessThan( Arg left, Arg right )
  	{
  		__m128i bits = _mm_cmplt_epi32( left.m_v, right.m_v );
-@@ -937,7 +771,7 @@ public:
+@@ -937,7 +776,7 @@ public:
  
  		loc = _mm_cvtsi128_si32( r );
  	}
@@ -483,7 +528,7 @@ index f959e20..1a2f6b8 100644
  	friend void PackBytes( Arg a, int &loc )
  	{
  		__m128i
-@@ -947,7 +781,7 @@ public:
+@@ -947,7 +786,7 @@ public:
  
  		loc = _mm_cvtsi128_si32( r );
  	}
@@ -492,7 +537,7 @@ index f959e20..1a2f6b8 100644
  	friend void PackWords( Arg a, unsigned__int64 &loc )
  	{
  		__m128i
-@@ -964,17 +798,17 @@ public:
+@@ -964,17 +803,17 @@ public:
  //		loc = _mm_cvtsi128_si64( r );
  		_mm_storel_epi64( (__m128i *)&loc, r );
  	}
@@ -513,7 +558,7 @@ index f959e20..1a2f6b8 100644
  	// clamp the output to [0, 1]
  	Col3 Clamp() const {
  		Col3 const one (0xFF);
-@@ -1020,17 +854,17 @@ public:
+@@ -1020,17 +859,17 @@ public:
  	{
  		_mm_store_si128( (__m128i *)destination, _mm_unpacklo_epi64( a.m_v, b.m_v ) );
  	}
@@ -534,7 +579,7 @@ index f959e20..1a2f6b8 100644
  	friend void StoreUnaligned( Arg a, u8* loc ) {
  	  PackBytes( a, (unsigned int&) (*((unsigned int *)loc)) ); }
  	friend void StoreUnaligned( Arg a, u16* loc ) {
-@@ -1043,10 +877,202 @@ public:
+@@ -1043,10 +882,202 @@ public:
  private:
  	__m128i m_v;
  
@@ -739,7 +784,7 @@ index f959e20..1a2f6b8 100644
  class Col4
  {
  public:
-@@ -1305,317 +1331,56 @@ public:
+@@ -1305,317 +1336,56 @@ public:
  
  	template<const int n>
  	friend Col4 FillSign( Arg a );
@@ -1066,7 +1111,7 @@ index f959e20..1a2f6b8 100644
  
  	friend Col4 RevsBits( Col4::Arg v )
  	{
-@@ -1679,19 +1444,7 @@ public:
+@@ -1679,19 +1449,7 @@ public:
  
  	template<const int f, const int t>
  	friend Col4 Shuffle( Arg a );
@@ -1086,7 +1131,7 @@ index f959e20..1a2f6b8 100644
  
  	template<const int f, const int t>
  	friend Col4 Exchange( Arg a );
-@@ -1888,7 +1641,7 @@ public:
+@@ -1888,7 +1646,7 @@ public:
  		return Col4( _mm_max_epi16( left.m_v, right.m_v ) );
  #endif
  	}
@@ -1095,7 +1140,7 @@ index f959e20..1a2f6b8 100644
  	friend Col4 MaxTiny( Arg left, Arg right )
  	{
  		__m128 resa = _mm_castsi128_ps( left.m_v );
-@@ -1973,7 +1726,7 @@ public:
+@@ -1973,7 +1731,7 @@ public:
  	{
  		return Col4( _mm_cmplt_epi8( left.m_v, right.m_v ) );
  	}
@@ -1104,7 +1149,7 @@ index f959e20..1a2f6b8 100644
  	friend Col4 CompareAllEqualTo_M8( Arg left, Arg right )
  	{
  		return Col4( _mm_cmpeq_epi8( left.m_v, right.m_v ) );
-@@ -1996,11 +1749,6 @@ public:
+@@ -1996,11 +1754,6 @@ public:
  
  	template<const int value>
  	friend Col4 IsValue( Arg v );
@@ -1116,7 +1161,7 @@ index f959e20..1a2f6b8 100644
  
  	friend Col4 TransferA( Arg left, Arg right )
  	{
-@@ -2014,7 +1762,7 @@ public:
+@@ -2014,7 +1767,7 @@ public:
  	{
  		return Col4( _mm_or_si128( left.m_v, _mm_setr_epi32( 0x00, 0x00, 0x00, 0xFF ) ) );
  	}
@@ -1125,7 +1170,7 @@ index f959e20..1a2f6b8 100644
  	friend Col4 CollapseA( Arg r, Arg g, Arg b, Arg a )
  	{
  		return Col4( _mm_packus_epi16(
-@@ -2032,7 +1780,7 @@ public:
+@@ -2032,7 +1785,7 @@ public:
  
  		loc = _mm_cvtsi128_si32 ( r );
  	}
@@ -1134,7 +1179,7 @@ index f959e20..1a2f6b8 100644
  	friend void PackBytes( Arg a, int &loc )
  	{
  		__m128i
-@@ -2042,7 +1790,7 @@ public:
+@@ -2042,7 +1795,7 @@ public:
  
  		loc = _mm_cvtsi128_si32 ( r );
  	}
@@ -1143,7 +1188,7 @@ index f959e20..1a2f6b8 100644
  	friend void PackWords( Arg a, unsigned__int64 &loc )
  	{
  		__m128i
-@@ -2059,11 +1807,11 @@ public:
+@@ -2059,11 +1812,11 @@ public:
  //		loc = _mm_cvtsi128_si64( r );
  		_mm_storel_epi64( (__m128i *)&loc, r );
  	}
@@ -1157,7 +1202,7 @@ index f959e20..1a2f6b8 100644
  		r = _mm_packs_epi32( a.m_v, a.m_v );
  
  //		loc = _mm_cvtsi128_si64( r );
-@@ -2100,18 +1848,9 @@ public:
+@@ -2100,18 +1853,9 @@ public:
  
  		a = Col4( r );
  	}
@@ -1178,7 +1223,7 @@ index f959e20..1a2f6b8 100644
  	friend void UnpackWords( Col4 &a, const unsigned__int64 &loc )
  	{
  		__m128i
-@@ -2121,110 +1860,447 @@ public:
+@@ -2121,110 +1865,449 @@ public:
  
  		a = Col4( r );
  	}
@@ -1332,14 +1377,16 @@ index f959e20..1a2f6b8 100644
 +template<const int n>
 +Col4 ShiftLeft( Col4::Arg a )
 +{
++	constexpr int n_shift_3 = (n) >> 3;
++
 +    if ((n) <= 0)
 +        return Col4( a.m_v );
 +    if ((n) <= 7)
 +        return Col4( _mm_slli_epi32( a.m_v, (n) & 7 ) );
 +    if ((n) & 7)
-+        return Col4( _mm_slli_epi32( _mm_slli_si128( a.m_v, (n) >> 3 ), (n) & 7 ) );
++        return Col4( _mm_slli_epi32( _mm_slli_si128( a.m_v, n_shift_3 ), (n) & 7 ) );
 +
-+    return Col4( _mm_slli_si128( a.m_v, (n) >> 3 ) );
++    return Col4( _mm_slli_si128( a.m_v, n_shift_3 ) );
 +}
 +
 +template<const int n, const int p>
@@ -1714,7 +1761,7 @@ index f959e20..1a2f6b8 100644
  
  #if	!defined(SQUISH_USE_PRE)
  inline Col3 LengthSquared( Col3::Arg v )
-@@ -2291,30 +2367,30 @@ public:
+@@ -2291,30 +2374,30 @@ public:
  	{
  		return _mm_extract_epi16( m_v, 0 );
  	}
@@ -1750,7 +1797,7 @@ index f959e20..1a2f6b8 100644
  	const u16 &operator[]( int pos ) const
  	{
  		return ((u16 *)&m_v)[pos];
-@@ -2331,7 +2407,7 @@ public:
+@@ -2331,7 +2414,7 @@ public:
  	{
  		return Col8( _mm_srli_epi16( left.m_v, right ) );
  	}
@@ -1759,7 +1806,7 @@ index f959e20..1a2f6b8 100644
  	friend Col8 operator>>( Arg left, int right )
  	{
  		return Col8( _mm_srai_epi16( left.m_v, right ) );
-@@ -2341,7 +2417,7 @@ public:
+@@ -2341,7 +2424,7 @@ public:
  	{
  		return Col8( _mm_slli_epi16( left.m_v, right ) );
  	}
@@ -1768,7 +1815,7 @@ index f959e20..1a2f6b8 100644
  	friend Col8 operator<<( Arg left, int right )
  	{
  		return Col8( _mm_slli_epi16( left.m_v, right ) );
-@@ -2366,7 +2442,7 @@ public:
+@@ -2366,7 +2449,7 @@ public:
  	{
  		return Col8( _mm_mulhi_epu16( left.m_v, _mm_set1_epi16( (unsigned short)right ) ) );
  	}
@@ -1777,7 +1824,7 @@ index f959e20..1a2f6b8 100644
  	friend Col8 operator*( Arg left, int right )
  	{
  		return Col8( _mm_mulhi_epi16( left.m_v, _mm_set1_epi16( (short)right ) ) );
-@@ -2374,12 +2450,7 @@ public:
+@@ -2374,12 +2457,7 @@ public:
  
  	template<const int n>
  	friend Col8 ExtendSign(Arg a);
@@ -1791,7 +1838,7 @@ index f959e20..1a2f6b8 100644
  	friend Col8 HorizontalMin(Arg a)
  	{
  		__m128i res = a.m_v;
-@@ -2420,17 +2491,13 @@ public:
+@@ -2420,17 +2498,13 @@ public:
  
  	template<const int n>
  	friend Col8 ShiftUp(Arg a);
@@ -1812,7 +1859,7 @@ index f959e20..1a2f6b8 100644
  		res = _mm_unpackhi_epi16( res, _mm_setzero_si128() );
  
  #ifdef _MSV_VER
-@@ -2445,7 +2512,7 @@ public:
+@@ -2445,7 +2519,7 @@ public:
  
  	friend Col4 RepeatUpper(Arg a, const unsigned dummy) {
  		__m128i res = a.m_v;
@@ -1821,7 +1868,7 @@ index f959e20..1a2f6b8 100644
  		res = _mm_unpackhi_epi16( res, _mm_setzero_si128() );
  		res = _mm_shuffle_epi32( res, SQUISH_SSE_SPLAT(3) );
  
-@@ -2458,10 +2525,10 @@ public:
+@@ -2458,10 +2532,10 @@ public:
  
  		return Col4( res );
  	}
@@ -1834,7 +1881,7 @@ index f959e20..1a2f6b8 100644
  		res = _mm_unpackhi_epi16( a.m_v, b.m_v );
  		res = _mm_unpackhi_epi16( res, _mm_setzero_si128() );
  		res = _mm_unpackhi_epi64( res, res );
-@@ -2478,7 +2545,7 @@ public:
+@@ -2478,7 +2552,7 @@ public:
  
  	friend Col4 ReplicateUpper(Arg a, Arg b, const unsigned dummy) {
  		__m128i res;
@@ -1843,7 +1890,7 @@ index f959e20..1a2f6b8 100644
  		res = _mm_unpackhi_epi16( a.m_v, b.m_v );
  		res = _mm_unpackhi_epi16( res, _mm_setzero_si128() );
  		res = _mm_unpackhi_epi32( res, res );
-@@ -2495,7 +2562,7 @@ public:
+@@ -2495,7 +2569,7 @@ public:
  
  	friend Col4 ExpandUpper(Arg a, const signed dummy) {
  		__m128i res = a.m_v;
@@ -1852,7 +1899,7 @@ index f959e20..1a2f6b8 100644
  		res = _mm_unpackhi_epi16( res, res );
  		res = _mm_srai_epi32( res, 16 );
  
-@@ -2524,10 +2591,10 @@ public:
+@@ -2524,10 +2598,10 @@ public:
  
  		return Col4( res );
  	}
@@ -1865,7 +1912,7 @@ index f959e20..1a2f6b8 100644
  		res = _mm_unpackhi_epi32( a.m_v, b.m_v );
  		res = _mm_srai_epi32( res, 16 );
  		res = _mm_unpackhi_epi64( res, res );
-@@ -2544,11 +2611,11 @@ public:
+@@ -2544,11 +2618,11 @@ public:
  
  	friend Col4 ReplicateUpper(Arg a, Arg b, const signed dummy) {
  		__m128i res;
@@ -1879,7 +1926,7 @@ index f959e20..1a2f6b8 100644
  #ifdef _MSV_VER
  		assert(res.m128i_i32[0] == a.m_v.m128i_i16[7]);
  		assert(res.m128i_i32[1] == a.m_v.m128i_i16[7]);
-@@ -2559,7 +2626,7 @@ public:
+@@ -2559,7 +2633,7 @@ public:
  		return Col4( res );
  	}
  #pragma warning ( pop )
@@ -1888,7 +1935,7 @@ index f959e20..1a2f6b8 100644
  	/*
  	friend Col4 Expand(Arg a, int ia) {
  		__m128i res = _mm_setzero_si128();
-@@ -2601,17 +2668,17 @@ public:
+@@ -2601,17 +2675,17 @@ public:
  		return Col4( res );
  	}
  	*/
@@ -1909,7 +1956,7 @@ index f959e20..1a2f6b8 100644
  	friend Col8 CompareAllLessThan( Arg left, Arg right )
  	{
  		return Col8( _mm_cmplt_epi16( left.m_v, right.m_v ) );
-@@ -2620,9 +2687,21 @@ public:
+@@ -2620,9 +2694,22 @@ public:
  private:
  	__m128i m_v;
  
@@ -1926,13 +1973,14 @@ index f959e20..1a2f6b8 100644
 +template<const int n>
 +Col8 ShiftUp(Col8::Arg a)
 +{
-+    return Col8( _mm_slli_si128( a.m_v, n << 1 ) );
++	constexpr int n_shift_left_1 = n << 1;
++    return Col8( _mm_slli_si128( a.m_v, n_shift_left_1 ) );
 +}
 +
  #define VEC4_CONST( X ) Vec4( X )
  
  class Vec3
-@@ -2649,7 +2728,7 @@ public:
+@@ -2649,7 +2736,7 @@ public:
  		m_v = _mm_unpacklo_ps(_mm_load_ss(x), _mm_load_ss(y));
  		m_v = _mm_movelh_ps(m_v, _mm_load_ss(z));
  	}
@@ -1941,7 +1989,7 @@ index f959e20..1a2f6b8 100644
  	Vec3( bool x, bool y, bool z ) : m_v( _mm_castsi128_ps( _mm_setr_epi32( x ? ~0 : 0, y ? ~0 : 0, z ? ~0 : 0, 0 ) ) ) {}
  
  	Vec3( float x, float y, float z ) : m_v( _mm_setr_ps( x, y, z, 0.0f ) ) {}
-@@ -2662,7 +2741,7 @@ public:
+@@ -2662,7 +2749,7 @@ public:
  	void StoreX(float *x) const { _mm_store_ss(x, m_v); }
  	void StoreY(float *y) const { _mm_store_ss(y, _mm_shuffle_ps( m_v, m_v, SQUISH_SSE_SPLAT( 1 ) )); }
  	void StoreZ(float *z) const { _mm_store_ss(z, _mm_movehl_ps( m_v, m_v ) ); }
@@ -1950,7 +1998,7 @@ index f959e20..1a2f6b8 100644
  	float X() const { return ((float *)&m_v)[0]; }
  	float Y() const { return ((float *)&m_v)[1]; }
  	float Z() const { return ((float *)&m_v)[2]; }
-@@ -2729,7 +2808,7 @@ public:
+@@ -2729,7 +2816,7 @@ public:
  		m_v = _mm_mul_ps( m_v, v.m_v );
  		return *this;
  	}
@@ -1959,7 +2007,7 @@ index f959e20..1a2f6b8 100644
  	Vec3& operator/=( Arg v )
  	{
  		*this *= Reciprocal( v );
-@@ -2863,16 +2942,7 @@ public:
+@@ -2863,16 +2950,7 @@ public:
  
  	template<const int n>
  	friend Vec3 RotateLeft( Arg a );
@@ -1977,7 +2025,7 @@ index f959e20..1a2f6b8 100644
  
  	friend Vec3 HorizontalAdd( Arg a )
  	{
-@@ -2974,7 +3044,7 @@ public:
+@@ -2974,7 +3052,7 @@ public:
  
  		return Vec3( res );
  	}
@@ -1986,7 +2034,7 @@ index f959e20..1a2f6b8 100644
  	friend Vec3 HorizontalMaxXY( Arg a )
  	{
  		__m128 res = a.m_v;
-@@ -2986,7 +3056,7 @@ public:
+@@ -2986,7 +3064,7 @@ public:
  
  		return Vec3( res );
  	}
@@ -1995,7 +2043,7 @@ index f959e20..1a2f6b8 100644
  	friend Vec3 HorizontalMinXY( Arg a )
  	{
  		__m128 res = a.m_v;
-@@ -3063,37 +3133,6 @@ public:
+@@ -3063,37 +3141,6 @@ public:
  
  	template<const bool disarm>
  	friend Vec3 Complement( Arg left );
@@ -2033,7 +2081,7 @@ index f959e20..1a2f6b8 100644
  
  	template<const bool disarm>
  	friend Vec3 Complement( Vec3 &left, Vec3 &right );
-@@ -3104,20 +3143,20 @@ public:
+@@ -3104,20 +3151,20 @@ public:
  			Vec3 len = (left * left) + (right * right);
  			Vec3 adj = ReciprocalSqrt(Max(Vec3(1.0f), len));
  
@@ -2058,7 +2106,7 @@ index f959e20..1a2f6b8 100644
  			return Sqrt(Vec3(1.0f) - len);
  		}
  	}
-@@ -3168,7 +3207,7 @@ public:
+@@ -3168,7 +3215,7 @@ public:
  	{
  		return Vec3( _mm_and_ps( a.m_v, _mm_castsi128_ps( _mm_set1_epi32( 0x7FFFFFFF ) ) ) );
  	}
@@ -2067,7 +2115,7 @@ index f959e20..1a2f6b8 100644
  	friend Vec3 Neg( Arg a )
  	{
  		return Vec3( _mm_or_ps( a.m_v, _mm_castsi128_ps( _mm_set1_epi32( 0x80000000 ) ) ) );
-@@ -3192,21 +3231,9 @@ public:
+@@ -3192,21 +3239,9 @@ public:
  		return Min(one, Max(zero, *this));
  	}
  
@@ -2092,7 +2140,7 @@ index f959e20..1a2f6b8 100644
  
  	friend Vec3 Truncate( Arg v )
  	{
-@@ -3296,7 +3323,7 @@ public:
+@@ -3296,7 +3331,7 @@ public:
  	{
  		return Vec3( _mm_cmpneq_ps( m_v, _mm_set1_ps( 1.0f ) ) );
  	}
@@ -2101,7 +2149,7 @@ index f959e20..1a2f6b8 100644
  	friend Vec3 TransferZ( Arg left, Arg right )
  	{
  		return Vec3( _mm_shuffle_ps( left.m_v, right.m_v, SQUISH_SSE_SHUF( 0, 1, 2, 3 ) ) );
-@@ -3351,9 +3378,70 @@ public:
+@@ -3351,9 +3386,70 @@ public:
  private:
  	__m128 m_v;
  
@@ -2173,7 +2221,7 @@ index f959e20..1a2f6b8 100644
  template<const bool round>
  Col3 FloatToUHalf( Vec3::Arg v );
  template<const bool round>
-@@ -3382,7 +3470,7 @@ Col3 FloatToSHalf( Vec3::Arg v )
+@@ -3382,7 +3478,7 @@ Col3 FloatToSHalf( Vec3::Arg v )
  	return h;
  }
  
@@ -2182,7 +2230,7 @@ index f959e20..1a2f6b8 100644
  {
  	Vec3 f;
  
-@@ -3393,7 +3481,7 @@ Vec3 UHalfToFloat( Col3::Arg v )
+@@ -3393,7 +3489,7 @@ Vec3 UHalfToFloat( Col3::Arg v )
  	return f;
  }
  
@@ -2191,7 +2239,7 @@ index f959e20..1a2f6b8 100644
  {
  	Vec3 f;
  
-@@ -3427,7 +3515,7 @@ public:
+@@ -3427,7 +3523,7 @@ public:
  		m_v = arg.m_v;
  		return *this;
  	}
@@ -2200,7 +2248,7 @@ index f959e20..1a2f6b8 100644
  	operator Vec3()
  	{
  		return Vec3(m_v);
-@@ -3458,21 +3546,21 @@ public:
+@@ -3458,21 +3554,21 @@ public:
  		m_v = _mm_load_ss(x);
  		m_v = _mm_shuffle_ps( m_v, m_v, SQUISH_SSE_SPLAT( 0 ) );
  	}
@@ -2225,7 +2273,7 @@ index f959e20..1a2f6b8 100644
  	Vec4( bool x, bool y, bool z, bool w ) : m_v( _mm_castsi128_ps( _mm_setr_epi32( x ? ~0 : 0, y ? ~0 : 0, z ? ~0 : 0, w ? ~0 : 0 ) ) ) {}
  
  	Vec4( int x, int y, int z, int w ) : m_v( _mm_cvtepi32_ps( _mm_setr_epi32( x, y, z, w ) ) ) {}
-@@ -3498,23 +3586,17 @@ public:
+@@ -3498,23 +3594,17 @@ public:
  	{
  		return Vec3( m_v );
  	}
@@ -2252,7 +2300,7 @@ index f959e20..1a2f6b8 100644
  
  	void StoreX(float *x) const { _mm_store_ss(x, m_v); }
  	void StoreY(float *y) const { _mm_store_ss(y, _mm_shuffle_ps( m_v, m_v, SQUISH_SSE_SPLAT( 1 ) )); }
-@@ -3619,7 +3701,7 @@ public:
+@@ -3619,7 +3709,7 @@ public:
  		m_v = _mm_mul_ps( m_v, v.m_v );
  		return *this;
  	}
@@ -2261,7 +2309,7 @@ index f959e20..1a2f6b8 100644
  	Vec4& operator*=( float v )
  	{
  		m_v = _mm_mul_ps( m_v, Vec4( v ).m_v );
-@@ -3631,7 +3713,7 @@ public:
+@@ -3631,7 +3721,7 @@ public:
  		*this *= Reciprocal( v );
  		return *this;
  	}
@@ -2270,7 +2318,7 @@ index f959e20..1a2f6b8 100644
  	Vec4& operator/=( float v )
  	{
  		*this *= Reciprocal( Vec4( v ) );
-@@ -3732,16 +3814,7 @@ public:
+@@ -3732,16 +3822,7 @@ public:
  
  	template<const int a, const int b, const int c, const int d>
  	friend Vec4 Merge( Arg lo, Arg hi );
@@ -2288,7 +2336,7 @@ index f959e20..1a2f6b8 100644
  
  	template<const int f, const int t>
  	friend Vec4 Shuffle( Arg a );
-@@ -3900,7 +3973,7 @@ public:
+@@ -3900,7 +3981,7 @@ public:
  
  		return Vec4( res );
  	}
@@ -2297,7 +2345,7 @@ index f959e20..1a2f6b8 100644
  	friend Vec4 HorizontalMaxXY( Arg a )
  	{
  		__m128 res = a.m_v;
-@@ -3912,7 +3985,7 @@ public:
+@@ -3912,7 +3993,7 @@ public:
  
  		return Vec4( res );
  	}
@@ -2306,7 +2354,7 @@ index f959e20..1a2f6b8 100644
  	friend Vec4 HorizontalMinXY( Arg a )
  	{
  		__m128 res = a.m_v;
-@@ -3965,7 +4038,7 @@ public:
+@@ -3965,7 +4046,7 @@ public:
  
  		return rsq;
  	}
@@ -2315,7 +2363,7 @@ index f959e20..1a2f6b8 100644
  	friend Vec4 Normalize( Arg left )
  	{
  		Vec4 sum = HorizontalAdd( Vec4( _mm_mul_ps( left.m_v, left.m_v ) ) );
-@@ -3973,7 +4046,7 @@ public:
+@@ -3973,7 +4054,7 @@ public:
  
  		return left * rsq;
  	}
@@ -2324,7 +2372,7 @@ index f959e20..1a2f6b8 100644
  	friend Vec4 Normalize( Vec4& x, Vec4& y, Vec4& z )
  	{
  		Vec4 xx = x * x;
-@@ -4006,7 +4079,7 @@ public:
+@@ -4006,7 +4087,7 @@ public:
  		res = _mm_add_ps( res, _mm_shuffle_ps( res, res, SQUISH_SSE_SHUF( 1, 0, 1, 0 ) ) );
  #endif
  		if (!disarm) {
@@ -2333,7 +2381,7 @@ index f959e20..1a2f6b8 100644
  			if ( _mm_comigt_ss( res, rez ) ) {
  				res = ReciprocalSqrt( Vec4(res) ).m_v;
  				res = _mm_shuffle_ps( res, res, SQUISH_SSE_SHUF( 0, 0, 0, 0 ) );
-@@ -4028,7 +4101,7 @@ public:
+@@ -4028,7 +4109,7 @@ public:
  			res = _mm_and_ps( res, _mm_castsi128_ps ( _mm_setr_epi32( ~0, ~0, ~0,  0 ) ) );
  		}
  
@@ -2342,7 +2390,7 @@ index f959e20..1a2f6b8 100644
  		return Vec4( res );
  	}
  
-@@ -4041,20 +4114,20 @@ public:
+@@ -4041,20 +4122,20 @@ public:
  			Vec4 len = left * left + right * right;
  			Vec4 adj = ReciprocalSqrt(Max(Vec4(1.0f), len));
  
@@ -2367,7 +2415,7 @@ index f959e20..1a2f6b8 100644
  			return Sqrt(Vec4(1.0f) - len);
  		}
  	}
-@@ -4105,7 +4178,7 @@ public:
+@@ -4105,7 +4186,7 @@ public:
  	{
  		return Vec4( _mm_and_ps( a.m_v, _mm_castsi128_ps( _mm_set1_epi32( 0x7FFFFFFF ) ) ) );
  	}
@@ -2376,7 +2424,7 @@ index f959e20..1a2f6b8 100644
  	friend Vec4 Neg( Arg a )
  	{
  		return Vec4( _mm_or_ps( a.m_v, _mm_castsi128_ps( _mm_set1_epi32( 0x80000000 ) ) ) );
-@@ -4131,19 +4204,7 @@ public:
+@@ -4131,19 +4212,7 @@ public:
  
  	template<const bool round>
  	friend Col4 FloatToInt( Vec4::Arg v );
@@ -2397,7 +2445,7 @@ index f959e20..1a2f6b8 100644
  
  	friend Vec4 Truncate( Arg v )
  	{
-@@ -4159,7 +4220,7 @@ public:
+@@ -4159,7 +4228,7 @@ public:
  
  		// clear out the MMX multimedia state to allow FP calls later
  		_mm_empty();
@@ -2406,7 +2454,7 @@ index f959e20..1a2f6b8 100644
  		return Vec4( truncated );
  #else
  		// use SSE2 instructions
-@@ -4188,7 +4249,7 @@ public:
+@@ -4188,7 +4257,7 @@ public:
  	{
  		return _mm_movemask_ps( _mm_cmpeq_ps( left.m_v, right.m_v ) );
  	}
@@ -2415,7 +2463,7 @@ index f959e20..1a2f6b8 100644
  	friend int CompareNotEqualTo( Arg left, Arg right )
  	{
  		return _mm_movemask_ps( _mm_cmpneq_ps( left.m_v, right.m_v ) );
-@@ -4198,7 +4259,7 @@ public:
+@@ -4198,7 +4267,7 @@ public:
  	{
  		return _mm_movemask_ps( _mm_cmplt_ps( left.m_v, right.m_v ) );
  	}
@@ -2424,7 +2472,7 @@ index f959e20..1a2f6b8 100644
  	friend int CompareGreaterThan( Arg left, Arg right )
  	{
  		return _mm_movemask_ps( _mm_cmpgt_ps( left.m_v, right.m_v ) );
-@@ -4234,17 +4295,17 @@ public:
+@@ -4234,17 +4303,17 @@ public:
  	{
  		return Col4( _mm_cmpeq_epi32( _mm_castps_si128 ( left.m_v ), _mm_castps_si128 ( right.m_v ) ) );
  	}
@@ -2445,7 +2493,7 @@ index f959e20..1a2f6b8 100644
  	friend int CompareFirstLessEqualTo( Arg left, Arg right )
  	{
  		return _mm_comile_ss( left.m_v, right.m_v );
-@@ -4264,17 +4325,17 @@ public:
+@@ -4264,17 +4333,17 @@ public:
  	{
  		return _mm_comieq_ss( left.m_v, right.m_v );
  	}
@@ -2466,7 +2514,7 @@ index f959e20..1a2f6b8 100644
  	friend Vec4 IsNotEqualTo( Arg left, Arg right )
  	{
  		return Vec4( _mm_cmpneq_ps( left.m_v, right.m_v ) );
-@@ -4326,7 +4387,7 @@ public:
+@@ -4326,7 +4395,7 @@ public:
  	{
  		return Vec4( _mm_and_ps( left.m_v, _mm_castsi128_ps ( _mm_setr_epi32(  0,  0,  0, ~0 ) ) ) );
  	}
@@ -2475,7 +2523,7 @@ index f959e20..1a2f6b8 100644
  	friend Vec4 CollapseW( Arg x, Arg y, Arg z, Arg w )
  	{
  		return Vec4( _mm_unpackhi_ps( _mm_unpackhi_ps( x.m_v, z.m_v ), _mm_unpackhi_ps( y.m_v, w.m_v ) ) );
-@@ -4420,6 +4481,41 @@ private:
+@@ -4420,6 +4489,41 @@ private:
  	__m128 m_v;
  };
  
@@ -2517,7 +2565,7 @@ index f959e20..1a2f6b8 100644
  template<const bool round>
  Col4 FloatToUHalf( Vec4::Arg v );
  template<const bool round>
-@@ -4450,7 +4546,7 @@ Col4 FloatToSHalf( Vec4::Arg v )
+@@ -4450,7 +4554,7 @@ Col4 FloatToSHalf( Vec4::Arg v )
  	return h;
  }
  
@@ -2526,7 +2574,7 @@ index f959e20..1a2f6b8 100644
  {
  	Vec4 f;
  
-@@ -4462,7 +4558,7 @@ Vec4 UHalfToFloat( Col4::Arg v )
+@@ -4462,7 +4566,7 @@ Vec4 UHalfToFloat( Col4::Arg v )
  	return f;
  }
  

+ 2 - 0
package_build_list_host_linux-aarch64.json

@@ -37,6 +37,7 @@
         "qt-5.15.2-rev8-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/Qt --platform-name Linux-aarch64 --clean",
         "SPIRVCross-2021.04.29-rev1-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/SPIRVCross --platform-name Linux-aarch64 --clean",
         "SQLite-3.37.2-rev1-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/sqlite --platform-name Linux-aarch64 --clean",
+        "squish-ccr-deb557d-rev1-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/squish-ccr --platform-name Linux-aarch64 --clean",
         "tiff-4.2.0.15-rev3-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/tiff --platform-name Linux-aarch64 --clean",
         "v-hacd-2.3-1a49edf-rev1-linux-aarch64": "package-system/v-hacd/build_package_image.py --platform-name linux-aarch64",
         "vulkan-validationlayers-1.2.198-rev1-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/vulkan-validationlayers --platform-name Linux-aarch64 --clean",
@@ -76,6 +77,7 @@
         "qt-5.15.2-rev8-linux-aarch64": "package-system/Qt/temp/qt-linux-aarch64",
         "SPIRVCross-2021.04.29-rev1-linux-aarch64": "package-system/SPIRVCross/temp/SPIRVCross-linux-aarch64",
         "SQLite-3.37.2-rev1-linux-aarch64": "package-system/sqlite/temp/SQLite-linux-aarch64",
+        "squish-ccr-deb557d-rev1-linux-aarch64": "package-system/squish-ccr/temp/squish-ccr-linux-aarch64",
         "tiff-4.2.0.15-rev3-linux-aarch64": "package-system/tiff/temp/tiff-linux-aarch64",
         "v-hacd-2.3-1a49edf-rev1-linux-aarch64": "package-system/v-hacd-linux-aarch64",
         "vulkan-validationlayers-1.2.198-rev1-linux-aarch64": "package-system/vulkan-validationlayers/temp/vulkan-validationlayers-linux-aarch64",

+ 4 - 2
package_build_list_host_linux.json

@@ -30,7 +30,8 @@
         "v-hacd-2.3-1a49edf-rev1-linux": "package-system/v-hacd/build_package_image.py --platform-name linux",
         "SPIRVCross-2021.04.29-rev1-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/SPIRVCross --platform-name Linux --package-root ../../package-system --clean",
         "SQLite-3.37.2-rev1-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/sqlite --platform-name Linux --package-root ../../package-system --clean",
-        "squish-ccr-deb557d-rev1-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/squish-ccr --platform-name Linux --package-root ../../package-system --clean",
+        "squish-ccr-deb557d-rev1-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/squish-ccr --platform-name Linux --clean",
+        "squish-ccr-deb557d-rev1-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/squish-ccr --platform-name Linux-aarch64 --clean",
         "astc-encoder-3.2-rev3-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/astc-encoder --platform-name Linux --package-root ../../package-system --clean",
         "DirectXShaderCompilerDxc-1.6.2112-o3de-rev1-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/DirectXShaderCompiler --platform-name Linux --package-root ../../package-system --clean",
         "azslc-1.8.15-rev2-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/azslc --platform-name Linux --package-root ../../package-system/azslc/temp --clean",
@@ -64,7 +65,8 @@
         "OpenXR-1.0.22-rev2-linux": "package-system/OpenXR-linux",
         "openimageio-opencolorio-2.3.17-rev2-linux": "package-system/openimageio-opencolorio/temp/package-linux",
         "SPIRVCross-2021.04.29-rev1-linux": "package-system/SPIRVCross-linux",
-        "squish-ccr-deb557d-rev1-linux": "package-system/squish-ccr-linux",
+        "squish-ccr-deb557d-rev1-linux": "package-system/squish-ccr/temp/squish-ccr-linux",
+        "squish-ccr-deb557d-rev1-linux-aarch64": "package-system/squish-ccr/temp/squish-ccr-linux-aarch64",
         "astc-encoder-3.2-rev3-linux": "package-system/astc-encoder-linux",
         "DirectXShaderCompilerDxc-1.6.2112-o3de-rev1-linux": "package-system/DirectXShaderCompilerDxc-linux",
         "azslc-1.8.15-rev2-linux": "package-system/azslc/temp/azslc-linux",