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

Encountering compiling failure #430

Closed
pingsoli opened this issue Dec 14, 2017 · 8 comments
Closed

Encountering compiling failure #430

pingsoli opened this issue Dec 14, 2017 · 8 comments
Labels

Comments

@pingsoli
Copy link

I have already installed libpcap 1.8.1, and ./configure --enable-dynamic-link, then I failed to configure. I got error: checking for libpcap version... configure: error: Libpcap versions < 0.7.2 are not supported Please upgrade to version 0.7.2 or better, then I got your another answer is trying with --with-libpcap=, so, I try it. Then I got some error messages when compiling.

$ ./configure --with-libpcap=/home/pingsoli/Downloads/libpcap-1.8.1
blablabla....
##########################################################################
             TCPREPLAY Suite Configuration Results (4.2.6)
##########################################################################
libpcap:                    /home/pingsoli/Downloads/libpcap-1.8.1 (>= 0.9.6)
PF_RING libpcap             no   
libdnet:                    no   
autogen:                    /usr/bin/autogen (5.18.7)
Use libopts tearoff:        yes
64bit counter support:      yes
tcpdump binary path:        /usr/sbin/tcpdump
fragroute support:          no
tcpbridge support:          yes
tcpliveplay support:        yes

Supported Packet Injection Methods (*):
Linux TX_RING:              no
Linux PF_PACKET:            yes
BSD BPF:                    no
libdnet:                    no
pcap_inject:                yes
pcap_sendpacket:            yes **
pcap_netmap                 no
Linux/BSD netmap:           no
Tuntap device support:      yes

* In order of preference; see configure --help to override
** Required for tcpbridge

$ make 
blabla....
In file included from tcpreplay_opts.c:43:0:
tcpreplay_opts.h:61:3: error: #error option template version mismatches autoopts/options.h header
 # error option template version mismatches autoopts/options.h header
   ^
compilation terminated due to -Wfatal-errors.
Makefile:905: recipe for target 'tcpreplay-tcpreplay_opts.o' failed
make[3]: *** [tcpreplay-tcpreplay_opts.o] Error 1
make[3]: Leaving directory '/home/pingsoli/Downloads/tcpreplay-4.2.6/src'
Makefile:1156: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/home/pingsoli/Downloads/tcpreplay-4.2.6/src'
Makefile:569: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/home/pingsoli/Downloads/tcpreplay-4.2.6/src'
Makefile:445: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1

What's the problem? I'll appreciate your reply.

@fklassen
Copy link
Member

Are you building from release? If you are building from GitHub you get this error unless your autogen setup is perfect.

@pingsoli
Copy link
Author

Thanks for your answer, I tried release version, and got the same error. My OS is ubuntu 16.04, and
$ sudo apt-get install autogen
your meaning is autogen was imcompletely installed ?

@fklassen
Copy link
Member

Thanks for the report. Labeling as a bug and will try to reproduce.

@fklassen fklassen added the bug label Jan 7, 2018
fklassen added a commit that referenced this issue Jan 7, 2018
Bug #430 - properly parse libpcap version numbers
@fklassen
Copy link
Member

fklassen commented Jan 7, 2018

Resolved in PR #431

@fklassen fklassen closed this as completed Jan 7, 2018
fklassen added a commit that referenced this issue Jan 19, 2018
* 4.3:
  #409 check packet length in packet2tree functions (#440)
  #408 check packet length in get_l2len
  #410 check packet length in get_l2protocol
  #432 restore config.h.in
  #407 #408 #409 #410 create branch for downstream PR
  Bug #432 Attempt to use local libopts to fix Travis CI (#433)
  fix heap-buffer-overflow in flow_decode()
  Bug #430 - properly parse libpcap version numbers
  fix some small gcc 7 warnings (#403)
  fix -Wmemset-elt-size warning found by gcc-7
  fix -Wbool-operation warnings found by gcc-7

Conflicts:
	configure.ac
	docs/CHANGELOG
@abdulrahman86
Copy link

abdulrahman86 commented Apr 18, 2018

@fklassen I am still seeing this error when building against master, 4.3 and PR_#397_multi_pcap_sleep_calc branches

make
Making all in scripts
make[1]: Entering directory '/home/asattar/dev/tcpreplay/scripts'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/asattar/dev/tcpreplay/scripts'
Making all in lib
make[1]: Entering directory '/home/asattar/dev/tcpreplay/lib'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/asattar/dev/tcpreplay/lib'
Making all in libopts
make[1]: Entering directory '/home/asattar/dev/tcpreplay/libopts'
make  all-am
make[2]: Entering directory '/home/asattar/dev/tcpreplay/libopts'
make[2]: Nothing to be done for 'all-am'.
make[2]: Leaving directory '/home/asattar/dev/tcpreplay/libopts'
make[1]: Leaving directory '/home/asattar/dev/tcpreplay/libopts'
Making all in src
make[1]: Entering directory '/home/asattar/dev/tcpreplay/src'
make  all-recursive
make[2]: Entering directory '/home/asattar/dev/tcpreplay/src'
Making all in common
make[3]: Entering directory '/home/asattar/dev/tcpreplay/src/common'
make  all-am
make[4]: Entering directory '/home/asattar/dev/tcpreplay/src/common'
  CC       cidr.o
  CC       err.o
  CC       list.o
  CC       cache.o
  CC       services.o
  CC       get.o
  CC       fakepcap.o
  CC       fakepcapnav.o
  CC       fakepoll.o
  CC       xX.o
  CC       utils.o
  CC       timer.o
  CC       sendpacket.o
  CC       mac.o
  CC       interface.o
  CC       flows.o
  CC       tcpdump.o
  AR       libcommon.a
ar: `u' modifier ignored since `D' is the default (see `U')
make[4]: Leaving directory '/home/asattar/dev/tcpreplay/src/common'
make[3]: Leaving directory '/home/asattar/dev/tcpreplay/src/common'
Making all in tcpedit
make[3]: Entering directory '/home/asattar/dev/tcpreplay/src/tcpedit'
make  all-am
make[4]: Entering directory '/home/asattar/dev/tcpreplay/src/tcpedit'
  CC       tcpedit.o
  CC       parse_args.o
  CC       edit_packet.o
  CC       portmap.o
  CC       dlt.o
  CC       checksum.o
  CC       incremental_checksum.o
  CC       tcpedit_api.o
  CC       fuzzing.o
  CC       dlt_plugins.o
  CC       ethernet.o
  CC       dlt_utils.o
  CC       en10mb.o
  CC       en10mb_api.o
  CC       hdlc.o
  CC       hdlc_api.o
  CC       user.o
  CC       user_api.o
  CC       raw.o
  CC       null.o
  CC       loop.o
  CC       linuxsll.o
  CC       ieee80211.o
  CC       ieee80211_hdr.o
  CC       radiotap.o
  CC       jnpr_ether.o
  CC       pppserial.o
  AR       libtcpedit.a
ar: `u' modifier ignored since `D' is the default (see `U')
make[4]: Leaving directory '/home/asattar/dev/tcpreplay/src/tcpedit'
make[3]: Leaving directory '/home/asattar/dev/tcpreplay/src/tcpedit'
make[3]: Entering directory '/home/asattar/dev/tcpreplay/src'
  CC       tcpreplay-tcpreplay_opts.o
In file included from tcpreplay_opts.c:43:0:
tcpreplay_opts.h:61:3: error: #error option template version mismatches autoopts/options.h header
 # error option template version mismatches autoopts/options.h header
   ^
compilation terminated due to -Wfatal-errors.
Makefile:908: recipe for target 'tcpreplay-tcpreplay_opts.o' failed
make[3]: *** [tcpreplay-tcpreplay_opts.o] Error 1
make[3]: Leaving directory '/home/asattar/dev/tcpreplay/src'
Makefile:1159: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/home/asattar/dev/tcpreplay/src'
Makefile:572: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/home/asattar/dev/tcpreplay/src'
Makefile:448: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1

@fklassen
Copy link
Member

Pro tip. Don't post on a closed issue.

Download release, not from Git https:/appneta/tcpreplay/releases/latest

@fklassen fklassen reopened this Oct 26, 2018
@fklassen
Copy link
Member

Reopening. Found a PowerPC Jessie system that fails as per above with a release version.

fklassen added a commit that referenced this issue Oct 26, 2018
Original bug was attempting to build on machine with
libopts 5.18.7 while the tarball contained version
5.18.4.  This caused a conflict that is internal
to libopts.

Originally I was building release tarballs on Debian 8
Jessie, which has libopts 5.18.4. Now I plan to build
on Debian 9 Stretch which uses libopts 5.18.12.

This commit upgrades libopts to 5.18.12, but also
includes some updates (some found in GnuTLS package):

* add AC_LANG_SOURCE to libopts.m4 to make autogen.sh less noisy
* fix build failure due to verify.h include in intprops.h
* add support for libdumbnet in place of libdnet on Ubuntu/Debian
* test for SIZEOF_LONG instead of SIZEOF_CHARP to fix 32-bit PPC builds
fklassen added a commit that referenced this issue Oct 26, 2018
fklassen added a commit that referenced this issue Oct 26, 2018
fklassen added a commit that referenced this issue Oct 26, 2018
* Bug #430 Upgrade libopts to 5.18.12

Original bug was attempting to build on machine with
libopts 5.18.7 while the tarball contained version
5.18.4.  This caused a conflict that is internal
to libopts.

Originally I was building release tarballs on Debian 8
Jessie, which has libopts 5.18.4. Now I plan to build
on Debian 9 Stretch which uses libopts 5.18.12.

This commit upgrades libopts to 5.18.12, but also
includes some updates (some found in GnuTLS package):

* add AC_LANG_SOURCE to libopts.m4 to make autogen.sh less noisy
* fix build failure due to verify.h include in intprops.h
* add support for libdumbnet in place of libdnet on Ubuntu/Debian
* test for SIZEOF_LONG instead of SIZEOF_CHARP to fix 32-bit PPC builds

* Bug #430 update CHANGELOG

* Bug #430 travis enable local libopts
@fklassen
Copy link
Member

Fixed in PR #518

Note that non-maintainers should always try to download a release tarball. These releases already have all autogen/libopts man pages, documents and generated source code compiled so that autogendoes not have to exist on the build machine.

For maintainers, either use exactly the same version of autogen as I do, or run ./configure with --enable-local-libopts option. Doing so ensures that this problem will not occur. Another hack
may be to run an older version of autogen, but that may not work.

Note that this strict versioning is a requirement of the autogen/libopts packages. There is little that can be done in Tcpreplay to avoid this.

Above example of failure was attempting to build on machine with libopts 5.18.7 while the tarball contained version 5.18.4. This caused a conflict that is internal to libopts.

Tcpreplay version 4.2.6 and older have their release tarballs built on Debian 8 Jessie, which has libopts 5.18.4. Starting with version 4.3 I plan to build on Debian 9 Stretch which uses libopts 5.18.12.

This fix upgrades libopts to 5.18.12, but also includes some updates (some found in GnuTLS package):

  • add AC_LANG_SOURCE to libopts.m4 to make autogen.sh less noisy
  • fix build failure due to verify.h include in intprops.h
  • add support for libdumbnet in place of libdnet on Ubuntu/Debian
  • test for SIZEOF_LONG instead of SIZEOF_CHARP to fix 32-bit PPC builds

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants