Skip to content

Commit

Permalink
Fix IPP-Crypto compile error after applying patch (#144)
Browse files Browse the repository at this point in the history
* Major updates
  - Removed ```-Wno-stringop-overflow``` when using Clang (unsupported in LLVM)
  - Added ```-Wno-error=deprecated-copy``` flag when compiling with clang>=11
  - Added Intel Compiler error when using version greater than 2021.3
  - Moved patch file under dedicated folder ```cmake/patch```

* Minor updates
  - Replaced bool with Ipp8u* in keygen to avoid warning
  - Updated gtest version to ```release-1.12.1```
  • Loading branch information
Sejun Kim authored Oct 29, 2022
1 parent 6c5cb44 commit aac0eb4
Show file tree
Hide file tree
Showing 8 changed files with 142 additions and 257 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ repos:
rev: v4.0.1
hooks:
- id: trailing-whitespace
exclude: cmake/ippcrypto_patch.patch
exclude: cmake/patch/ippcrypto_patch.patch
- id: end-of-file-fixer
exclude: cmake/ippcrypto_patch.patch
exclude: cmake/patch/ippcrypto_patch.patch
- id: check-merge-conflict
- id: mixed-line-ending
- id: check-byte-order-marker
Expand Down
13 changes: 11 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,21 @@ if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX "/opt/intel/ipcl")
endif()

set(CMAKE_C_FLAGS "-O2 -Wno-error=deprecated-declarations")
set(CMAKE_CXX_FLAGS "-O2 -fpermissive -Wno-error=deprecated-declarations -Wstringop-overflow=1")
set(CMAKE_C_FLAGS "-O2 -Wno-error=deprecated-declarations -Wno-error=deprecated-copy")
set(CMAKE_CXX_FLAGS "-O2 -fpermissive -Wno-error=deprecated-declarations -Wno-error=deprecated-copy")
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/ipcl;${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/ipcl/ippcrypto")

set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_INSTALL_LIBDIR})

# Compiler version check - icx/icpx-2021.3.0 is supported
if(CMAKE_CXX_COMPILER_ID STREQUAL "IntelLLVM")
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 2021.3.0)
message(FATAL_ERROR
" ${CMAKE_CXX_COMPILER_ID}-${CMAKE_CXX_COMPILER_VERSION} is not supported."
" Please refer to Intel IPP-Crypto (https://github.com/intel/ipp-crypto"
" for more information.")
endif()
endif()

#---------------------------------------------------
option(IPCL_TEST "Enable testing" ON)
Expand Down
8 changes: 1 addition & 7 deletions cmake/gtest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ include(ExternalProject)

set(GTEST_PREFIX ${CMAKE_CURRENT_BINARY_DIR}/ext_gtest)
set(GTEST_GIT_REPO_URL https://github.com/google/googletest.git)
set(GTEST_GIT_LABEL release-1.10.0)
set(GTEST_GIT_LABEL release-1.12.1)
set(GTEST_CXX_FLAGS "${IPCL_FORWARD_CMAKE_ARGS} -fPIC")

ExternalProject_Add(
Expand All @@ -21,12 +21,6 @@ ExternalProject_Add(
INSTALL_COMMAND ""
)

# install(
# DIRECTORY ${GTEST_DESTDIR}/${CMAKE_INSTALL_PREFIX}/
# DESTINATION "."
# USE_SOURCE_PERMISSIONS
# )

ExternalProject_Get_Property(ext_gtest SOURCE_DIR BINARY_DIR)

add_library(libgtest INTERFACE)
Expand Down
2 changes: 1 addition & 1 deletion cmake/ippcrypto.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ ExternalProject_Add(
-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
-DCMAKE_INSTALL_INCLUDEDIR=${IPPCRYPTO_DEST_INCLUDE_DIR}
UPDATE_COMMAND ""
PATCH_COMMAND git apply ${CMAKE_CURRENT_LIST_DIR}/ippcrypto_patch.patch
PATCH_COMMAND git apply ${CMAKE_CURRENT_LIST_DIR}/patch/ippcrypto_patch.patch
INSTALL_COMMAND make DESTDIR=${IPPCRYPTO_DESTDIR} install
)

Expand Down
242 changes: 0 additions & 242 deletions cmake/ippcrypto_patch.patch

This file was deleted.

Loading

0 comments on commit aac0eb4

Please sign in to comment.