Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge with master #192

Merged
merged 49 commits into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
16604f9
Fix version getting out of sync #175
markos Oct 3, 2023
0d2f9cc
Fix 'unqualified call to std::move' errors in clang 15+
markos Oct 3, 2023
db7b23a
move definition of RAGEL_C_FLAGS earlier to catch tools/hscollider
markos Oct 3, 2023
9a17474
more std::move fixes
markos Oct 3, 2023
93d3e7e
fix -Wunused warnings on debug
Oct 4, 2023
9aa6144
Reduce unit test runtimes dramatically for debug builds
markos Oct 4, 2023
b7d1bc0
clang 15 (but not 16) fails on ppc64le with -Wdeprecate-lax-vec-conv-all
markos Oct 4, 2023
354fda4
add conditional for __clang__
markos Oct 4, 2023
2e88df1
use the conditional in the right way
markos Oct 4, 2023
da88abf
missed one pragma
markos Oct 4, 2023
72afe16
clang 16 as well
markos Oct 4, 2023
35c0711
use the right type of cast
markos Oct 4, 2023
e369681
Don't run regression UE_2595 on debug, it times out CI
markos Oct 5, 2023
22a24f1
Reduce debug unit tests runtime even more
markos Oct 5, 2023
98d7434
__builtin_constant_p is true in the wrong case on gcc 13.2. Exclude f…
markos Oct 6, 2023
a26661c
remove extra print
markos Oct 6, 2023
55cae8c
detect arm_sve.h when using clang on fat runtime builds
markos Oct 6, 2023
7a2ccd7
fix fat & normal build errors on arm
markos Oct 6, 2023
e8e2957
re-add missing file to x86 builds
markos Oct 7, 2023
6900806
add cpuid_flags to ppc64le as well
markos Oct 7, 2023
1320d01
add missing file
markos Oct 7, 2023
983a3a5
include extra sources for Arm on non-fat builds
markos Oct 7, 2023
9e1c43b
add src/nfa/vermicelli_simd.cpp to ppc64le
markos Oct 7, 2023
0e40310
SVE2 needs armv9-a, fix build
markos Oct 7, 2023
24ae167
WIP: Refactor CMake build system to more modular
markos Oct 8, 2023
3884f59
add missing file
markos Oct 8, 2023
6beeb37
increase cmake_minimum_version, basically the one in Debian 11
markos Oct 8, 2023
0d5ce27
fix defaults for -march for x86
markos Oct 8, 2023
ee8a3c2
fix cflags detection for x86
markos Oct 8, 2023
e85f7cc
fix sqlite3 version detection
markos Oct 8, 2023
5e4a1ed
fix x86 fat binary build
markos Oct 8, 2023
981576a
fix default arch/tune flags for ppc64le
markos Oct 8, 2023
4d539f2
fix cmake refactor for arm builds
Oct 9, 2023
9445f49
is not known at that stage
markos Oct 9, 2023
1619dba
remove unneeded option
markos Oct 9, 2023
7909b91
remove vermicelli_simd.cpp to fix redefinition build failure on SVE2 …
markos Oct 9, 2023
c4b7a44
SVE2 is armv9-a but gcc 11 does not recognize that
markos Oct 9, 2023
1fdeedf
set default value
markos Oct 9, 2023
5a4d900
fix default arch definition for non fat builds on arm
markos Oct 9, 2023
aa8af26
Merge pull request #181 from VectorCamp/bugfix/fix-clang15-compilatio…
markos Oct 10, 2023
a659555
Ubuntu 20.04 gcc does not define HWCAP2_SVE2 #180
markos Oct 10, 2023
02474c4
Merge pull request #185 from VectorCamp/bugfix/fix-inconsistent-versi…
markos Oct 11, 2023
de94286
Merge pull request #186 from VectorCamp/bugfix/fix-compilation-arm-ub…
markos Oct 25, 2023
71bbf97
make pkgconfig a requirement
Oct 31, 2023
9c139c3
Correct set_source_files_properties usage
mlmitch Oct 31, 2023
21c45f3
Merge pull request #188 from VectorCamp/bugfix/require-pkg-config
markos Oct 31, 2023
9d0599a
Merge pull request #189 from mlmitch/develop
markos Nov 1, 2023
b5f1a82
Move VERM16 enums to the end of the list
markos Nov 16, 2023
80f84a1
Merge pull request #191 from VectorCamp/bugfix/fix-segfault-arm-sve2
markos Nov 17, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
685 changes: 155 additions & 530 deletions CMakeLists.txt

Large diffs are not rendered by default.

16 changes: 0 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,6 @@ matching of regular expressions across streams of data.

Vectorscan is typically used in a DPI library stack, just like Hyperscan.

# Cross Compiling for AArch64

- To cross compile for AArch64, first adjust the variables set in cmake/setenv-arm64-cross.sh.
- `export CROSS=<arm-cross-compiler-dir>/bin/aarch64-linux-gnu-`
- `export CROSS_SYS=<arm-cross-compiler-system-dir>`
- `export BOOST_PATH=<boost-source-dir>`
- Set the environment variables:
- `source cmake/setenv-arm64-cross.sh`
- Configure Vectorscan:
- `mkdir <build-dir-name>`
- `cd <build-dir>`
- `cmake -DCROSS_COMPILE_AARCH64=1 <hyperscan-source-dir> -DCMAKE_TOOLCHAIN_FILE=<hyperscan-source-dir>/cmake/arm64-cross.cmake`
- Build Vectorscan:
- `make -jT` where T is the number of threads used to compile.
- `cmake --build . -- -j T` can also be used instead of make.

