direct-code-execution / ns-3-dce

Run real programs in the discrete time simulator ns3
http://www.nsnam.org/projects/direct-code-execution/
74 stars 46 forks source link

Problem when trying to build an optimized build #7

Open teto opened 9 years ago

teto commented 9 years ago

With current master, when using --enable-opt (and an alternate directory), configure fails

$ ./waf configure --with-ns3=$HOME/ns3off/install --enable-opt

Setting top to                           : /home/teto/dce 
Setting out to                           : /home/teto/dce/build 
Checking for 'gcc' (c compiler)          : /usr/bin/gcc 
Checking for 'g++' (c++ compiler)        : /usr/bin/g++ 
Checking for program pkg-config          : /usr/bin/pkg-config 
Checking for pkg-config version >= '0.0.0' : yes 
Checking for -Wl,--soname=foo              : yes 
Checking for ns3-core (None)               : not found 
The configuration failed
(complete log in /home/teto/dce/build/config.log)

with config.log:

# project  configured on Fri Aug 21 15:26:47 2015 by
# waf 1.6.11 (abi 98, python 20709f0 on linux2)
# using ./waf configure --with-ns3=/home/teto/ns3off/install --enable-opt
#
----------------------------------------
Setting top to
/home/teto/dce
----------------------------------------
Setting out to
/home/teto/dce/build
----------------------------------------
Checking for 'gcc' (c compiler)
find program=['gcc', 'cc'] paths=['/home/teto/bin', '/usr/lib/w3m', '/usr/local/sbin', '/usr/local/bin', '/usr/sbin', '/usr/bin', '/sbin', '/bin', '/usr/games', '/usr/local/games', '/home/teto/csvfix/csvfix/bin', '/home/teto/powerline/scripts'] var='CC' -> '/usr/bin/gcc'
find program=['ar'] paths=['/home/teto/bin', '/usr/lib/w3m', '/usr/local/sbin', '/usr/local/bin', '/usr/sbin', '/usr/bin', '/sbin', '/bin', '/usr/games', '/usr/local/games', '/home/teto/csvfix/csvfix/bin', '/home/teto/powerline/scripts'] var='AR' -> '/usr/bin/ar'
/usr/bin/gcc
----------------------------------------
Checking for 'g++' (c++ compiler)
find program=['g++', 'c++'] paths=['/home/teto/bin', '/usr/lib/w3m', '/usr/local/sbin', '/usr/local/bin', '/usr/sbin', '/usr/bin', '/sbin', '/bin', '/usr/games', '/usr/local/games', '/home/teto/csvfix/csvfix/bin', '/home/teto/powerline/scripts'] var='CXX' -> '/usr/bin/g++'
(tool ar is already loaded, skipping)
/usr/bin/g++
----------------------------------------
Checking for program pkg-config
/usr/bin/pkg-config
find program=['pkg-config'] paths=['/home/teto/bin', '/usr/lib/w3m', '/usr/local/sbin', '/usr/local/bin', '/usr/sbin', '/usr/bin', '/sbin', '/bin', '/usr/games', '/usr/local/games', '/home/teto/csvfix/csvfix/bin', '/home/teto/powerline/scripts'] var='PKGCONFIG' -> '/usr/bin/pkg-config'
------------------------------------------
Checking for pkg-config version >= '0.0.0'
['/usr/bin/pkg-config', '--atleast-pkgconfig-version=0.0.0']
yes
------------------------------------------
Checking for -Wl,--soname=foo
==>
#include <stdio.h>
int main() { return 0; }

<==
[1/2] c: build/.conf_check_0c2b10ba6878dc866144bf5ea8a6b94b/test.c -> build/.conf_check_0c2b10ba6878dc866144bf5ea8a6b94b/testbuild/test.c.1.o

['/usr/bin/gcc', '-Wl,--soname=foo', '-I/home/teto/ns3off/install/include/ns3-dev', '../test.c', '-c', '-o', 'test.c.1.o']
[2/2] cprogram: build/.conf_check_0c2b10ba6878dc866144bf5ea8a6b94b/testbuild/test.c.1.o -> build/.conf_check_0c2b10ba6878dc866144bf5ea8a6b94b/testbuild/testprog

