Re: [Hyperscan] Compile fails at unit-hyperscan stage
by Matt Grimm
You're right on both counts -- I was able to compile successfully with
-DFAT_RUNTIME=off, and my symbols look like so:
$ nm CMakeFiles/hs_exec_avx2.dir/src/crc32.c.o
0000000000000000 T Crc32c_ComputeBuf
I'm not so concerned with figuring out why the fat runtime isn't building
at this point. I'm happy to pass along other system details if it helps you
debug the issue, though.
$ dpkg -s gcc | grep Version
Version: 4:5.2.1-3ubuntu1
$ dpkg -s binutils | grep Version
Version: 2.25.1-6ubuntu2
$ dpkg -s libc6 | grep Version
Version: 2.21-0ubuntu4.3
Thanks!
Date: Thu, 23 Feb 2017 21:57:06 +0000
> From: "Barr, Matthew" <matthew.barr(a)intel.com>
> To: Hyperscan regular expression matching library
> <hyperscan(a)lists.01.org>
> Subject: Re: [Hyperscan] Compile fails at unit-hyperscan stage
> Message-ID:
> <
> 6C94C507904F7B4882664A27EE2855AD1A9E7C79(a)PGSMSX109.gar.corp.intel.com>
>
> Content-Type: text/plain; charset="utf-8"
>
> From: Hyperscan [mailto:hyperscan-bounces@lists.01.org] On Behalf Of Matt
> Grimm
> Sent: Friday, February 24, 2017 2:56 AM
>
> > Any idea what's causing this?
> > ../lib/libhs.a(dispatcher.c.o): In function `resolve_hs_scan':
> > /home/mgrimm/hyperscan-git/src/dispatcher.c:66: undefined reference to
> `avx2_hs_scan'
>
> One of the things we added to Hyperscan v4.4 was what we call the fat
> runtime. Essentially this is three copies of the runtime code for
> Hyperscan, each built for a different target microarchitecture. When an
> application that is linked to the Hyperscan library is executed we check
> the host machine (in dispatcher.c), and based on what microarch is present,
> we set up the best of those runtime copies.
>
> So that explains the three variants of hs_scan, etc, that the linker can't
> find.
>
> My best guess is that something has gone wrong when we are building the
> three copies of the runtime code. Right now the symbol mangling is done
> with a helper script (cmake/build_wrapper.sh) that goes looking for symbols
> in each .o that is built and rewrites them using objcopy. I'm responsible
> for creating that script and I know it could be better.
>
> After explaining all of that, you can disable the fat runtime build by
> running 'cmake -DFAT_RUNTIME=off .' in your build dir, and then recompiling.
>
> Figuring out why the fat runtime isn't building might take longer - but we
> do a lot of testing on Ubuntu 14.04, so that combination of gcc, binutils
> and glibc should be absolutely fine.
>
> For the first step, if you look at the symbols in the first file built,
> using "nm CMakeFiles/hs_exec_avx2.dir/src/crc32.c.o" you should see the
> single entry for "avx2_Crc32c_ComputeBuf" - my guess is that it doesn't
> have the "avx2_" prefix, correct?
>
> Regards,
> Matt.
>
>
4 years
Compile fails at unit-hyperscan stage
by Matt Grimm
I'm trying to compile Hyperscan 4.4.0 on Ubuntu 14.04 and am getting a
bunch of undefined reference errors during the "Linking CXX executable
../bin/unit-hyperscan" stage. I was previously able to compile and run
Hyperscan 4.3.2.
Any idea what's causing this?
Thanks,
m.
$ gcc --version
gcc (Ubuntu 4.8.5-2ubuntu1~14.04.1) 4.8.5
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ cmake -D BOOST_ROOT=<boost_path> ..
...
$ cmake --build .
[ 13%] Built target hs_exec_avx2
[ 25%] Built target hs_exec_core2
[ 38%] Built target hs_exec_corei7
[ 40%] Built target hs_exec_common
[ 41%] Built target ragel_Parser
[ 86%] Built target hs
[ 86%] Built target hs_runtime
[ 86%] Built target ragel_ExpressionParser
[ 87%] Built target expressionutil
[ 87%] Built target databaseutil
[ 88%] Built target corpusomatic
[ 89%] Built target crosscompileutil
[ 90%] Built target gtest
[ 91%] Linking CXX executable ../bin/unit-hyperscan
../lib/libhs.a(dispatcher.c.o): In function `resolve_hs_scan':
/home/mgrimm/hyperscan-git/src/dispatcher.c:66: undefined reference to
`avx2_hs_scan'
/home/mgrimm/hyperscan-git/src/dispatcher.c:66: undefined reference to
`corei7_hs_scan'
/home/mgrimm/hyperscan-git/src/dispatcher.c:66: undefined reference to
`core2_hs_scan'
../lib/libhs.a(dispatcher.c.o): In function `resolve_hs_stream_size':
/home/mgrimm/hyperscan-git/src/dispatcher.c:70: undefined reference to
`avx2_hs_stream_size'
/home/mgrimm/hyperscan-git/src/dispatcher.c:70: undefined reference to
`corei7_hs_stream_size'
/home/mgrimm/hyperscan-git/src/dispatcher.c:70: undefined reference to
`core2_hs_stream_size'
... and many more ...
4 years