diff options
author | Travis Oliphant <oliphant@enthought.com> | 2004-03-04 22:44:06 +0000 |
---|---|---|
committer | Travis Oliphant <oliphant@enthought.com> | 2004-03-04 22:44:06 +0000 |
commit | fa4054de4e5f73ace598a555a194a3ffe35e923b (patch) | |
tree | 7f6a4fcd4dc4350b4d31e934c90ae508b54d72fc /scipy_distutils/ccompiler.py | |
parent | 301b2cdf4516bf1bd3dc607a7a9cfba0dcdbc625 (diff) | |
download | numpy-fa4054de4e5f73ace598a555a194a3ffe35e923b.tar.gz |
Fixed compiler so that Fortran files are built in order specified in sources list
Diffstat (limited to 'scipy_distutils/ccompiler.py')
-rw-r--r-- | scipy_distutils/ccompiler.py | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/scipy_distutils/ccompiler.py b/scipy_distutils/ccompiler.py index ea2a0dbd6..3fdc00922 100644 --- a/scipy_distutils/ccompiler.py +++ b/scipy_distutils/ccompiler.py @@ -20,6 +20,8 @@ def CCompiler_spawn(self, cmd, display=None): if type(display) is type([]): display = ' '.join(display) log.info(display) s,o = exec_command(cmd) + print s + print o if s: if type(cmd) is type([]): cmd = ' '.join(cmd) @@ -56,8 +58,22 @@ def CCompiler_compile(self, sources, output_dir=None, macros=None, if extra_postargs: display += "\nextra options: '%s'" % (' '.join(extra_postargs)) log.info(display) - for obj, (src, ext) in build.items(): - self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts) + + # build any sources in same order as they were originally specified + # especially important for fortran .f90 files using modules + if isinstance(self, FCompiler): + from distutils.sysconfig import python_build + objects = self.object_filenames(sources, + strip_dir=python_build, + output_dir=output_dir) + objects_to_build = build.keys() + for obj in objects: + if obj in objects_to_build: + src, ext = build[obj] + self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts) + else: + for obj, (src, ext) in build.items(): + self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts) # Return *all* object filenames, not just the ones we just built. return objects |