Skip to content

Commit

Permalink
improve codeql-action
Browse files Browse the repository at this point in the history
  • Loading branch information
ptahmose committed Mar 20, 2024
1 parent 3c574f7 commit 3fe94e5
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 8 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ option(WARPAFFINE_BUILD_CLANGTIDY "Build with Clang-Tidy" OFF)

# This option is only relevant if IPP is not found - i.e. we still try to find the IPP libraries, but if we don't find them,
# we don't fail the build. The application will then be somewhat crippled (i.e. way slower), but should nevertheless be operational.
option(WARPAFFINE_ALLOW_BUILD_WITHOUT_IPP "Allow for a build without Intel-IPP" ON)
option(WARPAFFINE_ALLOW_BUILD_WITHOUT_IPP "Allow for a build without Intel-IPP" OFF)

# This option allows to "downlad a private copy of Eigen3 and usage of this for libCZI and warpaffine". If this option is not given,
# then the availability of an Eigen3-package (from the system's package manager') is assumed and required.
Expand Down Expand Up @@ -119,7 +119,7 @@ include("${CMAKE_SOURCE_DIR}/modules/CheckForLibAtomicRequired.cmake")
CheckForAdditionalLibsRequiredForAtomic(ADDITIONAL_LIBS_REQUIRED_FOR_ATOMIC)

if (ADDITIONAL_LIBS_REQUIRED_FOR_ATOMIC)
message(STATUS "It was determined that linking to those additional libraries are necessary for using 'atomic': ${ADDITIONAL_LIBS_REQUIRED_FOR_ATOMIC}.")
message(STATUS "It was determined that linking to those additional libraries is necessary for using 'atomic': ${ADDITIONAL_LIBS_REQUIRED_FOR_ATOMIC}.")
endif()

enable_testing()
Expand Down
2 changes: 1 addition & 1 deletion libwarpaffine/brickreader/czi_brick_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class CMemBitmapFacade : public libCZI::IBitmapData
bitmapLockInfo.ptrData = this->ptrData;
bitmapLockInfo.ptrDataRoi = this->ptrData;
bitmapLockInfo.stride = this->stride;
bitmapLockInfo.size = this->stride * this->height;
bitmapLockInfo.size = static_cast<uint64_t>(this->stride) * this->height;
return bitmapLockInfo;
}

Expand Down
2 changes: 1 addition & 1 deletion libwarpaffine/dowarp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ std::vector<IntRect> DoWarp::Create2dTiling(const IntRect& rectangle)
const uint32_t rows_count = (rectangle.h + max_extent - 1) / max_extent;
const uint32_t columns_count = (rectangle.w + max_extent - 1) / max_extent;
std::vector<IntRect> tiling_result;
tiling_result.reserve(columns_count * rows_count);
tiling_result.reserve(static_cast<size_t>(columns_count) * rows_count);
for (uint32_t rows = 0; rows < rows_count; ++rows)
{
for (uint32_t columns = 0; columns < columns_count; ++columns)
Expand Down
18 changes: 14 additions & 4 deletions scripts/codeql-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,27 @@
#
# SPDX-License-Identifier: MIT

# This script is used to build the project for the CodeQL-action.
# We install the required dependencies and build the project using CMake, specifying the appropriate switches.

# Check if exactly one argument was provided
if [ "$#" -ne 1 ]; then
echo "Error: This script requires exactly one argument. This argument is the build folder."
exit 1
fi

# 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
# 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
# Update packages list and repository index
sudo apt update
#

sudo apt install intel-oneapi-ipp-devel rapidjson-dev libssl-dev libeigen3-dev libcurl4-openssl-dev
#
vcpkg install --triplet x64-linux tbb

# shellcheck source=/dev/null
source /opt/intel/oneapi/setvars.sh
cmake -B $1 -DCMAKE_BUILD_TYPE=Release -DLIBCZI_BUILD_CURL_BASED_STREAM=ON -DLIBCZI_BUILD_PREFER_EXTERNALPACKAGE_LIBCURL=OFF -DWARPAFFINE_BUILD_PREFER_EXTERNALPACKAGE_RAPIDJSON=ON -DLIBCZI_BUILD_PREFER_EXTERNALPACKAGE_EIGEN3=ON -DCMAKE_TOOLCHAIN_FILE=/usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake
cmake --build $1 --config Release "-j$(nproc)"

cmake -B "$1" -DCMAKE_BUILD_TYPE=Release -DLIBCZI_BUILD_CURL_BASED_STREAM=ON -DLIBCZI_BUILD_PREFER_EXTERNALPACKAGE_LIBCURL=OFF -DWARPAFFINE_BUILD_PREFER_EXTERNALPACKAGE_RAPIDJSON=ON -DLIBCZI_BUILD_PREFER_EXTERNALPACKAGE_EIGEN3=ON -DCMAKE_TOOLCHAIN_FILE=/usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake
cmake --build "$1" --config Release "-j$(nproc)"

0 comments on commit 3fe94e5

Please sign in to comment.