['/usr/bin/gcc', 'test.c.1.o', '-o', '/home/teto/dce/build/.conf_check_0c2b10ba6878dc866144bf5ea8a6b94b/testbuild/testprog', '-Wl,-Bstatic', '-Wl,-Bdynamic']
yes
------------------------------------------
Checking for ns3-core (None)
['/usr/bin/pkg-config', '--cflags', '--libs']
err: Must specify package names on the command line

not found
from /home/teto/dce: The configuration failed

Apparently there is a call ['/usr/bin/pkg-config', '--cflags', '--libs'] that miss the library name.

Without '--enable-opt' compilation works fine:

 ./waf configure --with-ns3=/home/teto/ns3off/install                                     
Setting top to                           : /home/teto/dce 
Setting out to                           : /home/teto/dce/build 
Checking for 'gcc' (c compiler)          : /usr/bin/gcc 
Checking for 'g++' (c++ compiler)        : /usr/bin/g++ 
Checking for program pkg-config          : /usr/bin/pkg-config 
Checking for pkg-config version >= '0.0.0' : yes 
Checking for -Wl,--soname=foo              : yes 
Checking for ns3-core (ns3-dev)            : yes 
Checking for ns3-network (ns3-dev)         : yes 
Checking for ns3-internet (ns3-dev)        : yes 
Checking for ns3-point-to-point (ns3-dev)  : yes 
Checking for ns3-tap-bridge (ns3-dev)      : yes 
Checking for ns3-netanim (ns3-dev)         : yes 
Checking for ns3-wifi (ns3-dev)            : yes 
Checking for ns3-csma (ns3-dev)            : yes 
Checking for ns3-mobility (ns3-dev)        : yes 
Checking for ns3-point-to-point-layout (ns3-dev) : yes 
Checking for ns3-mpi (ns3-dev)                   : yes 
Checking for ns3-lte (ns3-dev)                   : yes 
Checking for ns3-visualizer (None)               : not found 
Checking for ns3-applications (ns3-dev)          : yes 
Checking for ns3-fd-net-device (ns3-dev)         : yes 
Checking for header stdint.h                     : yes 
Checking for header inttypes.h                   : yes 
Checking for header sys/inttypes.h               : not found 
Checking for header sys/types.h                  : yes 
Checking for header sys/stat.h                   : yes 
Checking for header dirent.h                     : yes 
Checking for library dl                          : yes 
Checking for glibc get_cpu_features              : yes 
Checking for glibc __secure_getenv               : no 
Checking for header valgrind/valgrind.h          : yes 
Checking for header valgrind/memcheck.h          : yes 
Checking for ns3-flow-monitor (ns3-dev)          : yes 
Checking for 'gcc' (c compiler)                  : /usr/bin/gcc 
Checking for header hook-manager.h               : not found 
Checking for program valgrind                    : /usr/bin/valgrind 
Checking for program doxygen                     : /usr/bin/doxygen 
Checking for header netinet/sctp.h               : not found 
Checking for program python                      : /usr/bin/python 
Checking for python version                      : (2, 7, 9, 'final', 0) 
Checking for library python2.7 in LIBDIR         : yes 
Checking for program python2.7-config,python-config-2.7,python2.7m-config : /usr/bin/python2.7-config 
Checking for header Python.h                                              : yes 
Checking for pybindgen location                                           : not found 
Python module pybindgen                                                   : not found 
pybindgen missing => no python bindings
---- Summary of optional NS-3 features:
Static build                  : not enabled (option --enable-static not selected)
Logging                       : enabled
Assert checks                 : enabled
Code coverage                 : not enabled (option --enable-gcov not selected)
Example programs              : enabled
Test programs                 : enabled
Debug Symbols                 : enabled
ELF magic loader              : not enabled (elf-loader not found)
Aspect-based tracing          : not enabled (libaspect not found)
sctp-tools-dev                : not enabled (sctp-tools (netinet/sctp.h) not found)
'configure' finished successfully (0.858s)
thehajime commented 9 years ago

@teto right now with --enable-opt option, the waf (of dce) tries to find the optimized build version of ns-3 under the directory specified by --with-ns3. did you build ns-3-dev with optimized build ?

teto commented 9 years ago

I had only a debug version of ns3 so it's normal that it didn't work. Maybe the error message could be improved so that it becomes clearer ? like "Could not find ns3 with --debug-profile=optimized" or something along those lines. After posting this, I found some posts on ns mailing list of people with the same problem.