[netperf-talk] Building netperf and netserver on Windows

Cook, Jonathan jonathan.cook at nist.gov
Thu Feb 2 09:55:56 PST 2012


Revision 532 is much closer to building right out of the box on Windows than released version 2.5.0, but I still ran into a few problems which I detail below:
1.            I added -DHAVE_INTTYPES_H -DWANT_DEMO -DWANT_HISTOGRAM to the C_DEFINES in the sources files.
2.            I had to find a Windows compatible version of stdint.h and place it in src\missing
3.            I needed to add the following to the top of hist.h
#ifdef WIN32
# include "missing\stdint.h"
#endif /* WIN32 */
4.            I had to create netperf_version.h manually since the configure script does not run in Windows.
5.            I had to add some explicit casts to get rid of the following warnings
1>c:\users\jonc\documents\netperf-latest\netperf2\src\netlib.c(3056) : warning C4018: '<' : signed/unsigned mismatch
1>c:\users\jonc\documents\netperf-latest\netperf2\src\netlib.c(4279) : warning C4244: 'function' : conversion from 'int64_t' to 'double', possible loss of data
1>c:\users\jonc\documents\netperf-latest\netperf2\src\nettest_bsd.c(585) : warning C4133: 'function' : incompatible types - from 'int *' to 'const char *'
1>c:\users\jonc\documents\netperf-latest\netperf2\src\nettest_bsd.c(1100) : warning C4133: 'function' : incompatible types - from 'int *' to 'const char *'
1>c:\users\jonc\documents\netperf-latest\netperf2\src\nettest_bsd.c(1114) : warning C4133: 'function' : incompatible types - from 'int *' to 'char *'
1>c:\users\jonc\documents\netperf-latest\netperf2\src\nettest_bsd.c(1126) : warning C4133: 'function' : incompatible types - from 'int *' to 'const char *'
1>c:\users\jonc\documents\netperf-latest\netperf2\src\nettest_bsd.c(1140) : warning C4133: 'function' : incompatible types - from 'int *' to 'char *'
6. I had to change
inline demo_interval_tick
to
__inline demo_interval_tick
in netlib.c to get rid of the following errors
1>c:\users\jonc\documents\netperf-latest\netperf2\src\netlib.c(3895) : error C2061: syntax error : identifier 'demo_interval_tick'
1>c:\users\jonc\documents\netperf-latest\netperf2\src\netlib.c(3895) : error C2059: syntax error : ';'
1>c:\users\jonc\documents\netperf-latest\netperf2\src\netlib.c(3895) : error C2059: syntax error : 'type'
1>c:\users\jonc\documents\netperf-latest\netperf2\src\netlib.c(3973) : error C4013: 'demo_interval_tick' undefined; assuming extern returning int
7.            I had to add function prototypes to get rid of the following errors
1>c:\users\jonc\documents\netperf-latest\netperf2\src\nettest_bsd.c(1954) : error C4013: 'demo_stream_setup' undefined; assuming extern returning int
1>c:\users\jonc\documents\netperf-latest\netperf2\src\nettest_bsd.c(2020) : error C4013: 'demo_first_timestamp' undefined; assuming extern returning int
1>c:\users\jonc\documents\netperf-latest\netperf2\src\nettest_omni.c(3719) : error C4013: 'demo_first_timestamp' undefined; assuming extern returning int
1>c:\users\jonc\documents\netperf-latest\netperf2\src\nettest_omni.c(4549) : error C4013: 'inet_ntop' undefined; assuming extern returning int
1>c:\users\jonc\documents\netperf-latest\netperf2\src\netserver.c(699) : error C4013: 'recv_request_timed_n' undefined; assuming extern returning int
8. Correct spelling to remove this error (a problem in Linux, too)
1>c:\users\jonc\documents\netperf-latest\netperf2\src\nettest_bsd.c(6727) : error C4013: 'demo_first_timetsamp' undefined; assuming extern returning int
9. Replace strndup with strncpy to get rid of the following error
1>c:\users\jonc\documents\netperf-latest\netperf2\src\netsh.c(888) : error C4013: 'strndup' undefined; assuming extern returning int
10.          I had to remove all instances of "#ifdef IPPROTO_TCP" and "#ifdef IPPROTO_UDP" since ws2def.h defines these in an enum, not #define
11.          The variable implicit_socket is always set to 0 preventing the socket type and protocol from being read on omni tests so I commented out all "if (implicit_socket)" (this would be a problem in Linux, also)
12.          The variable win_kludge_socket needs to be set before every call to recv_data.  It is missing in one case in nettest_omni.c and causes UDP receive tests to hang.
13.          PRIu64 is defined as "I64u" in inttypes.h and that breaks the function my_snprintf() so I added the following to the top of my_snprintf()
if (strcmp(format, PRIu64)==0){
                return snprintf(buffer, size, format, *(unsigned long long *)value);
}
14.          I also suggest that a check be added for fill file names being too long.

I tried building with -DWANT_INTERVALS, but that enabled code using setitimer() which is not available in Windows.  It appeared to me that it would take a lot of work to port that code to Windows.

Regards,
Jonathan Cook
Electronics Engineer
National Institute of Standards and Technology


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.netperf.org/pipermail/netperf-talk/attachments/20120202/dff2b748/attachment.html>


More information about the netperf-talk mailing list