From 11f5a39c2069977d7bf285975a5d98c8c94ac056 Mon Sep 17 00:00:00 2001 From: Christoph Sommer Date: Mon, 6 Dec 2021 19:38:47 +0100 Subject: [PATCH] Upgrade to Veins 5.2, INET 4.2.2, INET 3.7.1, fix Simu5G at 1.1.0, follow rename of Plexe --- README.md | 4 +- cookiecutter.json | 2 +- hooks/post_gen_project.py | 15 +- .../Makefile | 8 +- .../configure | 4 +- .../.project | 4 +- .../README.md | 2 +- .../configure | 144 +++++++++++------- ...tter.project_name_as_file_name}}_run.in.py | 21 ++- ...cookiecutter.project_name_as_file_name}}.h | 4 +- 10 files changed, 129 insertions(+), 79 deletions(-) diff --git a/README.md b/README.md index d3367ae..7d11a67 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ Select use_veins_vlc: 1 - no 2 - yes Choose from 1, 2 (1, 2) [1]: -Select use_plexe_veins: +Select use_plexe: 1 - no 2 - yes Choose from 1, 2 (1, 2) [1]: @@ -53,7 +53,7 @@ Cookiecutter checks successful. Cookiecutter successful. Running git commands to set up repository. [...] From https://github.com/sommer/veins - * tag veins-5.1 -> FETCH_HEAD + * tag veins-5.2 -> FETCH_HEAD Added dir 'veins' Repository set up successful. Running git commands to clean up. Cookiecutter successful. diff --git a/cookiecutter.json b/cookiecutter.json index ca2fe15..340bcbd 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -6,7 +6,7 @@ "use_inet": ["no", "yes"], "use_inet3": ["no", "yes"], "use_veins_vlc": ["no", "yes"], - "use_plexe_veins": ["no", "yes"], + "use_plexe": ["no", "yes"], "use_simulte": ["no", "yes"], "use_simu5g": ["no", "yes"], "_dummy": "" diff --git a/hooks/post_gen_project.py b/hooks/post_gen_project.py index 6bb4daa..aab3212 100644 --- a/hooks/post_gen_project.py +++ b/hooks/post_gen_project.py @@ -31,7 +31,7 @@ # INET {%- if cookiecutter.use_inet == "yes" %} -subprocess.check_call(['git', 'subtree', 'add', '--prefix=inet', '--message', 'Merge INET 4.2.1', 'https://github.com/inet-framework/inet', 'v4.2.1']) +subprocess.check_call(['git', 'subtree', 'add', '--prefix=inet', '--message', 'Merge INET 4.2.2', 'https://github.com/inet-framework/inet', 'v4.2.2']) #subprocess.check_call(['git', 'rm', 'inet/.gitmodules', 'inet/showcases', 'inet/tutorials']) #subprocess.check_call(['git', 'commit', '--message', 'inet: remove submodules (showcases and tutorials)']) #subprocess.check_call(['git', 'subtree', 'add', '--squash', '--prefix=inet/tutorials', '--message', 'Merge INET Tutorials 4.0.0', 'https://github.com/inet-framework/inet-tutorials', 'v4.0.0']) @@ -40,7 +40,7 @@ # INET (version 3) {%- if cookiecutter.use_inet3 == "yes" %} -subprocess.check_call(['git', 'subtree', 'add', '--prefix=inet', '--message', 'Merge INET 3.6.8', 'https://github.com/inet-framework/inet', 'v3.6.8']) +subprocess.check_call(['git', 'subtree', 'add', '--prefix=inet', '--message', 'Merge INET 3.7.1', 'https://github.com/inet-framework/inet', 'v3.7.1']) subprocess.check_call(['git', 'rm', 'inet/.gitmodules', 'inet/showcases', 'inet/tutorials']) subprocess.check_call(['git', 'commit', '--message', 'inet: remove submodules (showcases and tutorials)']) #subprocess.check_call(['git', 'subtree', 'add', '--squash', '--prefix=inet/tutorials', '--message', 'Merge INET Tutorials 3.6.4', 'https://github.com/inet-framework/inet-tutorials', 'v3.6.4']) @@ -52,9 +52,9 @@ subprocess.check_call(['git', 'subtree', 'add', '--prefix=veins_vlc', '--message', 'Merge Veins VLC 1.0', 'https://github.com/veins/veins_vlc', 'veins-vlc-1.0']) {%- endif %} -# Plexe Veins -{%- if cookiecutter.use_plexe_veins == "yes" %} -subprocess.check_call(['git', 'subtree', 'add', '--prefix=plexe_veins', '--message', 'Merge Plexe Veins 3.0', 'https://github.com/michele-segata/plexe-veins', 'plexe-3.0']) +# Plexe +{%- if cookiecutter.use_plexe == "yes" %} +subprocess.check_call(['git', 'subtree', 'add', '--prefix=plexe', '--message', 'Merge Plexe 3.0', 'https://github.com/michele-segata/plexe', 'plexe-3.0']) {%- endif %} # SimuLTE @@ -70,12 +70,11 @@ # Simu5G {%- if cookiecutter.use_simu5g == "yes" %} -subprocess.check_call(['git', 'subtree', 'add', '--prefix=simu5g', '--message', 'Merge Simu5G Master', 'https://github.com/Unipisa/Simu5G.git', 'master']) - +subprocess.check_call(['git', 'subtree', 'add', '--prefix=simu5g', '--message', 'Merge Simu5G Master', 'https://github.com/Unipisa/Simu5G.git', 'v1.1.0']) {%- endif %} # Veins -subprocess.check_call(['git', 'subtree', 'add', '--prefix=veins', '--message', 'Merge Veins 5.1', 'https://github.com/sommer/veins', 'veins-5.1']) +subprocess.check_call(['git', 'subtree', 'add', '--prefix=veins', '--message', 'Merge Veins 5.2', 'https://github.com/sommer/veins', 'veins-5.2']) # Cookiecutter project subprocess.check_call(['git', 'add', '.']) diff --git a/{{cookiecutter.project_name_as_file_name}}/Makefile b/{{cookiecutter.project_name_as_file_name}}/Makefile index ef2400d..3fa1ee2 100644 --- a/{{cookiecutter.project_name_as_file_name}}/Makefile +++ b/{{cookiecutter.project_name_as_file_name}}/Makefile @@ -46,8 +46,8 @@ endif {%- if cookiecutter.use_veins_vlc == "yes" %} $(MAKE) -C veins_vlc all {%- endif %} -{%- if cookiecutter.use_plexe_veins == "yes" %} - $(MAKE) -C plexe_veins all +{%- if cookiecutter.use_plexe == "yes" %} + $(MAKE) -C plexe all {%- endif %} {%- if cookiecutter.use_simu5g == "yes" %} ifdef MODE @@ -80,8 +80,8 @@ clean: {%- if cookiecutter.use_veins_vlc == "yes" %} $(MAKE) -C veins_vlc clean {%- endif %} -{%- if cookiecutter.use_plexe_veins == "yes" %} - $(MAKE) -C plexe_veins clean +{%- if cookiecutter.use_plexe == "yes" %} + $(MAKE) -C plexe clean {%- endif %} {%- if cookiecutter.use_simu5g == "yes" %} $(MAKE) -C simu5g clean diff --git a/{{cookiecutter.project_name_as_file_name}}/configure b/{{cookiecutter.project_name_as_file_name}}/configure index e187a93..9316648 100755 --- a/{{cookiecutter.project_name_as_file_name}}/configure +++ b/{{cookiecutter.project_name_as_file_name}}/configure @@ -36,8 +36,8 @@ set -e {%- if cookiecutter.use_veins_vlc == "yes" %} (cd veins_vlc && ./configure "$@") {%- endif %} -{%- if cookiecutter.use_plexe_veins == "yes" %} -(cd plexe_veins && ./configure --with-veins=../veins "$@") +{%- if cookiecutter.use_plexe == "yes" %} +(cd plexe && ./configure --with-veins=../veins "$@") {%- endif %} {%- if cookiecutter.use_simulte == "yes" %} (cd simulte && make makefiles) diff --git a/{{cookiecutter.project_name_as_file_name}}/{{cookiecutter.project_name_as_file_name}}/.project b/{{cookiecutter.project_name_as_file_name}}/{{cookiecutter.project_name_as_file_name}}/.project index b1c75a6..a78060c 100644 --- a/{{cookiecutter.project_name_as_file_name}}/{{cookiecutter.project_name_as_file_name}}/.project +++ b/{{cookiecutter.project_name_as_file_name}}/{{cookiecutter.project_name_as_file_name}}/.project @@ -15,8 +15,8 @@ {%- if cookiecutter.use_veins_vlc == "yes" %} veins-vlc {%- endif %} -{%- if cookiecutter.use_plexe_veins == "yes" %} - plexe-veins +{%- if cookiecutter.use_plexe == "yes" %} + plexe {%- endif %} {%- if cookiecutter.use_simu5g == "yes" %} simu5G diff --git a/{{cookiecutter.project_name_as_file_name}}/{{cookiecutter.project_name_as_file_name}}/README.md b/{{cookiecutter.project_name_as_file_name}}/{{cookiecutter.project_name_as_file_name}}/README.md index 7abaacd..5062634 100644 --- a/{{cookiecutter.project_name_as_file_name}}/{{cookiecutter.project_name_as_file_name}}/README.md +++ b/{{cookiecutter.project_name_as_file_name}}/{{cookiecutter.project_name_as_file_name}}/README.md @@ -4,7 +4,7 @@ ## Supported program versions ## -- Veins 5.1 (see ) +- Veins 5.2 (see ) - OMNeT++ 5.6.2 (see ) ## License ## diff --git a/{{cookiecutter.project_name_as_file_name}}/{{cookiecutter.project_name_as_file_name}}/configure b/{{cookiecutter.project_name_as_file_name}}/{{cookiecutter.project_name_as_file_name}}/configure index 3a8a7fc..ae7b7ad 100755 --- a/{{cookiecutter.project_name_as_file_name}}/{{cookiecutter.project_name_as_file_name}}/configure +++ b/{{cookiecutter.project_name_as_file_name}}/{{cookiecutter.project_name_as_file_name}}/configure @@ -55,8 +55,8 @@ parser.add_option("--with-veins", dest="veins", help="link with a version of Vei {%- if cookiecutter.use_veins_vlc == "yes" %} parser.add_option("--with-veins-vlc", dest="veins_vlc", help="link with a version of Veins VLC installed in PATH", metavar="PATH", default="../veins_vlc") {%- endif %} -{%- if cookiecutter.use_plexe_veins == "yes" %} -parser.add_option("--with-plexe-veins", dest="plexe_veins", help="link with a version of Plexe Veins installed in PATH", metavar="PATH", default="../plexe_veins") +{%- if cookiecutter.use_plexe == "yes" %} +parser.add_option("--with-plexe", dest="plexe", help="link with a version of Plexe installed in PATH", metavar="PATH", default="../plexe") {%- endif %} {%- if cookiecutter.use_simulte == "yes" %} parser.add_option("--with-simulte", dest="simulte", help="link with a version of SimuLTE installed in PATH", metavar="PATH", default="../simulte") @@ -86,13 +86,14 @@ if args: makemake_flags = ['-f', '--deep', '--no-deep-includes', '--make-so', '-I', '.', '-o', '{{ cookiecutter.project_name_as_file_name }}', '-O', 'out'] run_libs = [os.path.join('src', '{{ cookiecutter.project_name_as_file_name }}')] run_neds = [os.path.join('src', '{{ cookiecutter.project_name_as_file_name }}')] +run_excs = [] run_imgs = [os.path.join('images')] # Add flags for Veins if options.veins: fname = os.path.join(options.veins, 'print-veins-version') - expect_version = [b'5.1'] + expect_version = [b'5.2'] try: info('Running "%s" to determine Veins version.' % fname) version = subprocess.check_output(['env', fname]).strip() @@ -122,22 +123,38 @@ if options.veins: # Add flags for INET if options.inet: - fname = os.path.join(options.inet, '_scripts/get_version') - expect_version = [b'4.2.0', b'4.2.1'] + expect_version = [b'4.2.0', b'4.2.1', b'4.2.2', b'4.2.3', b'4.2.4', b'4.2.5', b'4.2.8', b'4.3.0', b'4.3.1', b'4.3.2', b'4.3.5'] try: - info('Running "%s" to determine INET version.' % fname) - version = subprocess.check_output(['env', fname]).strip() - if not version in expect_version: - warning('') - warning('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!') - warning('Unsupported INET Version. Expecting %s, found %s' % (versions_to_hr(expect_version), version_to_hr(version))) - warning('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!') - warning('') - else: - info('Found INET version %s. Okay.' % version_to_hr(version)) - except subprocess.CalledProcessError as e: - error('Could not determine INET Version (by running %s): %s. Check the path to INET (--with-inet=... option) and the INET version (should be version %s)' % (fname, e, versions_to_hr(expect_version))) - sys.exit(1) + fname1 = os.path.join(options.inet, 'Version') + info('Reading "%s" to determine INET version.' % fname1) + f = open(fname1, 'rb') + s = f.readline() + s = s.strip() + s = s.split(b'-', 3) + assert s[0] == b'inet', 'Version string does not start with "inet"' + version = s[1] + f.close() + except (AssertionError, EnvironmentError) as e1: + try: + fname2 = os.path.join(options.inet, '_scripts/get_version') + info('Running "%s" to determine INET version.' % fname2) + version = subprocess.check_output(['env', fname2], stderr=subprocess.STDOUT).strip() + except subprocess.CalledProcessError as e2: + try: + fname3 = os.path.join(options.inet, 'bin/inet_version') + info('Running "%s" to determine INET version.' % fname3) + version = subprocess.check_output(['env', fname3], stderr=subprocess.STDOUT).strip() + except subprocess.CalledProcessError as e3: + error('Could not determine INET Version; neither by reading %s (%s), nor by running %s (%s), nor by running %s (%s). Check the path to INET (--with-inet=... option) and the INET version (should be version %s)' % (fname1, e1, fname2, e2, fname3, e3, versions_to_hr(expect_version))) + sys.exit(1) + if not version in expect_version: + warning('') + warning('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!') + warning('Unsupported INET Version. Expecting %s, found %s' % (versions_to_hr(expect_version), version_to_hr(version))) + warning('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!') + warning('') + else: + info('Found INET version %s. Okay.' % version_to_hr(version)) inet_header_dirs = [os.path.join(os.path.relpath(options.inet, 'src'), 'src')] inet_includes = ['-I' + s for s in inet_header_dirs] @@ -147,13 +164,15 @@ if options.inet: makemake_flags += inet_includes + inet_link + inet_defs run_libs = [os.path.relpath(os.path.join(options.inet, 'src', 'INET'))] + run_libs run_neds = [os.path.relpath(os.path.join(options.inet, 'src'))] + run_neds + if not version in [b'4.2.0', b'4.2.1', b'4.2.2', b'4.2.3', b'4.2.4']: + run_excs = [os.path.relpath(os.path.join(options.inet, '.nedexclusions'))] + run_excs run_imgs = [os.path.relpath(os.path.join(options.inet, 'images'))] + run_imgs # Add flags for Veins_INET if options.veins_inet: fname = os.path.join(options.veins_inet, 'print-veins_inet-version') - expect_version = [b'4.0'] + expect_version = [b'5.2'] try: info('Running "%s" to determine Veins_INET version.' % fname) version = subprocess.check_output(['env', fname]).strip() @@ -184,22 +203,38 @@ if options.veins_inet: # Add flags for INET (version 3) if options.inet3: - fname = os.path.join(options.inet3, '_scripts/get_version') - expect_version = [b'3.6.5', b'3.6.6', b'3.6.7', b'3.6.8'] + expect_version = [b'3.6.5', b'3.6.6', b'3.6.7', b'3.6.8', b'3.7.0', b'3.7.1', b'3.8.1'] try: - info('Running "%s" to determine INET version.' % fname) - version = subprocess.check_output(['env', fname]).strip() - if not version in expect_version: - warning('') - warning('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!') - warning('Unsupported INET Version. Expecting %s, found %s' % (versions_to_hr(expect_version), version_to_hr(version))) - warning('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!') - warning('') - else: - info('Found INET version %s. Okay.' % version_to_hr(version)) - except subprocess.CalledProcessError as e: - error('Could not determine INET Version (by running %s): %s. Check the path to INET (--with-inet3=... option) and the INET version (should be version %s)' % (fname, e, versions_to_hr(expect_version))) - sys.exit(1) + fname1 = os.path.join(options.inet, 'Version') + info('Reading "%s" to determine INET version.' % fname1) + f = open(fname1, 'rb') + s = f.readline() + s = s.strip() + s = s.split(b'-', 3) + assert s[0] == b'inet', 'Version string does not start with "inet"' + version = s[1] + f.close() + except (AssertionError, EnvironmentError) as e1: + try: + fname2 = os.path.join(options.inet, '_scripts/get_version') + info('Running "%s" to determine INET version.' % fname2) + version = subprocess.check_output(['env', fname2], stderr=subprocess.STDOUT).strip() + except subprocess.CalledProcessError as e2: + try: + fname3 = os.path.join(options.inet, 'bin/inet_version') + info('Running "%s" to determine INET version.' % fname3) + version = subprocess.check_output(['env', fname3], stderr=subprocess.STDOUT).strip() + except subprocess.CalledProcessError as e3: + error('Could not determine INET Version; neither by reading %s (%s), nor by running %s (%s), nor by running %s (%s). Check the path to INET (--with-inet=... option) and the INET version (should be version %s)' % (fname1, e1, fname2, e2, fname3, e3, versions_to_hr(expect_version))) + sys.exit(1) + if not version in expect_version: + warning('') + warning('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!') + warning('Unsupported INET Version. Expecting %s, found %s' % (versions_to_hr(expect_version), version_to_hr(version))) + warning('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!') + warning('') + else: + info('Found INET version %s. Okay.' % version_to_hr(version)) inet3_header_dirs = [os.path.join(os.path.relpath(options.inet3, 'src'), 'src')] inet3_includes = ['-I' + s for s in inet3_header_dirs] @@ -215,7 +250,7 @@ if options.inet3: # Add flags for Veins_INET if options.veins_inet3: fname = os.path.join(options.veins_inet3, 'print-veins_inet-version') - expect_version = [b'3.0'] + expect_version = [b'5.2'] try: info('Running "%s" to determine Veins_INET version.' % fname) version = subprocess.check_output(['env', fname]).strip() @@ -273,37 +308,37 @@ if options.veins_vlc: run_neds = [os.path.relpath(os.path.join(options.veins_vlc, 'src', 'veins-vlc'))] + run_neds run_imgs = [os.path.relpath(os.path.join(options.veins_vlc, 'images'))] + run_imgs {%- endif %} -{%- if cookiecutter.use_plexe_veins == "yes" %} +{%- if cookiecutter.use_plexe == "yes" %} -# Add flags for Plexe Veins -if options.plexe_veins: - fname = os.path.join(options.plexe_veins, 'src', 'plexe', 'plexe.h') - expect_version = [b'3.0-alpha1'] +# Add flags for Plexe +if options.plexe: + fname = os.path.join(options.plexe, 'print-plexe-version') + expect_version = [b'3.0'] try: - info('Running "%s" to determine Plexe Veins version.' % fname) - version = subprocess.check_output(['env', 'cat', fname]).strip() - if not version: + info('Running "%s" to determine Plexe version.' % fname) + version = subprocess.check_output(['env', fname]).strip() + if not version in expect_version: warning('') warning('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!') - warning('Unsupported Plexe Veins Version. Expecting %s, found %s' % (versions_to_hr(expect_version), version_to_hr(version))) + warning('Unsupported Plexe Version. Expecting %s, found %s' % (versions_to_hr(expect_version), version_to_hr(version))) warning('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!') warning('') else: - info('Found Plexe Veins version %s. Okay.' % version_to_hr(version)) + info('Found Plexe version %s. Okay.' % version_to_hr(version)) except subprocess.CalledProcessError as e: - error('Could not determine Plexe Veins Version (by running %s): %s. Check the path to Plexe Veins (--with-plexe-veins=... option) and the Plexe Veins version (should be version %s)' % (fname, e, versions_to_hr(expect_version))) + error('Could not determine Plexe Version (by running %s): %s. Check the path to Plexe (--with-plexe=... option) and the Plexe version (should be version %s)' % (fname, e, versions_to_hr(expect_version))) sys.exit(1) - plexe_veins_header_dirs = [os.path.join(os.path.relpath(options.plexe_veins, 'src'), 'src')] - plexe_veins_includes = ['-I' + s for s in plexe_veins_header_dirs] - plexe_veins_link = ["-L" + os.path.join(os.path.relpath(options.plexe_veins, 'src'), 'src'), "-lplexe$(D)"] - plexe_veins_defs = [] + plexe_header_dirs = [os.path.join(os.path.relpath(options.plexe, 'src'), 'src')] + plexe_includes = ['-I' + s for s in plexe_header_dirs] + plexe_link = ["-L" + os.path.join(os.path.relpath(options.plexe, 'src'), 'src'), "-lplexe$(D)"] + plexe_defs = [] - makemake_flags += plexe_veins_includes + plexe_veins_link + plexe_veins_defs - run_libs = [os.path.relpath(os.path.join(options.plexe_veins, 'src', 'plexe'))] + run_libs - run_neds = [os.path.relpath(os.path.join(options.plexe_veins, 'src', 'plexe'))] + run_neds - run_imgs = [os.path.relpath(os.path.join(options.plexe_veins, 'images'))] + run_imgs + makemake_flags += plexe_includes + plexe_link + plexe_defs + run_libs = [os.path.relpath(os.path.join(options.plexe, 'src', 'plexe'))] + run_libs + run_neds = [os.path.relpath(os.path.join(options.plexe, 'src', 'plexe'))] + run_neds + run_imgs = [os.path.relpath(os.path.join(options.plexe, 'images'))] + run_imgs {%- endif %} {%- if cookiecutter.use_simulte == "yes" %} @@ -362,6 +397,7 @@ if not os.path.isdir('out'): f = open(os.path.join('out', 'config.py'), 'w') f.write('run_libs = %s\n' % repr(run_libs)) f.write('run_neds = %s\n' % repr(run_neds)) +f.write('run_excs = %s\n' % repr(run_excs)) f.write('run_imgs = %s\n' % repr(run_imgs)) f.close() diff --git a/{{cookiecutter.project_name_as_file_name}}/{{cookiecutter.project_name_as_file_name}}/src/scripts/{{cookiecutter.project_name_as_file_name}}_run.in.py b/{{cookiecutter.project_name_as_file_name}}/{{cookiecutter.project_name_as_file_name}}/src/scripts/{{cookiecutter.project_name_as_file_name}}_run.in.py index ef1a560..d564b86 100644 --- a/{{cookiecutter.project_name_as_file_name}}/{{cookiecutter.project_name_as_file_name}}/src/scripts/{{cookiecutter.project_name_as_file_name}}_run.in.py +++ b/{{cookiecutter.project_name_as_file_name}}/{{cookiecutter.project_name_as_file_name}}/src/scripts/{{cookiecutter.project_name_as_file_name}}_run.in.py @@ -50,8 +50,15 @@ def relpath(s): run_libs = [relpath(s) for s in run_libs] run_neds = [relpath(s) for s in run_neds] + ['.'] +run_excs = [relpath(s) for s in run_excs] run_imgs = [relpath(s) for s in run_imgs] +run_excs_lines = [] +for run_exc in run_excs: + if os.path.isfile(run_exc): + with open(run_exc, 'r') as f: + run_excs_lines += [line.strip() for line in f] + opp_run = 'opp_run' if args.debug: args.mode = 'debug' @@ -67,9 +74,15 @@ def relpath(s): else: assert False, 'unknown --mode option' -lib_flags = ['-l%s' % s for s in run_libs] -ned_flags = ['-n' + ';'.join(run_neds)] -img_flags = ['--image-path=' + ';'.join(run_imgs)] +lib_flags = [] +if run_libs: + lib_flags += ['-l%s' % s for s in run_libs] +ned_flags = [] +if run_neds: + ned_flags += ['-n' + ';'.join(run_neds)] +img_flags = [] +if run_imgs: + img_flags += ['--image-path=' + ';'.join(run_imgs)] prefix = [] if args.tool == 'lldb': @@ -86,6 +99,8 @@ def relpath(s): if args.verbose: print("Running with command line arguments: %s" % ' '.join(['"%s"' % arg for arg in cmdline])) +os.environ['OMNETPP_NED_PACKAGE_EXCLUSIONS'] = ';'.join(list(filter(None, os.getenv('OMNETPP_NED_PACKAGE_EXCLUSIONS', '').split(';'))) + run_excs_lines) + if os.name == 'nt': subprocess.call(['env'] + cmdline) else: diff --git a/{{cookiecutter.project_name_as_file_name}}/{{cookiecutter.project_name_as_file_name}}/src/{{cookiecutter.project_name_as_file_name}}/{{cookiecutter.project_name_as_file_name}}.h b/{{cookiecutter.project_name_as_file_name}}/{{cookiecutter.project_name_as_file_name}}/src/{{cookiecutter.project_name_as_file_name}}/{{cookiecutter.project_name_as_file_name}}.h index 8c372f4..c9ae121 100644 --- a/{{cookiecutter.project_name_as_file_name}}/{{cookiecutter.project_name_as_file_name}}/src/{{cookiecutter.project_name_as_file_name}}/{{cookiecutter.project_name_as_file_name}}.h +++ b/{{cookiecutter.project_name_as_file_name}}/{{cookiecutter.project_name_as_file_name}}/src/{{cookiecutter.project_name_as_file_name}}/{{cookiecutter.project_name_as_file_name}}.h @@ -31,8 +31,8 @@ #define {{ cookiecutter.project_name_as_macro_name }}_VERSION_ALPHA 0 // Explicitly check Veins version number -#if !(VEINS_VERSION_MAJOR == 5 && VEINS_VERSION_MINOR >= 1) -#error Veins version 5.1 or compatible required +#if !(VEINS_VERSION_MAJOR == 5 && VEINS_VERSION_MINOR >= 2) +#error Veins version 5.2 or compatible required #endif // {{ cookiecutter.project_name_as_macro_name }}_API macro. Allows us to use the same .h files for both building a .dll and linking against it