Comments (5)
cc @betterlch
from python-hyperscan.
cc @betterlch
I just know that 0.2.0 works in python3.7~
Here are other work about python3.10:
I linked libhs.so as _hyperscn.so, and I get this
ImportError: dynamic module does not define module export function (PyInit__hyperscan)
And then I use
strace python3 -c 'import hyperscan'
It has no more help.
I don't how C extending works in python3, so I have no ideas.
from python-hyperscan.
just added a new environment variable to enable dynamic linking when building, PYTHON_HYPERSCAN_STATIC
(defaults to true). try pulling latest and building with:
PYTHON_HYPERSCAN_STATIC=false poetry install
from python-hyperscan.
just added a new environment variable to enable dynamic linking when building,
PYTHON_HYPERSCAN_STATIC
(defaults to true). try pulling latest and building with:
PYTHON_HYPERSCAN_STATIC=false poetry install
Something maybe not as you wish:
running build_ext
building 'hyperscan._hyperscan' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -I/usr/include/openssl11 -I/usr/include/openssl11 -fPIC -I/usr/include/hs -I/usr/include/hs -I/tmp/tmpf0_08_r3/.venv/include -I/usr/local/include/python3.10 -c src/hyperscan/hyperscanmodule.c -o /root/py/python-hyperscan/build/temp.linux-x86_64-cpython-310/src/hyperscan/hyperscanmodule.o
src/hyperscan/hyperscanmodule.c: In function ‘ch_match_handler’:
src/hyperscan/hyperscanmodule.c:124:3: error: ‘for’ loop initial declarations are only allowed in C99 mode
for (unsigned int i = 0; i < size; i++) {
^
src/hyperscan/hyperscanmodule.c:124:3: note: use option -std=c99 or -std=gnu99 to compile your code
src/hyperscan/hyperscanmodule.c: In function ‘Database_compile’:
src/hyperscan/hyperscanmodule.c:270:3: error: ‘for’ loop initial declarations are only allowed in C99 mode
for (uint64_t i = 0; i < elements; i++) {
^
src/hyperscan/hyperscanmodule.c:331:5: error: ‘for’ loop initial declarations are only allowed in C99 mode
for (uint64_t i = 0; i < elements; i++) {
^
src/hyperscan/hyperscanmodule.c:384:9: error: ‘for’ loop initial declarations are only allowed in C99 mode
for (uint64_t i = 0; i < elements; i++) {
^
src/hyperscan/hyperscanmodule.c: In function ‘Database_scan’:
src/hyperscan/hyperscanmodule.c:547:5: error: ‘for’ loop initial declarations are only allowed in C99 mode
for (uint32_t i = 0; i < num_buffers; i++) {
^
error: command '/usr/bin/gcc' failed with exit code 1
Resolved by change code to std format c11
And new error is here:
Preparing build environment with build-system requirements setuptools, poetry>=0.12Building hyperscan (0.4.0)
A setup.py file already exists. Using it.
running build
running build_py
copying src/hyperscan/hyperscanmodule.c -> /root/py/python-hyperscan/build/lib.linux-x86_64-cpython-310/hyperscan
running build_ext
building 'hyperscan._hyperscan' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -I/usr/include/openssl11 -I/usr/include/openssl11 -fPIC -I/usr/include/hs -I/usr/include/hs -I/tmp/tmp5r6qyfy_/.venv/include -I/usr/local/include/python3.10 -c src/hyperscan/hyperscanmodule.c -o /root/py/python-hyperscan/build/temp.linux-x86_64-cpython-310/src/hyperscan/hyperscanmodule.o
gcc -pthread -shared -L/usr/lib64/openssl11 -lssl -lcrypto -L/usr/lib64/openssl11 -lssl -lcrypto /root/py/python-hyperscan/build/temp.linux-x86_64-cpython-310/src/hyperscan/hyperscanmodule.o /opt/pcre/.libs/libpcre.a /opt/pcre/.libs/libpcre_la-pcre_byte_order.o /opt/pcre/.libs/libpcre_la-pcre_compile.o /opt/pcre/.libs/libpcre_la-pcre_config.o /opt/pcre/.libs/libpcre_la-pcre_dfa_exec.o /opt/pcre/.libs/libpcre_la-pcre_exec.o /opt/pcre/.libs/libpcre_la-pcre_fullinfo.o /opt/pcre/.libs/libpcre_la-pcre_get.o /opt/pcre/.libs/libpcre_la-pcre_globals.o /opt/pcre/.libs/libpcre_la-pcre_jit_compile.o /opt/pcre/.libs/libpcre_la-pcre_maketables.o /opt/pcre/.libs/libpcre_la-pcre_newline.o /opt/pcre/.libs/libpcre_la-pcre_ord2utf8.o /opt/pcre/.libs/libpcre_la-pcre_refcount.o /opt/pcre/.libs/libpcre_la-pcre_string_utils.o /opt/pcre/.libs/libpcre_la-pcre_study.o /opt/pcre/.libs/libpcre_la-pcre_tables.o /opt/pcre/.libs/libpcre_la-pcre_ucd.o /opt/pcre/.libs/libpcre_la-pcre_valid_utf8.o /opt/pcre/.libs/libpcre_la-pcre_version.o /opt/pcre/.libs/libpcre_la-pcre_xclass.o /opt/pcre/.libs/libpcre_la-pcre_chartables.o /opt/pcre/.libs/libpcreposix_la-pcreposix.o /opt/pcre/.libs/libpcrecpp_la-pcrecpp.o /opt/pcre/.libs/libpcrecpp_la-pcre_scanner.o /opt/pcre/.libs/libpcrecpp_la-pcre_stringpiece.o -lchimera -lhs -o /root/py/python-hyperscan/build/lib.linux-x86_64-cpython-310/hyperscan/_hyperscan.cpython-310-x86_64-linux-gnu.so
/usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/libchimera.a(ch_compile.cpp.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/libchimera.a(ch_runtime.c.o): relocation R_X86_64_32S against undefined symbol `mmbit_maxlevel_direct_lut' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/libchimera.a(ch_alloc.c.o): relocation R_X86_64_32 against symbol `malloc@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
error: command '/usr/bin/gcc' failed with exit code 1
from python-hyperscan.
- download and make install hypercan 5.4.0 with doc guide
- use
cmake -DCMAKE_POSITION_INDEPENDENT_CODE=ON ..
remakehyperscan/build/chimera
-->hyperscan/build/lib/libchimera.a
- add
/opt/pcre/
and build pcre-8.4.5 to gen/opt/pcre/.libs
for build python-hyperscan - poetry build -vvv (maybe need update cmake an add c11 support in python-hyperscan sourcecode)
Done!
from python-hyperscan.
Related Issues (20)
- symbol not found in flat namespace '_ch_alloc_scratch' HOT 10
- Add args for early termination of scanning if only need to find one match regex or just judging matched
- Import time slowness due to pkg_resources HOT 1
- How to match an exact string with hyperscan like with re.findall
- Handling scan termination from match callback could be cleaner HOT 2
- switch to vectorscan HOT 2
- Request for maintainer(s) HOT 5
- multiprocessing problem.
- Memory leak in Database object when compiling, dumping and loading. HOT 15
- Strange "hyperscan.InvalidError: error code -1" HOT 6
- Named capture groups with Chimera
- install by Dockerfile
- ModuleNotFoundError: No module named 'hyperscan._hyperscan'
- when it will be ready for windows ? HOT 1
- Please do a release HOT 1
- Problem with musl and fat runtime? HOT 5
- pypi don't have py3.9 whl release and tar.gz with source code HOT 2
- Python 3.10 using error
- Can't import from hyperscan in python 3.12 HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-hyperscan.