intel / intel-ipsec-mb

Intel(R) Multi-Buffer Crypto for IPSec
BSD 3-Clause "New" or "Revised" License
288 stars 88 forks source link

CMake: Requires nasm 2.14 at least #133

Closed uilianries closed 10 months ago

uilianries commented 10 months ago

Description

When using make to build intel-ipsec-mb, the Makefile has a check for nasm minimal version. However, it does not happen when running CMake.

Affected parts

Motivation and Context

This PR replaces #132 by checking the nasm version to 2.14 or higher.

How Has This Been Tested?

The CMake variable CMAKE_ASM_NASM_COMPILER_VERSION is not provided directly (see CMake source code: https://gitlab.kitware.com/cmake/cmake/-/blob/master/Modules/CMakeASM_NASMInformation.cmake) so we need to parse nasm output and collect its version.

Once it's done, we just need to run cmake as usual:

$ cmake --build build/
-- Project Version: 1.4.0
-- AESNI emulation support... OFF
-- SAFE_OPTIONS...            ON
-- SAFE_PARAM...              ON
-- SAFE_DATA...               ON
-- SAFE_LOOKUP...             ON
-- BUILD_SHARED_LIBS...       ON
-- CMAKE_GENERATOR...         Unix Makefiles
-- BUILD_TYPE...              Release
-- CMAKE_VERBOSE_MAKEFILE...  OFF
-- OPERATING SYSTEM...        Linux
-- NASM version: 2.14
-- LIB_INSTALL_DIR...         /usr/local/lib
-- INCLUDE_INSTALL_DIR...     /usr/local/include
-- MAN_INSTALL_DIR...         /usr/local/man/man7
-- Configuring done
-- Generating done
-- Build files have been written to: /home/conan/project/build
[  0%] Building ASM_NASM object lib/CMakeFiles/IPSec_MB.dir/avx2_t1/aes192_gcm_by8_avx2.asm.o

The NASM version: 2.14 shows that nasm is present and it's version is parsed.

Types of changes

Checklist:

mdcornu commented 10 months ago

This has been merged in 9e17d6cad1f99e64f3534053a3ff096c46646058 so I'll close this PR. Thanks for your contribution 👍