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

error: undefined reference to time_diff possibly due to missing dependencies #10

Closed
askb opened this issue Feb 20, 2017 · 2 comments
Closed

Comments

@askb
Copy link

askb commented Feb 20, 2017

We get the following error while building mtcbench, with default version of openvswitch-switch openvswitch-vtep and mininet (mininet is already the newest version (2.2.1-2).) that comes with ubuntu 16.04.

libtool: link: gcc -g -O2 -Wall -I/home/ubuntu/mtcbench/oflops/../openflow//include -Wshadow -Wl,-E -o oflops channel_info.o context.o control.o module_run.o module_default.o oflops.o oflops_pcap.o timer_event.o msg.o log.o traffic_generator.o usage.o  -L/home/ubuntu/mtcbench/oflops/../openflow//lib -ldl -lpcap /home/ubuntu/mtcbench/oflops/.libs/liboflops_test.a -lconfig -lpthread -lnetsnmp
traffic_generator.o: In function `get_next_pkt':
/home/ubuntu/mtcbench/oflops/traffic_generator.c:140: undefined reference to `time_diff'
collect2: error: ld returned 1 exit status
Makefile:577: recipe for target 'oflops' failed
make[2]: *** [oflops] Error 1
make[2]: Leaving directory '/home/ubuntu/mtcbench/oflops'
Makefile:642: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/ubuntu/mtcbench/oflops'
Makefile:434: recipe for target 'all' failed
make: *** [all] Error 2

I think the error undefined reference to time_diff'is due to missing dependencies fromoflopswhich gets installed through running the scriptmininet/util/install.sh -b` only available on the master branch mininet.

# Install cbench
function cbench {
    echo "Installing cbench..."

    if [ "$DIST" = "Fedora" -o "$DIST" = "RedHatEnterpriseServer" ]; then
        $install net-snmp-devel libpcap-devel libconfig-devel
        elif [ "$DIST" = "SUSE LINUX"  ]; then
                $install net-snmp-devel libpcap-devel libconfig-devel
    else
        $install libsnmp-dev libpcap-dev libconfig-dev
    fi
    cd $BUILD_DIR/
    # was:  git clone git://gitosis.stanford.edu/oflops.git
    # Use our own fork on github for now:
    git clone git://github.com/mininet/oflops
    cd oflops
    sh boot.sh || true # possible error in autoreconf, so run twice
    sh boot.sh
    ./configure --with-openflow-src-dir=$BUILD_DIR/openflow
    make
    sudo make install || true # make install fails; force past this

Is there a fix or workaround for this issue, allowing using the default version of mininet ?

@panageo
Copy link
Member

panageo commented Feb 28, 2017

Hello @askb

We managed to reproduce the issue using Ubuntu 16.04.

Currently the supported distribution is ubuntu 14.04. But there is a workaround for this issue. Following directions of this link

dfarrell07/wcbench#77 (comment)

do the following steps

  1. git clone https://github.com/intracom-telecom-sdn/mtcbench.git
  2. cd mtcbench folder
  3. run provision script to install all mtcbench dependencies: ./deploy/docker/provision.sh
  4. run mtcbench build script: ./build_mtcbench.sh
    (step 4 will return you the same error but ignore it. You want to get the binary file under the path oflops/cbench)
  5. cd into folder oflops/cbench: cd oflops/cbench/
  6. run make and you will get cbench binary

@panageo panageo closed this as completed Feb 28, 2017
odl-github pushed a commit to opendaylight/releng-builder that referenced this issue Mar 24, 2017
- Use default version of mininet and openvswitch
- Add workaround for mtcbench build issue
  intracom-telecom-sdn/mtcbench#10
- Enable Ubuntu1604 image only for mininet-ovs-2.5
- Enable Ubuntu1404 image only for mininet, mininet-ovs-2.3
- trello: https://trello.com/c/chIxf7ca

Change-Id: Ide927e10cd35f131a4507bb898ad5d4520843f07
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
odl-github pushed a commit to opendaylight/docs that referenced this issue Mar 24, 2017
Project: releng/builder master 4c795879a60c04e5083cc1fe94fbfa4516017201

Merge "Build Ubuntu 16.04 for mininet-ovs-2.5"

Build Ubuntu 16.04 for mininet-ovs-2.5

- Use default version of mininet and openvswitch
- Add workaround for mtcbench build issue
  intracom-telecom-sdn/mtcbench#10
- Enable Ubuntu1604 image only for mininet-ovs-2.5
- Enable Ubuntu1404 image only for mininet, mininet-ovs-2.3
- trello: https://trello.com/c/chIxf7ca

Change-Id: Ide927e10cd35f131a4507bb898ad5d4520843f07
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
odl-github pushed a commit to opendaylight/docs that referenced this issue Mar 24, 2017
Project: releng/builder master 4c795879a60c04e5083cc1fe94fbfa4516017201

Merge "Build Ubuntu 16.04 for mininet-ovs-2.5"

Build Ubuntu 16.04 for mininet-ovs-2.5

- Use default version of mininet and openvswitch
- Add workaround for mtcbench build issue
  intracom-telecom-sdn/mtcbench#10
- Enable Ubuntu1604 image only for mininet-ovs-2.5
- Enable Ubuntu1404 image only for mininet, mininet-ovs-2.3
- trello: https://trello.com/c/chIxf7ca

Change-Id: Ide927e10cd35f131a4507bb898ad5d4520843f07
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
@ljy6j13
Copy link

ljy6j13 commented Oct 21, 2020

In util.h and util.c, the time_diff function is defined as inline function,I delete the inline keyword and it works.

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

No branches or pull requests

3 participants