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

link with libchimera fail, need help #51

Open
VinusNeo opened this issue Feb 26, 2023 · 1 comment
Open

link with libchimera fail, need help #51

VinusNeo opened this issue Feb 26, 2023 · 1 comment

Comments

@VinusNeo
Copy link

Hello, flier

something wrong when i want to build with chimera, i would be very happy if you could help me.

here is my environment:

# Boost: 1.81.0
# Hyperscan: 5.4.1
# PCRE: 8.45

go get -u -tags hyperscan_v54 github.com/flier/gohs/hyperscan
ln -s /home/ubuntu/boost/boost_1_81_0/boost /home/ubuntu/hyperscan/hyperscan/include/boost
tar xf pcrev8.45.tar.gz -C /home/ubuntu/hyperscan/hyperscan/pcre --strip-components=1
./bin/unit-chimera
[----------] Global test environment tear-down
[==========] 262 tests from 6 test cases ran. (8298 ms total)
[  PASSED  ] 262 tests.

when i run comman go build, i got errors below:

PKG_CONFIG_PATH=/usr/local/lib/pkgconfig go build -tags chimera main.go
# command-line-arguments
/usr/lib/go/pkg/tool/linux_amd64/link: running g++ failed: exit status 1
/usr/bin/ld: /usr/local/lib/libchimera.a(ch_compile.cpp.o): in function `ch::ch_compile_multi_int(char const* const*, unsigned int const*, unsigned int const*, unsigned int, unsigned int, unsigned long, unsigned long, hs_platform_info const*, ch_database**)':
ch_compile.cpp:(.text+0x534): undefined reference to `ue2::mmbit_size(unsigned int)'
/usr/bin/ld: /usr/local/lib/libchimera.a(ch_compile.cpp.o): in function `ch::ch_compile_multi_int(char const* const*, unsigned int const*, unsigned int const*, unsigned int, unsigned int, unsigned long, unsigned long, hs_platform_info const*, ch_database**) [clone .cold]':
ch_compile.cpp:(.text.unlikely+0xd5): undefined reference to `ue2::CompileError::CompileError(unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: ch_compile.cpp:(.text.unlikely+0xdc): undefined reference to `ue2::CompileError::~CompileError()'
/usr/bin/ld: ch_compile.cpp:(.text.unlikely+0xe3): undefined reference to `typeinfo for ue2::CompileError'
/usr/bin/ld: ch_compile.cpp:(.text.unlikely+0x133): undefined reference to `ue2::CompileError::CompileError(unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: ch_compile.cpp:(.text.unlikely+0x13a): undefined reference to `ue2::CompileError::~CompileError()'
/usr/bin/ld: ch_compile.cpp:(.text.unlikely+0x141): undefined reference to `typeinfo for ue2::CompileError'
/usr/bin/ld: ch_compile.cpp:(.text.unlikely+0x19e): undefined reference to `ue2::CompileError::CompileError(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: ch_compile.cpp:(.text.unlikely+0x1b7): undefined reference to `ue2::CompileError::~CompileError()'
/usr/bin/ld: ch_compile.cpp:(.text.unlikely+0x1be): undefined reference to `typeinfo for ue2::CompileError'
/usr/bin/ld: ch_compile.cpp:(.text.unlikely+0x1f1): undefined reference to `ue2::CompileError::CompileError(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: ch_compile.cpp:(.text.unlikely+0x20a): undefined reference to `ue2::CompileError::~CompileError()'
/usr/bin/ld: ch_compile.cpp:(.text.unlikely+0x211): undefined reference to `typeinfo for ue2::CompileError'
/usr/bin/ld: ch_compile.cpp:(.text.unlikely+0x26f): undefined reference to `ue2::CompileError::CompileError(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: ch_compile.cpp:(.text.unlikely+0x288): undefined reference to `ue2::CompileError::~CompileError()'
/usr/bin/ld: ch_compile.cpp:(.text.unlikely+0x28f): undefined reference to `typeinfo for ue2::CompileError'
/usr/bin/ld: ch_compile.cpp:(.text.unlikely+0x2c2): undefined reference to `ue2::CompileError::CompileError(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: ch_compile.cpp:(.text.unlikely+0x2db): undefined reference to `ue2::CompileError::~CompileError()'
/usr/bin/ld: ch_compile.cpp:(.text.unlikely+0x2e2): undefined reference to `typeinfo for ue2::CompileError'
/usr/bin/ld: ch_compile.cpp:(.text.unlikely+0x354): undefined reference to `ue2::CompileError::CompileError(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: ch_compile.cpp:(.text.unlikely+0x36d): undefined reference to `ue2::CompileError::~CompileError()'
/usr/bin/ld: ch_compile.cpp:(.text.unlikely+0x374): undefined reference to `typeinfo for ue2::CompileError'
/usr/bin/ld: ch_compile.cpp:(.text.unlikely+0x3a7): undefined reference to `ue2::CompileError::CompileError(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: ch_compile.cpp:(.text.unlikely+0x3c0): undefined reference to `ue2::CompileError::~CompileError()'
/usr/bin/ld: ch_compile.cpp:(.text.unlikely+0x3c7): undefined reference to `typeinfo for ue2::CompileError'
/usr/bin/ld: ch_compile.cpp:(.text.unlikely+0x404): undefined reference to `ue2::CompileError::CompileError(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: ch_compile.cpp:(.text.unlikely+0x41d): undefined reference to `ue2::CompileError::~CompileError()'
/usr/bin/ld: ch_compile.cpp:(.text.unlikely+0x424): undefined reference to `typeinfo for ue2::CompileError'
/usr/bin/ld: ch_compile.cpp:(.text.unlikely+0x4ae): undefined reference to `ue2::CompileError::CompileError(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: ch_compile.cpp:(.text.unlikely+0x4c7): undefined reference to `ue2::CompileError::~CompileError()'
/usr/bin/ld: ch_compile.cpp:(.text.unlikely+0x4ce): undefined reference to `typeinfo for ue2::CompileError'
/usr/bin/ld: /usr/local/lib/libchimera.a(ch_compile.cpp.o):(.data.rel.local.DW.ref._ZTIN3ue212CompileErrorE[DW.ref._ZTIN3ue212CompileErrorE]+0x0): undefined reference to `typeinfo for ue2::CompileError'
/usr/bin/ld: /usr/local/lib/libchimera.a(ch_runtime.c.o): in function `multiCallback':
ch_runtime.c:(.text+0x6cc): undefined reference to `mmbit_maxlevel_direct_lut'
/usr/bin/ld: ch_runtime.c:(.text+0x6dc): undefined reference to `mmbit_root_offset_from_level'
/usr/bin/ld: ch_runtime.c:(.text+0x740): undefined reference to `mmbit_root_offset_from_level'
/usr/bin/ld: ch_runtime.c:(.text+0xa14): undefined reference to `mmbit_keyshift_lut'
/usr/bin/ld: ch_runtime.c:(.text+0xa25): undefined reference to `mmbit_root_offset_from_level'
/usr/bin/ld: ch_runtime.c:(.text+0xab2): undefined reference to `mmbit_root_offset_from_level'
/usr/bin/ld: ch_runtime.c:(.text+0xac4): undefined reference to `mmbit_maxlevel_direct_lut'
/usr/bin/ld: ch_runtime.c:(.text+0xb2a): undefined reference to `mmbit_root_offset_from_level'
/usr/bin/ld: ch_runtime.c:(.text+0xb62): undefined reference to `mmbit_root_offset_from_level'
/usr/bin/ld: ch_runtime.c:(.text+0xba3): undefined reference to `mmbit_root_offset_from_level'
/usr/bin/ld: ch_runtime.c:(.text+0xbdd): undefined reference to `mmbit_root_offset_from_level'
/usr/bin/ld: ch_runtime.c:(.text+0xc13): undefined reference to `mmbit_root_offset_from_level'
/usr/bin/ld: /usr/local/lib/libchimera.a(ch_runtime.c.o):ch_runtime.c:(.text+0xc44): more undefined references to `mmbit_root_offset_from_level' follow
/usr/bin/ld: /usr/local/lib/libchimera.a(ch_runtime.c.o): in function `multiCallback':
ch_runtime.c:(.text+0xc7c): undefined reference to `mmbit_keyshift_lut'
/usr/bin/ld: ch_runtime.c:(.text+0xc87): undefined reference to `mmbit_root_offset_from_level'
/usr/bin/ld: ch_runtime.c:(.text+0x1068): undefined reference to `mmbit_root_offset_from_level'
/usr/bin/ld: ch_runtime.c:(.text+0x10e6): undefined reference to `mmbit_root_offset_from_level'
/usr/bin/ld: ch_runtime.c:(.text+0x1138): undefined reference to `mmbit_root_offset_from_level'
/usr/bin/ld: ch_runtime.c:(.text+0x118a): undefined reference to `mmbit_root_offset_from_level'
/usr/bin/ld: /usr/local/lib/libchimera.a(ch_runtime.c.o):ch_runtime.c:(.text+0x11dc): more undefined references to `mmbit_root_offset_from_level' follow
/usr/bin/ld: /usr/local/lib/libchimera.a(ch_runtime.c.o): in function `ch_scan':
ch_runtime.c:(.text+0x1635): undefined reference to `mmbit_maxlevel_direct_lut'
/usr/bin/ld: ch_runtime.c:(.text+0x195b): undefined reference to `mmbit_root_offset_from_level'
/usr/bin/ld: ch_runtime.c:(.text+0x19ae): undefined reference to `mmbit_root_offset_from_level'
/usr/bin/ld: ch_runtime.c:(.text+0x1a02): undefined reference to `mmbit_root_offset_from_level'
/usr/bin/ld: ch_runtime.c:(.text+0x1a56): undefined reference to `mmbit_root_offset_from_level'
/usr/bin/ld: ch_runtime.c:(.text+0x1aaa): undefined reference to `mmbit_root_offset_from_level'
/usr/bin/ld: /usr/local/lib/libchimera.a(ch_runtime.c.o):ch_runtime.c:(.text+0x1af2): more undefined references to `mmbit_root_offset_from_level' follow
collect2: error: ld returned 1 exit status

i also tried below, they are also failed, seems like it't not about build flags?

PKG_CONFIG_PATH=/usr/local/lib/pkgconfig go build -tags chimera,hyperscan_v54  main.go
@VinusNeo
Copy link
Author

Hi,

I want to share you with my latest experiment.

I made another attempt reference to your Docker file: https://github.com/flier/gohs/blob/master/Dockerfile

go run -tags=chimera  main.go 
match [ 6 : 15 ] foobarbar

I can use Chimera when my version is exactly the same as the BOOST, PCRE, and Hyperscan versions in the Dockerfile, so guessing it's a PCRE and Hyperscan version mismatch?

So it seems that the problem may still lie in version matching, how is the version of each component selected in the Dockerfile and is there somewhere I can know this correspondence?

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

1 participant