-
Notifications
You must be signed in to change notification settings - Fork 7.4k
[chimera] Add new port #10132
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
Closed
Closed
[chimera] Add new port #10132
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
a008fd6
add a port for chimera
ZMZ91 35a2f76
1. remove deprecated include 2. clear buildtrees/ before installing 3…
ZMZ91 74d0462
refine port file
ZMZ91 dda6223
1. add Build-Depends: pcre 2. add usage
ZMZ91 6c0760d
add other build depdents by hyperscan
ZMZ91 33d2618
remove debugging messages
ZMZ91 a2b0db5
note that not support windows so far
ZMZ91 e8a39aa
Merge branch 'master' into feature/port/chimera
3d056bf
1. add Supports: linux|osx; 2. add chimera:arm64-windows=fail
75559e4
Merge branch 'master' of github.com:microsoft/vcpkg into feature/port…
2d8b684
Merge branch 'master' of github.com:microsoft/vcpkg into feature/port…
a4b9263
resolve conflicts from master
dd4c62d
update baseline
883d4af
update baseline
66060c7
update baseline
95a3f3b
use function vcpkg_from_github
1e85c17
Merge branch 'feature/port/chimera' of github.com:ZMZ91/vcpkg into fe…
79e33af
update baseline
4f2ff77
update to latest hyperscan
b0d270c
remove baseline rules due to Supports added in CONTROL
be34193
Revert baseline changes.
90e7ada
Revert baseline changes.
babc9b9
update due to JackBoosY's change
1fd9412
Update ports/chimera/CONTROL
JackBoosY 74bf3d0
Update ports/chimera/CONTROL
JackBoosY 06a0ae1
Update ports/chimera/portfile.cmake
JackBoosY 707800c
[chimera] Fix unix build
498b0a7
[chimera] Fix include path
cd48b8a
Disable osx build
JackBoosY e136f08
[hyperscan chimera] fix C++ standard, and remove -Werror
strega-nil 2822f98
remove Supports: !osx
strega-nil 6b0d52c
Merge branch 'master' of github.com:microsoft/vcpkg into feature/port…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| Source: chimera | ||
| Version: 5.2.1 | ||
| Homepage: https://github.com/intel/hyperscan | ||
| Description: Chimera is a software regular expression matching engine that is a hybrid of Hyperscan and PCRE. The design goals of Chimera are to fully support PCRE syntax as well as to take advantage of the high performance nature of Hyperscan. | ||
| Build-Depends: python3, ragel, hyperscan | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| diff --git a/chimera/CMakeLists.txt b/chimera/CMakeLists.txt | ||
| index 1cd66a3..82b6468 100644 | ||
| --- a/chimera/CMakeLists.txt | ||
| +++ b/chimera/CMakeLists.txt | ||
| @@ -1,7 +1,26 @@ | ||
| # Chimera lib | ||
| +cmake_minimum_required (VERSION 2.8.11) | ||
| +project (chimera C CXX) | ||
|
|
||
| -include_directories(${PCRE_INCLUDE_DIRS}) | ||
| +set (HS_MAJOR_VERSION 5) | ||
| +set (HS_MINOR_VERSION 3) | ||
| +set (HS_PATCH_VERSION 0) | ||
| +set (HS_VERSION ${HS_MAJOR_VERSION}.${HS_MINOR_VERSION}.${HS_PATCH_VERSION}) | ||
| + | ||
| +set(CMAKE_CXX_STANDARD 11) | ||
|
|
||
| +set(HS_INTERNAL_INCLUDE_DIRS ${CMAKE_CURRENT_LIST_DIR}/../src) | ||
| + | ||
| +configure_file(${CMAKE_CURRENT_LIST_DIR}/../cmake/config.h.in ${CMAKE_BINARY_DIR}/config.h) | ||
| +configure_file(${CMAKE_CURRENT_LIST_DIR}/../src/hs_version.h.in ${CMAKE_BINARY_DIR}/hs_version.h) | ||
| + | ||
| +find_path(HS_INCLUDE_DIRS hs_common.h PATH_SUFFIXES hs) | ||
| +find_library(hs hs REQUIRED) | ||
| +find_library(hs_rt hs_runtime REQUIRED) | ||
| + | ||
| +find_path(PCRE_INCLUDE_DIRS pcre.h) | ||
| +find_library(pcre pcre REQUIRED) | ||
| +include_directories(${PCRE_INCLUDE_DIRS} ${HS_INCLUDE_DIRS} ${HS_INTERNAL_INCLUDE_DIRS} ${CMAKE_BINARY_DIR}) | ||
| # only set these after all tests are done | ||
| set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_C_FLAGS}") | ||
| set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CXX_FLAGS}") | ||
| @@ -28,11 +45,14 @@ SET(chimera_SRCS | ||
| ) | ||
|
|
||
| add_library(chimera STATIC ${chimera_SRCS}) | ||
| -add_dependencies(chimera hs pcre) | ||
| -target_link_libraries(chimera hs pcre) | ||
| +target_link_libraries(chimera hs pcre hs_rt) | ||
| +target_compile_definitions(chimera PUBLIC -DUSE_INTRIN_H) | ||
|
|
||
| install(TARGETS chimera DESTINATION ${CMAKE_INSTALL_LIBDIR}) | ||
|
|
||
| +file(GLOB CHIMERA_HEADERS ${CMAKE_CURRENT_LIST_DIR}/*.h) | ||
| +install(FILES ${CHIMERA_HEADERS} DESTINATION include) | ||
| + | ||
| if (NOT WIN32) | ||
| # expand out library names for pkgconfig static link info | ||
| foreach (LIB ${CMAKE_CXX_IMPLICIT_LINK_LIBRARIES}) | ||
| @@ -44,6 +64,6 @@ if (NOT WIN32) | ||
| set(PRIVATE_LIBS "${PRIVATE_LIBS} -L${LIBDIR} -lpcre") | ||
|
|
||
| configure_file(libch.pc.in libch.pc @ONLY) # only replace @ quoted vars | ||
| - install(FILES ${CMAKE_BINARY_DIR}/chimera/libch.pc | ||
| + install(FILES ${CMAKE_BINARY_DIR}/libch.pc | ||
| DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") | ||
| endif() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
| index 59c6e6e..51e8498 100644 | ||
| --- a/CMakeLists.txt | ||
| +++ b/CMakeLists.txt | ||
| @@ -559,7 +559,7 @@ SET(hs_HEADERS | ||
| src/hs_compile.h | ||
| src/hs_runtime.h | ||
| ) | ||
| -install(FILES ${hs_HEADERS} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/hs") | ||
| +install(FILES ${hs_HEADERS} DESTINATION include/hs) | ||
|
|
||
| set (hs_exec_common_SRCS | ||
| src/alloc.c | ||
| diff --git a/chimera/CMakeLists.txt b/chimera/CMakeLists.txt | ||
| index 1503dbe..b1a22c5 100644 | ||
| --- a/chimera/CMakeLists.txt | ||
| +++ b/chimera/CMakeLists.txt | ||
| @@ -29,7 +29,7 @@ SET(chimera_HEADERS | ||
| ch_compile.h | ||
| ch_runtime.h | ||
| ) | ||
| -install(FILES ${chimera_HEADERS} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/hs") | ||
| +install(FILES ${chimera_HEADERS} DESTINATION include/hs) | ||
|
|
||
| SET(chimera_SRCS | ||
| ${chimera_HEADERS} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| diff --git a/src/util/intrinsics.h b/src/util/intrinsics.h | ||
| index edc4f6e..075b777 100644 | ||
| --- a/src/util/intrinsics.h | ||
| +++ b/src/util/intrinsics.h | ||
| @@ -55,6 +55,7 @@ | ||
| # endif | ||
| #endif | ||
|
|
||
| +#ifdef _WIN32 | ||
| #if defined(USE_X86INTRIN_H) | ||
| #include <x86intrin.h> | ||
| #elif defined(USE_INTRIN_H) | ||
| @@ -62,5 +63,12 @@ | ||
| #else | ||
| #error no intrinsics file | ||
| #endif | ||
| +#else | ||
| +#if defined(USE_X86INTRIN_H) || defined(USE_INTRIN_H) | ||
| +#include <emmintrin.h> | ||
| +#else | ||
| +#error no intrinsics file | ||
| +#endif | ||
| +#endif | ||
|
|
||
| #endif // INTRINSICS_H |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| vcpkg_check_linkage(ONLY_STATIC_LIBRARY) | ||
|
|
||
| # checkout hyperscan source code which is required by and also contains chimera | ||
| vcpkg_from_github( | ||
| OUT_SOURCE_PATH SOURCE_PATH | ||
| REPO intel/hyperscan | ||
| REF c00683d73916e39f01b0d418f686c8b5c379159c | ||
| SHA512 3c4d52706901acc9ef4c3d12b0e5b2956f4e6bce13f6828a4ba3b736c05ffacb1d733ef9c226988ca80220584525f9cb6dcfe4914ced6cc34ae6a0a45975afb5 | ||
| HEAD_REF master | ||
| PATCHES | ||
| fix-cmakelists.patch | ||
| fix-unix-build.patch | ||
| fix-include-path.patch | ||
| ) | ||
|
|
||
| vcpkg_find_acquire_program(PYTHON3) | ||
| get_filename_component(PYTHON3_DIR ${PYTHON3} DIRECTORY) | ||
| vcpkg_add_to_path(${PYTHON3_DIR}) | ||
|
|
||
ZMZ91 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| vcpkg_configure_cmake( | ||
| SOURCE_PATH ${SOURCE_PATH}/chimera | ||
| PREFER_NINJA | ||
| OPTIONS | ||
| -DPYTHON_EXECUTABLE=${PYTHON3} | ||
| ) | ||
|
|
||
| vcpkg_install_cmake() | ||
|
|
||
| # remove debug dir | ||
| file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") | ||
| file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") | ||
|
|
||
| # Handle copyright | ||
| file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
|
|
||
| The package @PORT@:@TARGET_TRIPLET@ provides CMake targets: | ||
|
|
||
| find_library(CHIMERA_LIBRARY NAMES chimera) | ||
| find_library(HS_LIBRARY NAMES hs) | ||
| find_path(CHIMERA_INCLUDE_DIR hs) | ||
| find_library(PCRE_LIBRARY NAMES pcre) | ||
|
|
||
| target_include_directories(main PUBLIC ${CHIMERA_INCLUDE_DIR}) | ||
| target_link_libraries(main ${CHIMERA_LIBRARY} ${HS_LIBRARY} ${PCRE_LIBRARY}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
| index 83197af..34c0b84 100644 | ||
| --- a/CMakeLists.txt | ||
| +++ b/CMakeLists.txt | ||
| @@ -232,7 +232,7 @@ else() | ||
| set(EXTRA_C_FLAGS "${OPT_C_FLAG} -std=c99 -Wall -Wextra -Wshadow -Wcast-qual -fno-strict-aliasing") | ||
| set(EXTRA_CXX_FLAGS "${OPT_CXX_FLAG} -std=c++11 -Wall -Wextra -Wshadow -Wswitch -Wreturn-type -Wcast-qual -Wno-deprecated -Wnon-virtual-dtor -fno-strict-aliasing") | ||
|
|
||
| - if (NOT RELEASE_BUILD) | ||
| + if (NOT RELEASE_BUILD AND OFF) | ||
| # -Werror is most useful during development, don't potentially break | ||
| # release builds | ||
| set(EXTRA_C_FLAGS "${EXTRA_C_FLAGS} -Werror") |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.