gvansickle / ucg

UniversalCodeGrep (ucg) is an extremely fast grep-like tool specialized for searching large bodies of source code.

Home Page:https://gvansickle.github.io/ucg/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ucg works in x86 systems...

refi64 opened this issue · comments

The readme says:

Note that at this time, only x86-64/amd64 architectures are supported.

...but all I had to do was comment out the lines in src/libextx/integer.hpp that use __int128 (which doesn't exist on x86), and it works perfectly...?

Hey @kirbyfan64 ,

That's great to know, and IIRC the __int128 code is where that statement originated. Since I wrote that, I reworked the code which used it (the file "UUID" code for detecting symlink cycles), so that's likely why it now works again under x86-32. I'll remove the __int128 stuff in the repo.

I'm a bit wary of removing that line from the README.md though. Currently I'm doing the majority of the development on Fedora 25, and I don't have a test/CI setup to regularly check if it even compiles for 32-bit. ATM I have Travis CI, but that's only Linux/x86-64 and 64-bit OS X, and I end up doing *BSD tests (again all 64-bit) manually. I occasionally send a tarball to the OpenSUSE Build System, but for whatever reason (e.g. requires valid packaging for one thing) I find that pretty cumbersome. If you or anyone else have any ideas on how I can easily expand the number of platforms I test against, please let me know.

Couldn't you just pass -m32 to the cflags? That's what I do for testing ReJit.

Couldn't you just pass -m32 to the cflags? That's what I do for testing ReJit.

Hmm, apparently I can't:

$ ../configure CXXFLAGS=-m32
[...]
## ------------------------------ ##
## Checking for library functions ##
## ------------------------------ ##
checking for working strnlen... no
checking whether C++ library supports std::to_string... no
checking whether C++ library supports std::make_unique... no
checking for sched_setaffinity... no
checking for get_current_dir_name... no
checking for openat... no
checking for fstatat... no
checking for aligned_alloc... no
checking for posix_memalign... no
configure: error: cannot find an aligned memory allocator.

I'm probably missing chunks of the 32-bit dev environment.

...yep, installing all the proper devel packages seems to be the trick. ;-) I'll see if Travis supports -m32.

It doesn't, but I was able to build 32-bit both locally and via OBS, with "make check" passing on both. There is a speed hit going to 32-bit, but in most cases not as much as I was suspecting (one benchmark takes way longer though for some reason). Also, make dist was broken, so I fixed that, and updated the README.md to indicate that I'm at least occasionally checking 32-bit functionality.

So for the moment anyway, 32-bit ucg is back in action! Thanks for the report @kirbyfan64.