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

could not find libiperf.so.0 on windows system #514

Closed
iamramanath opened this issue Feb 16, 2017 · 7 comments
Closed

could not find libiperf.so.0 on windows system #514

iamramanath opened this issue Feb 16, 2017 · 7 comments

Comments

@iamramanath
Copy link

i have installed iperf3 python wrapper but it is giving OS error: could not find libiperf.so.0
can u suggest a method to overcome this
i am using windows7

@pjebs
Copy link

pjebs commented Feb 16, 2017

so files are for Unix based operating systems and equivalent to dll files in windows

@iamramanath
Copy link
Author

So, how to use iperf3 on windows?

@bmah888
Copy link
Contributor

bmah888 commented Mar 15, 2017

Are you trying to just use iperf3 on Windows or develop some code to use iperf3 functionality? There exist iperf3 executables for Windows if you want the former. Maybe if you can find someone who made those, they might be able to help you with the latter.

@virtualtam
Copy link

Hi!

TL;DR
If your needs are simple, e.g. invoking iperf3 with a couple arguments and getting results back, I'd rather recommend running the executable using a Python subprocess and retrieving the console output (plain text or JSON) for further parsing.

I think @iamramanath wants to use iperf3 on a Windows host through the iperf3-python wrapper, which currently doesn't work for a couple of reasons:

  • iperf3 is distributed for Windows as a single iperf3.exe executable + the cygwin.dll shared library
  • iperf3-python provides a basic Ctypes interface to access the iperf3 shared library

For this combination to work you'd need (at least) to:

  1. build iperf3 on Windows to generate a shared library (DLL) and an executable using it
  2. update iperf3-python's code so all accessed C entities (functions, structures) are wrapped through Ctypes or CFFI

I've currently managed to:

  • build a functional iperf3 DLL by tweaking the project's autotools configuration (environment: Windows 7 x86_64 + Cygwin64)
  • start writing a somewhat functional Python wrapper from scratch using Ctypes/CFFI
  • start fiddling with Cython to get a more pythonic & maintainable wrapper

Cython seems to be the more promising approach, I'll keep you posted should I get a functional, portable solution :)

Cheers,

VirtualTam

@bmah888
Copy link
Contributor

bmah888 commented May 3, 2017

@iamramanath, did the information provided by @virtualtam answer your question?

virtualtam added a commit to virtualtam/iperf that referenced this issue May 10, 2017
Relates to esnet#514

Changed:
- enable libtool's Win32 DLL feature
- set libtool flags to force building a shared library

Build steps:
```
$ touch NEWS README AUTHORS ChangeLog
$ automake --add-missing --copy --foreign
$ autoreconf
$ ./configure
$ make -j8
```

Verification:
- build artifacts cre located under `src/.libs`
- there should be:
  - `cygiperf-0.dll` shared library
  - `iperf3.exe` executable binary linked to it
- `$ ldd src/.libs/iperf3.exe`

See:
- http://www.gnu.org/software/libtool/manual/html_node/LT_005fINIT.html
- https://www.sourceware.org/autobook/autobook/autobook_135.html
- https://www.sourceware.org/autobook/autobook/autobook_136.html
- https://www.sourceware.org/autobook/autobook/autobook_137.html
- http://stackoverflow.com/questions/26151995/autotools-make-doesnt-create-dll-under-cygwin
- https://autotools.io/libtool/windows.html
- https://cygwin.com/cygwin-ug-net/dll.html
- https://cygwin.com/problems.html
- http://stackoverflow.com/questions/25105573/compile-for-windows-using-mingw-w64-and-autotools

Signed-off-by: VirtualTam <virtualtam@flibidi.net>
virtualtam added a commit to virtualtam/iperf that referenced this issue May 10, 2017
Relates to esnet#514

Changed:
- enable libtool's Win32 DLL feature
- set libtool flags to force building a shared library

Build steps:
```
$ touch NEWS README AUTHORS ChangeLog
$ automake --add-missing --copy --foreign
$ autoreconf
$ ./configure
$ make -j8
```

Verification:
- build artifacts cre located under `src/.libs`
- there should be:
  - `cygiperf-0.dll` shared library
  - `iperf3.exe` executable binary linked to it
- `$ ldd src/.libs/iperf3.exe`

See:
- http://www.gnu.org/software/libtool/manual/html_node/LT_005fINIT.html
- https://www.sourceware.org/autobook/autobook/autobook_135.html
- https://www.sourceware.org/autobook/autobook/autobook_136.html
- https://www.sourceware.org/autobook/autobook/autobook_137.html
- http://stackoverflow.com/questions/26151995/autotools-make-doesnt-create-dll-under-cygwin
- https://autotools.io/libtool/windows.html
- https://cygwin.com/cygwin-ug-net/dll.html
- https://cygwin.com/problems.html
- http://stackoverflow.com/questions/25105573/compile-for-windows-using-mingw-w64-and-autotools

Signed-off-by: VirtualTam <virtualtam@flibidi.net>
virtualtam added a commit to virtualtam/iperf that referenced this issue May 10, 2017
Relates to esnet#514

Changed:
- enable libtool's Win32 DLL feature
- set libtool flags to force building a shared library

Build steps:
```
$ touch NEWS README AUTHORS ChangeLog
$ automake --add-missing --copy --foreign
$ autoreconf
$ ./configure
$ make -j8
```

Verification:
- build artifacts cre located under `src/.libs`
- there should be:
  - `cygiperf-0.dll` shared library
  - `iperf3.exe` executable binary linked to it
- `$ ldd src/.libs/iperf3.exe`

TODO:
- cleanup autotools flags
- only enable Windows DLL tools/settings when building on Windows/Cygwin

See:
- http://www.gnu.org/software/libtool/manual/html_node/LT_005fINIT.html
- https://www.sourceware.org/autobook/autobook/autobook_135.html
- https://www.sourceware.org/autobook/autobook/autobook_136.html
- https://www.sourceware.org/autobook/autobook/autobook_137.html
- http://stackoverflow.com/questions/26151995/autotools-make-doesnt-create-dll-under-cygwin
- https://autotools.io/libtool/windows.html
- https://cygwin.com/cygwin-ug-net/dll.html
- https://cygwin.com/problems.html
- http://stackoverflow.com/questions/25105573/compile-for-windows-using-mingw-w64-and-autotools

Signed-off-by: VirtualTam <virtualtam@flibidi.net>
@virtualtam
Copy link

Hi,

I've finally settled for a simple Python wrapper leveraging iperf3's JSON output and the portable Plumbum shell/cmd wrapper:

import logging
from plumbum import local
from plumbum.commands.processes import CommandNotFound, ProcessExecutionError

class IperfError(Exception):
    """Raised when iperf execution fails"""

def run_iperf3_client(server_ip, **kwargs):
    """Run an iperf3 client and return JSON results"""
    iperf3_args = ['-J', '-c', server_ip]

    if kwargs.get('reverse', False):
        iperf3_args.append('-R')

    try:
        iperf3 = local['iperf3']
        return iperf3(*iperf3_args)
    except CommandNotFound as err:
        logging.error("%s not found", err.program)
        raise IperfError(err)
    except ProcessExecutionError as err:
        logging.error("%s exited with %d", err.argv[0], err.retcode)
        raise IperfError(err)

For the sake of completeness, I've also uploaded a (very rough and basic) working solution allowing to build iperf3 as a shared library (DLL) on Cygwin64 and bind to its API using Cython:

Hope this helps ;-)

@bmah888 bmah888 removed the question label May 17, 2017
@bmah888
Copy link
Contributor

bmah888 commented Jun 7, 2017

I'm going to assume the OP's question got taken care of one way or another, so closing.

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

No branches or pull requests

5 participants