diff --git a/pynamic-pyMPI-2.6a1/Makefile.mpi4py b/pynamic-pyMPI-2.6a1/Makefile.mpi4py index 5acc837..6406f81 100644 --- a/pynamic-pyMPI-2.6a1/Makefile.mpi4py +++ b/pynamic-pyMPI-2.6a1/Makefile.mpi4py @@ -27,7 +27,7 @@ MAKEFILE_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) UTIL_LIBS := $(shell for s in {1..$(NUM_UTILITIES)}; do echo -lutility$$(($$s - 1)); done) MODULE_LIBS := $(shell for s in {1..$(NUM_MODULES)}; do echo -lmodule$$(($$s - 1)); done) -BASE_MODULE_LIBS = -lmodulebegin -lmodulefinal +BASE_MODULE_LIBS += -lmodulebegin -lmodulefinal PYNAMICDIR := $(dir $(abspath $(firstword $(MAKEFILE_LIST)))) diff --git a/pynamic-pyMPI-2.6a1/config_pynamic.py b/pynamic-pyMPI-2.6a1/config_pynamic.py index 0121884..58be843 100755 --- a/pynamic-pyMPI-2.6a1/config_pynamic.py +++ b/pynamic-pyMPI-2.6a1/config_pynamic.py @@ -13,6 +13,7 @@ # from so_generator import print_error, parse_and_run, run_command, print_usage +import sysconfig import sys import os @@ -55,14 +56,43 @@ command = 'make -j ' + str(processes) run_command(command) else: - command = 'make -f Makefile.mpi4py clean' - run_command(command) - - target = 'pynamic-mpi4py' + python = sys.executable + + cfg_vars = sysconfig.get_config_vars() + cflags = cfg_vars.get('CFLAGS') + ldflags = '{} -L{}'.format(cfg_vars.get('LDFLAGS', ''), cfg_vars.get('LIBDIR')) + embed = cfg_vars.get('EMBED') + libs = '-lpython{} {}'.format(cfg_vars.get('LDVERSION'), cfg_vars.get('LIBS', '')) + + cc = None + for arg in configure_args: + if 'with-cc' in arg and '=' in arg: + _, cc = arg.split('=', 1) + if 'with-python' in arg: + print("Run this with intended python") + sys.exit(1) + if 'with-includes' in arg: + if '=' in arg: + cflags = '{} {}'.format(cflags, arg.split('=',1)[1]) + + command = ['make', '-f', 'Makefile.mpi4py', 'clean'] + run_command(' '.join(command)) + + command = ['make', '-f', 'Makefile.mpi4py', '-j', str(processes)] + for flag_name, flag_val in ( + ('CC', cc), + ('PYTHON_CFLAGS', cflags), + ('PYTHON_LDFLAGS', ldflags), + ('PYTHON_EMBED', embed), + ('PYTHON_EXE', python)): + if flag_val is not None: + command.append('{}="{}"'.format(flag_name, flag_val)) + command.append('BASE_MODULE_LIBS="{}"'.format(libs)) + targets = ['pynamic-mpi4py'] if bigexe: - target += ' pynamic-bigexe-mpi4py' - command = 'make -j ' + str(processes) + ' -f Makefile.mpi4py ' + target - run_command(command) + targets.append(' pynamic-bigexe-mpi4py') + command.extend(targets) + run_command(' '.join(command)) if bigexe == False: command = 'rm -f pynamic-bigexe-pyMPI pynamic-bigexe-sdb-pyMPI pynamic-bigexe-mpi4py' diff --git a/pynamic-pyMPI-2.6a1/get-symtab-sizes b/pynamic-pyMPI-2.6a1/get-symtab-sizes index 51a5393..99d7f61 100755 --- a/pynamic-pyMPI-2.6a1/get-symtab-sizes +++ b/pynamic-pyMPI-2.6a1/get-symtab-sizes @@ -39,9 +39,9 @@ for sh in $sharedlib; do ls -l $sh | gawk '{ print "Image size: "$5}' | tee -a 00imagesize size -f $sh | gawk '{if ($1 ~ /[0-9]+/) print "Text size: "$1}' | tee -a 00textsize size -f $sh | gawk '{if ($2 ~ /[0-9]+/) print "Data size: "$2}' | tee -a 00datasize - readelf -S -W $sh | gawk '{if ($2 ~ /\.debug/ ) print $6}' | addall "debug section" 16 | tee -a 00debugsectsize - readelf -S -W $sh | gawk '{if ($2 ~ /\.symtab/ ) print $6}' | addall "symbol table" 16 | tee -a 00symtabsize - readelf -S -W $sh | gawk '{if ($2 ~ /\.strtab/ ) print $6}' | addall "string table" 16 | tee -a 00strtabsize + readelf -S -W $sh | gawk '{if ($2 ~ /\.debug/ ) print $6}' | ./addall "debug section" 16 | tee -a 00debugsectsize + readelf -S -W $sh | gawk '{if ($2 ~ /\.symtab/ ) print $6}' | ./addall "symbol table" 16 | tee -a 00symtabsize + readelf -S -W $sh | gawk '{if ($2 ~ /\.strtab/ ) print $6}' | ./addall "string table" 16 | tee -a 00strtabsize fi done