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

Waf checks other libraries then the one it is asked to #28

Open teto opened 8 years ago

teto commented 8 years ago

There is a problem in package detection when some modules are missing, waf is checking for a module different than the one it should, thus giving wrong results as in: Checking for ns3-netanim (ns3-dev) : 00:54:27 runner ['/usr/bin/pkg-config', 'libns3-dev-point-to-point-debug', '--cflags', '--libs'] yes

Here is a full log

CXX="g++" CXXFLAGS=" -g -Wno-reorder -Wno-unused-variable -std=c++11 " ./waf configure --with-ns3=$HOME/ns3off/install --enable-kernel-stack=$HOME/mptcpoff/arch --prefix=$HOME/dce/build -v
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)        : g++ 
Checking for program pkg-config          : /usr/bin/pkg-config 
Checking for pkg-config version >= '0.0.0' : 00:54:27 runner ['/usr/bin/pkg-config', '--atleast-pkgconfig-version=0.0.0']
yes 
Checking for -Wl,--soname=foo              : Erroneous order constraint 'before'='command' on task class 'apiscan_task'
Erroneous order constraint 'after'='gen_ns3_module_header' on task class 'apiscan_task'
Erroneous order constraint 'after'='ns3header' on task class 'apiscan_task'
00:54:27 runner ['/usr/bin/gcc', '-Wl,--soname=foo', '../test.c', '-c', '-o', 'test.c.1.o']
00:54:27 runner ['/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 (ns3-dev)            : 00:54:27 runner ['/usr/bin/pkg-config', 'libns3-dev-core-debug', '--cflags', '--libs']
yes 
Checking for ns3-network (ns3-dev)         : 00:54:27 runner ['/usr/bin/pkg-config', 'libns3-dev-network-debug', '--cflags', '--libs']
yes 
Checking for ns3-internet (ns3-dev)        : 00:54:27 runner ['/usr/bin/pkg-config', 'libns3-dev-internet-debug', '--cflags', '--libs']
yes 
Checking for ns3-point-to-point (ns3-dev)  : 00:54:27 runner ['/usr/bin/pkg-config', 'libns3-dev-point-to-point-debug', '--cflags', '--libs']
yes 
Checking for ns3-tap-bridge (ns3-dev)      : 00:54:27 runner ['/usr/bin/pkg-config', 'libns3-dev-point-to-point-debug', '--cflags', '--libs']
yes 
Checking for ns3-netanim (ns3-dev)         : 00:54:27 runner ['/usr/bin/pkg-config', 'libns3-dev-point-to-point-debug', '--cflags', '--libs']
yes 
Checking for ns3-wifi (ns3-dev)            : 00:54:27 runner ['/usr/bin/pkg-config', 'libns3-dev-wifi-debug', '--cflags', '--libs']
yes 
Checking for ns3-csma (ns3-dev)            : 00:54:27 runner ['/usr/bin/pkg-config', 'libns3-dev-csma-debug', '--cflags', '--libs']
yes 
Checking for ns3-mobility (ns3-dev)        : 00:54:27 runner ['/usr/bin/pkg-config', 'libns3-dev-mobility-debug', '--cflags', '--libs']
#! /usr/bin/env python

# A list of the modules that will be enabled when ns-3 is run.
# Modules that depend on the listed modules will be enabled also.
#
# All modules can be enabled by choosing 'all_modules'.
#modules_enabled = ['all_modules']
# point-to-point-layout needs to be included for netanim but why do I have netanim compilated ?
modules_enabled = [
'bridge',
'mpi',
'network',
'internet',
'core',
'point-to-point',
'applications',
'fd-net-device',
# 'netanim',
#'csma',
#'wifi',
'flow-monitor',
'test',
'point-to-point-layout'
]

# Set this equal to true if you want examples to be run.
examples_enabled = False

# Set this equal to true if you want tests to be run.
tests_enabled = True

The problem is in _check_dependencies (ns3waf/init.py) where I fixed the problem via resetting match_pkg to None:

for ver in ns3_versions:                                                                                                 
             match_pkg = None  

There is a 2nd problem, "mandatory" is set to True for "myscripts/" files and it apparently stops waf when a dependancy is not met, without any explanation. I dunno how to solve that, I mean those should not be built but I don't think they should be mandatory, waf should just warn the user.

thehajime commented 8 years ago

The problem is in check_dependencies (ns3waf/_init.py) where I fixed the problem via resetting match_pkg to None:

this fix should be fine.

for the myscripts case, is this a documentation or error message issue ? I guess if a user want to check the dependencies, he/she can write his own wscript in myscript/abc directory.

teto commented 8 years ago

With my previous fix (i.e. configure correctly detects missing modules) available https://github.com/direct-code-execution/ns-3-dce/pull/29, configure keeps stopping without explanation:

CXX="g++" CXXFLAGS=" -g -Wno-reorder -Wno-unused-variable -std=c++11 " ./waf configure --with-ns3=$HOME/ns3off/install --enable-kernel-stack=$HOME/mptcpoff/arch --prefix=$HOME/dce/build  
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)        : 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 (None)         : not found 
Checking for ns3-netanim (None)            : not found 
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 (None)                      : not found 
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 header sim.h                        : yes 
Checking for ns3-netanim (None)                  : not found 
The configuration failed
(complete log in /home/teto/dce/build/config.log)

I believe DCE should be able to work without ns3-netanim, hence it should be able to keep the configuration going ?

Here is last lines of config.log:

------------------------------------------------
Checking for ns3-netanim (None)
['/usr/bin/pkg-config', 'None', '--cflags', '--libs']
err: Package None was not found in the pkg-config search path.
Perhaps you should add the directory containing `None.pc'
to the PKG_CONFIG_PATH environment variable
No package 'None' found

not found
from /home/teto/dce/myscripts/ccn-exp1: The configuration failed
thehajime commented 8 years ago

I believe DCE should be able to work without ns3-netanim, hence it should be able to keep the configuration going ?

I think that netanim package dependency can be non-mandatory.

tomhenderson commented 6 years ago

I still see this same problem (requirement for 'netanim') in DCE 1.10.

Checking for header sim.h : yes Checking for ns3-netanim (None) : not found The configuration failed

I am not spotting where this dependency is creeping in, unless it is by the inclusion of netanim in many module requirements; e.g. module.add_example(needed = ['core', 'internet', 'dce', 'point-to-point', 'netanim', 'csma'],

(p.s. if I fix the 'netanim' problem by including 'netanim' in my ns-3 build, my configure next fails on missing tap-bridge, so it is not specific to netanim).

or build_a_script():

./myscripts/dce-emu-ping/wscript: bld.build_a_script('dce', needed = ['core', 'internet', 'point-to-point', 'fd-net-device', 'dce', 'netanim' ]

IMO we should fix this and then remove the many netanim dependencies from script requirements as a second step (including 'netanim' pulls in many other modules).