# Compiling for SVE

The following cmake variables can be set in order to target Arm's Scalable
Expand Down
207 changes: 0 additions & 207 deletions cmake/arch.cmake

This file was deleted.

91 changes: 91 additions & 0 deletions cmake/archdetect.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
if (USE_CPU_NATIVE)
# Detect best GNUCC_ARCH to tune for
if (CMAKE_COMPILER_IS_GNUCC)
message(STATUS "gcc version ${CMAKE_C_COMPILER_VERSION}")

# If gcc doesn't recognise the host cpu, then mtune=native becomes
# generic, which isn't very good in some cases. march=native looks at
# cpuid info and then chooses the best microarch it can (and replaces
# the flag), so use that for tune.

set(TUNE_FLAG "mtune")
set(GNUCC_TUNE "")
message(STATUS "ARCH_FLAG '${ARCH_FLAG}' '${GNUCC_ARCH}', TUNE_FLAG '${TUNE_FLAG}' '${GNUCC_TUNE}' ")

# arg1 might exist if using ccache
string (STRIP "${CMAKE_C_COMPILER_ARG1}" CC_ARG1)
set (EXEC_ARGS ${CC_ARG1} -c -Q --help=target -${ARCH_FLAG}=native -${TUNE_FLAG}=native)
execute_process(COMMAND ${CMAKE_C_COMPILER} ${EXEC_ARGS}
OUTPUT_VARIABLE _GCC_OUTPUT)
set(_GCC_OUTPUT_TUNE ${_GCC_OUTPUT})
string(FIND "${_GCC_OUTPUT}" "${ARCH_FLAG}=" POS)
string(SUBSTRING "${_GCC_OUTPUT}" ${POS} -1 _GCC_OUTPUT)
string(REGEX REPLACE "${ARCH_FLAG}=[ \t]*([^ \n]*)[ \n].*" "\\1" GNUCC_ARCH "${_GCC_OUTPUT}")

string(FIND "${_GCC_OUTPUT_TUNE}" "${TUNE_FLAG}=" POS_TUNE)
string(SUBSTRING "${_GCC_OUTPUT_TUNE}" ${POS_TUNE} -1 _GCC_OUTPUT_TUNE)
string(REGEX REPLACE "${TUNE_FLAG}=[ \t]*([^ \n]*)[ \n].*" "\\1" GNUCC_TUNE "${_GCC_OUTPUT_TUNE}")

message(STATUS "ARCH_FLAG '${ARCH_FLAG}' '${GNUCC_ARCH}', TUNE_FLAG '${TUNE_FLAG}' '${GNUCC_TUNE}' ")

# test the parsed flag
set (EXEC_ARGS ${CC_ARG1} -E - -${ARCH_FLAG}=${GNUCC_ARCH} -${TUNE_FLAG}=${GNUCC_TUNE})
execute_process(COMMAND ${CMAKE_C_COMPILER} ${EXEC_ARGS}
OUTPUT_QUIET ERROR_QUIET
INPUT_FILE /dev/null
RESULT_VARIABLE GNUCC_TUNE_TEST)

if (NOT GNUCC_TUNE_TEST EQUAL 0)
message(WARNING "Something went wrong determining gcc tune: -mtune=${GNUCC_TUNE} not valid, falling back to -mtune=native")
set(GNUCC_TUNE native)
else()
set(GNUCC_TUNE ${GNUCC_TUNE})
message(STATUS "gcc will tune for ${GNUCC_ARCH}, ${GNUCC_TUNE}")
endif()
elseif (CMAKE_COMPILER_IS_CLANG)
if (ARCH_IA32 OR ARCH_X86_64)
set(GNUCC_ARCH x86_64_v2)
set(TUNE_FLAG generic)
elseif(ARCH_AARCH64)
if (BUILD_SVE2_BITPERM)
set(GNUCC_ARCH ${SVE2_BITPERM_ARCH})
elseif (BUILD_SVE2)
set(GNUCC_ARCH ${SVE2_ARCH})
elseif (BUILD_SVE)
set(GNUCC_ARCH ${SVE_ARCH})
else ()
set(GNUCC_ARCH ${ARMV8_ARCH})
endif()
set(TUNE_FLAG generic)
elseif(ARCH_ARM32)
set(GNUCC_ARCH armv7a)
set(TUNE_FLAG generic)
else()
set(GNUCC_ARCH native)
set(TUNE_FLAG generic)
endif()
message(STATUS "clang will tune for ${GNUCC_ARCH}, ${TUNE_FLAG}")
endif()
else()
if (ARCH_IA32 OR ARCH_X86_64)
set(GNUCC_ARCH native)
set(TUNE_FLAG generic)
elseif(ARCH_AARCH64)
if (BUILD_SVE2_BITPERM)
set(GNUCC_ARCH ${SVE2_BITPERM_ARCH})
elseif (BUILD_SVE2)
set(GNUCC_ARCH ${SVE2_ARCH})
elseif (BUILD_SVE)
set(GNUCC_ARCH ${SVE_ARCH})
else ()
set(GNUCC_ARCH ${ARMV8_ARCH})
endif()
set(TUNE_FLAG generic)
elseif(ARCH_ARM32)
set(GNUCC_ARCH armv7a)
set(TUNE_FLAG generic)
else()
set(GNUCC_ARCH power9)
set(TUNE_FLAG power9)
endif()
endif()
Loading