-
Notifications
You must be signed in to change notification settings - Fork 13
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
ftlRegex ERROR: No match #4
Comments
I could not reproduce this on Linux with either ifort 19.0.3.199 20190206 or the newer 19.1.0.166 20191121. Which platform are you on? Are both debug and release builds affected by this? ftlRegex can under the hood use both the POSIX regex.h and the PCRE library. By default the makefile assumes you have PCRE installed, but you can disable it and go for POSIX instead, see USE_PCRE in the makefile. Does this make a difference for your issue? |
I've added your example to the unit tests, see: c8eba0b Can you try running the full set of unit tests, just to see if ftlRegex is the only component that causes problems for you. For me all regression tests work (on Linux) with various versions of GCC >=6.4 and ifort >= 17. |
So, I tried to execute the unit tests and all of them passed, even the one you just added. I looked at the way the tests are compiled and it turned out I did not use -lpcreposix flag in my program (only -lftl and -lpcre, but -lpcre does not even seem to have any effect). After I added -lpcreposix everything started working. |
And, replying to the first comment, my platform is SUSE Linux Enterprise Server 15, both debug and release were affected by this and setting USE_PCRE to false did not solve it. |
Ah, I see. I use the POSIX compatible API from PCRE instead of their native API. I think in the configure_ftlRegex.c file, it picked up the values of the enums for the PCRE POSIX API from pcreposix.h, but then you linked against the standard POSIX regular expressions from regex.h, which have other numeric values for all these enums ... I think everything should also work for you if you "make cleanall" and then make with USE_PCRE=false (aka not linking to PCRE). Either way, the enum numerical values just need to be consistent between the configure and linking step ... |
I added some documentation on how to build ftlRegex to the Wiki. So far there was only a giant TODO there ;-) ... |
The second option in the building instructions (Compile without "-DUSE_PCRE" and link with nothing) does not seem to work for me. It produces the same error at runtime. Only the first one works. Also, in the first option, -lpcre seems to have no effect, just -lpcreposix is sufficient, at least on my system. |
It's the PCRE documentation (https://www.pcre.org/original/doc/html/pcreposix.html) that suggests you need both:
I think the unit tests should also work without PCRE (they do for me), but you need to make sure the
If this does not pass, then something is still wrong. |
passes. The error shows up if you try to link the library (libftl.so) instead of object files (via -lftl). In this case using USE_PCRE=false together with no other libraries at the linking stage (no -lprce and -lpcreposix) generates the error at runtime. Additionally, you can reproduce this error in unit tests if you try to:
i.e. without cleaning |
I talked a bit with a colleague about how linkers work, I think I understand what is going on now.
The reason is this: When compiling your program the C standard library is implicitly included as the last shared library. It will be used after all libraries you linked against explicitly, but before their dependencies. A libftl built with PCRE will depend on libpcreposix (you should be able to check that with ldd, issue #7 seems to be unrelated). If you specify just This explains the behavior you observe, right? |
The case I described here does not involve PCRE. I tried to compile the library with |
I had the same error and compiling with -lpcreposix solved the issue. |
Hello,
I tried to execute example code from the wiki page:
However, when the program tries to execute r%Match(line), it just starts printing the same error until I stop it:
The library was compiled using the provided makefile with platform set to intel (ifort 19.0.3.199 20190206). Any ideas what can be wrong?
The text was updated successfully, but these errors were encountered: