Bugzilla – Bug 360
nsc still NOT build itself in ns-3.2
Last modified: 2008-11-18 00:57:15 EST
[336/514] cxx: src/internet-stack/nsc-tcp-l4-protocol.cc -> build/debug/src/inte rnet-stack/nsc-tcp-l4-protocol_1.o ../src/internet-stack/nsc-tcp-socket-impl.cc: In member function `virtual int ns 3::NscTcpSocketImpl::Send(ns3::Ptr<ns3::Packet>, uint32_t)': ../src/internet-stack/nsc-tcp-socket-impl.cc:347: warning: converting of negativ e value `-0x000000001' to `long unsigned int' ../src/internet-stack/nsc-tcp-l4-protocol.cc: In member function `virtual void n s3::NscTcpL4Protocol::send_callback(const void*, int)': ../src/internet-stack/nsc-tcp-l4-protocol.cc:318: error: invalid application of `sizeof' to incomplete type `ns3::iphdr' ../src/internet-stack/nsc-tcp-l4-protocol.cc:321: error: invalid application of `sizeof' to incomplete type `ns3::iphdr' ../src/internet-stack/nsc-tcp-l4-protocol.cc:328: error: invalid application of `sizeof' to incomplete type `ns3::iphdr' ../src/internet-stack/nsc-tcp-l4-protocol.cc:330: error: invalid use of undefine d type `const struct ns3::iphdr' ../src/internet-stack/nsc-tcp-l4-protocol.cc:321: error: forward declaration of `const struct ns3::iphdr' ../src/internet-stack/nsc-tcp-l4-protocol.cc:331: error: invalid use of undefine d type `const struct ns3::iphdr' ../src/internet-stack/nsc-tcp-l4-protocol.cc:321: error: forward declaration of `const struct ns3::iphdr' Build failed
Can you please tell us what version of gcc and g++ you are compiling with? The output of "g++ -v" and "gcc -v" would be very helpful. Also that of "uname -a" would help.
$ g++ -v Reading specs from /usr/lib/gcc/i686-pc-cygwin/3.4.4/specs Configured with: /usr/build/package/orig/test.respin/gcc-3.4.4-3/configure --ver bose --prefix=/usr --exec-prefix=/usr --sysconfdir=/etc --libdir=/usr/lib --libe xecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --enable-langu ages=c,ada,c++,d,f77,pascal,java,objc --enable-nls --without-included-gettext -- enable-version-specific-runtime-libs --without-x --enable-libgcj --disable-java- awt --with-system-zlib --enable-interpreter --disable-libgcj-debug --enable-thre ads=posix --enable-java-gc=boehm --disable-win32-registry --enable-sjlj-exceptio ns --enable-hash-synchronization --enable-libstdcxx-debug Thread model: posix gcc version 3.4.4 (cygming special, gdc 0.12, using dmd 0.125) $ gcc -v Reading specs from /usr/lib/gcc/i686-pc-cygwin/3.4.4/specs Configured with: /usr/build/package/orig/test.respin/gcc-3.4.4-3/configure --ver bose --prefix=/usr --exec-prefix=/usr --sysconfdir=/etc --libdir=/usr/lib --libe xecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --enable-langu ages=c,ada,c++,d,f77,pascal,java,objc --enable-nls --without-included-gettext -- enable-version-specific-runtime-libs --without-x --enable-libgcj --disable-java- awt --with-system-zlib --enable-interpreter --disable-libgcj-debug --enable-thre ads=posix --enable-java-gc=boehm --disable-win32-registry --enable-sjlj-exceptio ns --enable-hash-synchronization --enable-libstdcxx-debug Thread model: posix gcc version 3.4.4 (cygming special, gdc 0.12, using dmd 0.125) $ uname -a CYGWIN_NT-5.1 Gavin 1.5.25(0.156/4/2) 2008-06-12 19:34 i686 Cygwin (In reply to comment #1) > Can you please tell us what version of gcc and g++ you are compiling with? > The output of "g++ -v" and "gcc -v" would be very helpful. Also that of "uname > -a" would help.
Ahh, it's cygwin. I do not believe anybody has ever tested NSC on cygwin, so it's unsurprising it fails to some degree. I'll have a look at this but I do not have an ETA at this time. NSC has only ever been used on Unix systems in the past, so be warned it may be a while before cygwin support is working 100%.
I really don't know how easy it is going to be to support cygwin. It looks like a real up-hill battle. I started looking at this and fixed the minor problem in the ns-3 code, but compiling NSC looked difficult: $ python scons.py linux-2.6.18/ scons: Reading SConscript files ... Checking target architecure...(cached) x86 scons: done reading SConscript files. scons: Building targets ... as -o linux-2.6.18/arch/i386/lib/checksum.o linux-2.6.18/arch/i386/lib/checksum. S linux-2.6.18/arch/i386/lib/checksum.S: Assembler messages: linux-2.6.18/arch/i386/lib/checksum.S:138: Error: symbol `csum_partial' is alrea dy defined linux-2.6.18/arch/i386/lib/checksum.S:270: Error: no such instruction: `y' linux-2.6.18/arch/i386/lib/checksum.S:270: Error: junk at end of line, first unr ecognized character is `\' linux-2.6.18/arch/i386/lib/checksum.S:271: Error: junk at end of line, first unr ecognized character is `\' linux-2.6.18/arch/i386/lib/checksum.S:272: Error: junk at end of line, first unr etc. To be fair, the C++ files seem to compile. So maybe it's not too bad. Gavin, I would like to suggest trying Linux instead if at all possible. It will make the experience much more pleasant for you. But I will attempt to fix the problems here. Unfortunately cygwin never quite provides a completely linux environment, there are always a few problems that expose assumptions in code. I can't make any guarantees this will work. ... OK, I did some more analysis. There are going to be some difficult problems to solve because in cygwin you need to make PE targets, not ELF. Unfortunately there are ELF directives in the ASM we generate, and we also use a linker script, so I'm not sure how that is going to work on cygwin. It's going to require quite a bit of hacking to get NSC working on cygwin, I'm not entirely convinced it is worth it.
Marking as "wont fix" -- cygwin isn't possible in any sort of practical timescale for me. It might be possible to make work but it will be a mammoth effort. I believe a better solution is to install a VM and run Linux on Windows that way to make this work. e.g. http://www.virtualbox.org/ is free and works well.