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

Compile finds PCRE but also doesn't find it ? #86

Closed
R3belWithoutAPause opened this issue Mar 17, 2018 · 10 comments
Closed

Compile finds PCRE but also doesn't find it ? #86

R3belWithoutAPause opened this issue Mar 17, 2018 · 10 comments

Comments

@R3belWithoutAPause
Copy link

Hi,

I'm currently trying to compile Hyperscan 4.70 on Slackware64-14.2 and i'm noticing this strange contradiction:

-- Checking for module 'libpcre=8.41'
-- Found libpcre, version 8.41
-- PCRE version 8.41
-- PCRE 8.41 not found, not building hscollider
-- Configuring done
-- Generating done

This seems contradictory to me and is preventing me from building the hs-collider module.

GCC Version 5.5.0
G++ Version 5.5.0

Please let me know if you need any other information .

@R3belWithoutAPause R3belWithoutAPause changed the title Compile find PCRE but also doesn't find it ? Compile finds PCRE but also doesn't find it ? Mar 17, 2018
@xiangwang1
Copy link
Contributor

xiangwang1 commented Mar 19, 2018

Thanks for the report!

Looks like there is an issue with hscollider CMake file:

if (NOT CORRECT_PCRE_VERSION)

Will changing CORRECT_PCRE_VERSION to PCRE_CHECKED fix your issue?

@R3belWithoutAPause
Copy link
Author

Hi @xiangwang1

I tried your suggested fix but it didn't fix the issue. It still shows the previous output:

Found PkgConfig: /usr/bin/pkg-config (found version "0.29.2")
-- Checking for module 'libpcre=8.41'
-- Found libpcre, version 8.41
-- PCRE version 8.41
-- PCRE 8.41 not found, not building hscollider
-- Configuring done
-- Generating done

I may have found a workaround and that is to copy the PCRE-8.41 source folder to the root of the hyperscan folder so that the folder hierarchy looks like this:

folder_list

This resulted in:

-- Looking for malloc_info
-- Looking for malloc_info - found
-- Looking for shmget
-- Looking for shmget - found
-- Performing Test CORRECT_PCRE_VERSION
-- Performing Test CORRECT_PCRE_VERSION - Success
-- PCRE version 8.41 - building from source.
-- Found BZip2: /usr/lib64/libbz2.so (found version "1.0.6")

And i was then able to build hscollider. I must point out that i also reverted your suggested fix.

@xiangwang1
Copy link
Contributor

xiangwang1 commented Mar 20, 2018

Yes, it works by placing PCRE under Hyperscan top directory.

Could you try adding set (CORRECT_PCRE_VERSION TRUE) after below line without moving PCRE files?

if (PCRE_FOUND)

@R3belWithoutAPause
Copy link
Author

Hi,

Using your previous 2 edits and without the pcre source, it still fails to build hscollder:

-- Checking for module 'libpcre=8.41'
-- Found libpcre, version 8.41
-- PCRE version 8.41
-- PCRE 8.41 not found, not building hscollider
-- Configuring done
-- Generating done

@xiangwang1
Copy link
Contributor

xiangwang1 commented Mar 21, 2018

Sorry, please ignore my first comment and just change according to my second comment about adding set (CORRECT_PCRE_VERSION TRUE).

@R3belWithoutAPause
Copy link
Author

Progress !!

-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.2")
-- Checking for module 'libpcre=8.41'
-- Found libpcre, version 8.41
-- PCRE version 8.41
-- Performing Test BACKTRACE_LIBC

However, a new error appears now:

CMake Warning (dev) at tools/hscollider/CMakeLists.txt:69 (add_dependencies):
Policy CMP0046 is not set: Error on non-existent dependency in
add_dependencies. Run "cmake --help-policy CMP0046" for policy details.
Use the cmake_policy command to set the policy and suppress this warning.

Running cmake --help-policy CMP0046 shows the following:

Error on non-existent dependency in add_dependencies.

CMake 2.8.12 and lower silently ignored non-existent dependencies
listed in the add_dependencies() command.

The OLD behavior for this policy is to silently ignore non-existent
dependencies. The NEW behavior for this policy is to report an error
if non-existent dependencies are listed in the add_dependencies()
command.

This policy was introduced in CMake version 3.0.
CMake version 3.10.3 warns when the policy is not set and uses
OLD behavior. Use the cmake_policy command to set it to OLD or
NEW explicitly.

I guess this error is because im currently using cmake 3.10.3

@xiangwang1
Copy link
Contributor

Yes, this is a warning for newer version of CMake but it wouldn't affect the compile results. You can suppress it by deleting this redundant line at:

add_dependencies(hscollider pcre)

We'll have a commit to fix these issues in our next release.

@R3belWithoutAPause
Copy link
Author

R3belWithoutAPause commented Mar 22, 2018

Hi,

Indeed it does compile fine now. Just wanted to say thank you for helping me fix this problem :)

I will close this issue now

@jobish
Copy link

jobish commented May 10, 2018

Hi,
I have the same issue on Centos7 and
set the flag on cMakeLists.txt (set (CORRECT_PCRE_VERSION TRUE) ) but following error occurred on Making time

[ 96%] Building CXX object tools/hscollider/CMakeFiles/hscollider.dir/GroundTruth.cpp.o
/usr/local/include/hyperscan/tools/hscollider/GroundTruth.cpp: In member function ‘std::unique_ptr GroundTruth::compile(unsigned int, bool)’:
/usr/local/include/hyperscan/tools/hscollider/GroundTruth.cpp:282:14: error: ‘PCRE_NO_AUTO_POSSESS’ was not declared in this scope
flags |= PCRE_NO_AUTO_POSSESS;
^
gmake[2]: *** [tools/hscollider/CMakeFiles/hscollider.dir/GroundTruth.cpp.o] Error 1
gmake[1]: *** [tools/hscollider/CMakeFiles/hscollider.dir/all] Error 2
gmake: *** [all] Error 2

@xiangwang1
Copy link
Contributor

Hi,

What PCRE version and package have you installed? Could you show your full cmake output?

fatchanghao pushed a commit that referenced this issue Jun 27, 2018
gbeauchesne pushed a commit to gbeauchesne/hyperscan that referenced this issue Jul 11, 2018
BigRedEye pushed a commit to BigRedEye/hyperscan that referenced this issue Feb 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants