Would be nice if code built on MacOS X

Bug #658825 reported by Cricket Liu
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Gist
Status tracked in 0.2
0.2
Fix Released
Undecided
Unassigned

Bug Description

I realize it probably wasn't an original requirement, but all our SEs now have Macs, so it would be really nice if the code built on MacOS X. Currently it bombs here:

Making all in xstd
/bin/sh ./libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I./include -I./include -g -O3 -Wall -Wwrite-strings -Woverloaded-virtual -pipe -MT AggrStat.lo -MD -MP -MF .deps/AggrStat.Tpo -c -o AggrStat.lo AggrStat.cc
libtool: compile: g++ -DHAVE_CONFIG_H -I./include -I./include -g -O3 -Wall -Wwrite-strings -Woverloaded-virtual -pipe -MT AggrStat.lo -MD -MP -MF .deps/AggrStat.Tpo -c AggrStat.cc -fno-common -DPIC -o .libs/AggrStat.o
In file included from ./include/xstd/AggrStat.h:8,
                 from AggrStat.cc:7:
./include/xstd/BinStream.h:7:20: error: endian.h: No such file or directory
In file included from ./include/xstd/AggrStat.h:8,
                 from AggrStat.cc:7:
./include/xstd/BinStream.h: In member function ‘int64_t IBinStream::geti64(int64_t&)’:
./include/xstd/BinStream.h:44: error: ‘be64toh’ was not declared in this scope
./include/xstd/BinStream.h: In member function ‘void OBinStream::puti64(int64_t)’:
./include/xstd/BinStream.h:77: error: ‘htobe64’ was not declared in this scope
make[3]: *** [AggrStat.lo] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive] Error 1

Revision history for this message
Dmitry Kurochkin (dmitry.kurochkin) wrote :

Hi Cricket.

Please try the attached patch. It fixes build on FreeBSD and should help with MacOS X as well.

Note, you should (re)run bootstrap.sh and configure before make.

Regards,
  Dmitry

Changed in gist:
status: New → In Progress
Revision history for this message
Cricket Liu (cricket) wrote :

Hmm. Did a clean untar and applied the patch (which seemed to apply fine) but am seeing the same errors. Don't discount the possibility that I did something stupid--I'm not the sys admin I once was.

Anyway, the errors are still:

Making all in xstd
/bin/sh ./libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I./include -I./include -g -O3 -Wall -Wwrite-strings -Woverloaded-virtual -pipe -MT AggrStat.lo -MD -MP -MF .deps/AggrStat.Tpo -c -o AggrStat.lo AggrStat.cc
libtool: compile: g++ -DHAVE_CONFIG_H -I./include -I./include -g -O3 -Wall -Wwrite-strings -Woverloaded-virtual -pipe -MT AggrStat.lo -MD -MP -MF .deps/AggrStat.Tpo -c AggrStat.cc -fno-common -DPIC -o .libs/AggrStat.o
In file included from ./include/xstd/AggrStat.h:8,
                 from AggrStat.cc:7:
./include/xstd/BinStream.h: In member function ‘int64_t IBinStream::geti64(int64_t&)’:
./include/xstd/BinStream.h:49: error: ‘be64toh’ was not declared in this scope
./include/xstd/BinStream.h: In member function ‘void OBinStream::puti64(int64_t)’:
./include/xstd/BinStream.h:82: error: ‘htobe64’ was not declared in this scope
make[3]: *** [AggrStat.lo] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive] Error 1

Revision history for this message
Philip (pmiller-infoblox) wrote :

Ditto here on OSX 10.6.4 with developer tools..
-----
patch -p1 < ../freebsd_build.patch
patching file configure.in
patching file import/DnsPaxxer/cfgaux/ax_prefix_config_h.m4
patching file import/xstd/cfgaux/ax_prefix_config_h.m4
patching file import/xstd/configure.in
patching file import/xstd/include/xstd/BinStream.h
patching file src/Sniffer.cc
patching file src/Sniffer.h
patching file src/Tcp.cc
patching file src/TrafficGist.h
-----
./configure && make

Also bails out on BinStream.h with the same issue on Debian5/ia64.. maybe a 64bit headers thing?

Installing a 32bit Deb5 vm to test... will post progress...

Revision history for this message
Philip (pmiller-infoblox) wrote :

Builds successfully on ubuntu 10/32bit debian5/i386 still bails out, but might have been an autoconf problem I created.

OSX build would be far preferable so I can run at wire speed.. =)

Revision history for this message
Dmitry Kurochkin (dmitry.kurochkin) wrote :

Hi Philip.

> Debian5/ia64

You mean amd64 or Itanium?

Should build fine on Debian/amd64, I am using it.

> OSX build would be far preferable so I can run at wire speed.. =)

We are working on it.

Regards,
  Dmitry

Revision history for this message
Dmitry Kurochkin (dmitry.kurochkin) wrote :

Can you please try the attached patch mac_os_x_build.patch? It should build fine on Mac OS X 10.6.3 at least.

Note you need to run bootstrap.sh after applying the patch.

Regards,
  Dmtitry

Revision history for this message
Philip (pmiller-infoblox) wrote :

Hi Dmitry,
I was using Debian 5 as a 64bit VM to Fusion with 2 64bit cpu cores. (intel instruction set)

This patch applies cleanly in 10.6.4, but when running bootstrap.sh it complains my stock apple developer tools version of autoconf is too old, and the bootstrap process fails with several lines worth of the following:
"configure.in:11: error: Autoconf version 2.62 or higher is required"

schitzo:traffic-gist-0.1.0 phmiller$ autoconf --version
autoconf (GNU Autoconf) 2.61
Copyright (C) 2006 Free Software Foundation, Inc.

Do I need to use a macports version of autoconf?
I'd prefer not to "soil" my very stock install of developer tools if it can be avoided.. ;-)

thanks for working this out with us!
-Philip

Revision history for this message
Philip (pmiller-infoblox) wrote :
Download full text (27.1 KiB)

installed ports for automake/autoconf/gettext etc... bootstrap.sh gets further, but still not clean, and the make process dies in a different spot now. =)

--------BOOTSTRAP OUTPUT-------
./bootstrap.sh
Bootstrapping /Users/phmiller/Downloads/traffic-gist-0.1.0/import/xstd
+ aclocal
+ libtoolize --automake --force --copy --ltdl
libtoolize: `COPYING.LIB' not found in `/usr/bin/../share/libtool/libltdl'
Adjusting libltdl/*
sed: libltdl/Makefile.in: No such file or directory
chmod: libltdl/Makefile.in: No such file or directory

+ autoconf
+ autoheader --warnings=all
+ automake --foreign --add-missing --copy --force-missing --no-force --warnings all
configure.in:48: installing `cfgaux/config.guess'
configure.in:48: installing `cfgaux/config.sub'
done.
+ aclocal
configure.in:37: warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body
../../lib/autoconf/lang.m4:194: AC_LANG_CONFTEST is expanded from...
../../lib/autoconf/general.m4:2662: _AC_LINK_IFELSE is expanded from...
../../lib/autoconf/general.m4:2679: AC_LINK_IFELSE is expanded from...
configure.in:37: the top level
configure.in:37: warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body
../../lib/autoconf/lang.m4:194: AC_LANG_CONFTEST is expanded from...
../../lib/autoconf/general.m4:2662: _AC_LINK_IFELSE is expanded from...
../../lib/autoconf/general.m4:2679: AC_LINK_IFELSE is expanded from...
../../lib/m4sugar/m4sh.m4:606: AS_IF is expanded from...
../../lib/autoconf/general.m4:2662: _AC_LINK_IFELSE is expanded from...
../../lib/autoconf/general.m4:2679: AC_LINK_IFELSE is expanded from...
configure.in:37: the top level
+ libtoolize --automake --force --copy
Warning: libtoolize 1.x does not update libtool.m4.

+ autoconf
configure.in:37: warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body
../../lib/autoconf/lang.m4:194: AC_LANG_CONFTEST is expanded from...
../../lib/autoconf/general.m4:2662: _AC_LINK_IFELSE is expanded from...
../../lib/autoconf/general.m4:2679: AC_LINK_IFELSE is expanded from...
configure.in:37: the top level
configure.in:37: warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body
../../lib/autoconf/lang.m4:194: AC_LANG_CONFTEST is expanded from...
../../lib/autoconf/general.m4:2662: _AC_LINK_IFELSE is expanded from...
../../lib/autoconf/general.m4:2679: AC_LINK_IFELSE is expanded from...
../../lib/m4sugar/m4sh.m4:606: AS_IF is expanded from...
../../lib/autoconf/general.m4:2662: _AC_LINK_IFELSE is expanded from...
../../lib/autoconf/general.m4:2679: AC_LINK_IFELSE is expanded from...
configure.in:37: the top level
+ autoheader --warnings=all
configure.in:37: warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body
../../lib/autoconf/lang.m4:194: AC_LANG_CONFTEST is expanded from...
../../lib/autoconf/general.m4:2662: _AC_LINK_IFELSE is expanded from...
../../lib/autoconf/general.m4:2679: AC_LINK_IFELSE is expanded from...
configure.in:37: the top level
configure.in:37: warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body
../../lib/autoconf/lang.m4:194: AC_LANG_CONFTEST is expanded from...
../../lib/autoconf/general.m4:2662: _AC_LINK_IFELSE is expanded from...
../../lib/autoconf/general.m4:2679: AC...

Revision history for this message
Philip (pmiller-infoblox) wrote :

SUCCESS!!!! - turns out libtoolize became glibtoolize when I installed the port, a link from glibtoolize to libtoolze and glibtool to libtool in /opt/local/bin took care of it...

schitzo:bin phmiller$ ./traffic-gist
Usage: ./traffic-gist [--option ...]

Options:
  --interface IFACE network interface to capture traffic from, default is `any'
  --pcap FILE pcap dump to read packet from
  --duration TIME exit after TIME, disabled if 0, default is 0
  --interval TIME stats measurement interval, default 5sec
  --help usage info
  --version version info

schitzo:bin phmiller$ file traffic-gist
traffic-gist: Mach-O 64-bit executable x86_64

Revision history for this message
Dmitry Kurochkin (dmitry.kurochkin) wrote :

Philip thanks for testing!

I am sorry you had to install upgraded version of autoconf. We will make a release with portability fixes soon. You will not need to run bootstrap.sh for it. Besides you can run bootstrap.sh on Linux and configure/make on Mac OS X (that is basically how it works for releases).

Regards,
  Dmitry

Changed in gist:
status: In Progress → Fix Committed
Changed in gist:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.