summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPearu Peterson <pearu.peterson@gmail.com>2004-02-26 10:22:51 +0000
committerPearu Peterson <pearu.peterson@gmail.com>2004-02-26 10:22:51 +0000
commit91cff85dbd02c76e6f99457691cb7d1b12c3483e (patch)
tree8eadd1730b7aa37af74db75a7b1e0f55bbd29abf
parent45c0b1e7f0cf7a08758d037d572b2330303f3f05 (diff)
downloadnumpy-91cff85dbd02c76e6f99457691cb7d1b12c3483e.tar.gz
Added flavor info to fortran compilation message.
-rw-r--r--scipy_distutils/ccompiler.py2
-rw-r--r--scipy_distutils/command/build_clib.py17
-rw-r--r--scipy_distutils/command/build_ext.py52
-rw-r--r--scipy_distutils/fcompiler.py6
4 files changed, 47 insertions, 30 deletions
diff --git a/scipy_distutils/ccompiler.py b/scipy_distutils/ccompiler.py
index fcd6f3c1c..ea2a0dbd6 100644
--- a/scipy_distutils/ccompiler.py
+++ b/scipy_distutils/ccompiler.py
@@ -54,7 +54,7 @@ def CCompiler_compile(self, sources, output_dir=None, macros=None,
cc_args = self._get_cc_args(pp_opts, debug, extra_preargs)
display = "compile options: '%s'" % (' '.join(cc_args))
if extra_postargs:
- display += "extra: '%s'" % (' '.join(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)
diff --git a/scipy_distutils/command/build_clib.py b/scipy_distutils/command/build_clib.py
index fa1eeac05..1f227c5ca 100644
--- a/scipy_distutils/command/build_clib.py
+++ b/scipy_distutils/command/build_clib.py
@@ -175,14 +175,18 @@ class build_clib(old_build_clib):
print 'XXX: Fortran 90 module support not implemented or tested'
f_sources.extend(fmodule_sources)
- objects = compiler.compile(c_sources,
- output_dir=self.build_temp,
- macros=macros,
- include_dirs=include_dirs,
- debug=self.debug,
- extra_postargs=extra_postargs)
+ objects = []
+ if c_sources:
+ log.info("compling C sources")
+ objects = compiler.compile(c_sources,
+ output_dir=self.build_temp,
+ macros=macros,
+ include_dirs=include_dirs,
+ debug=self.debug,
+ extra_postargs=extra_postargs)
if cxx_sources:
+ log.info("compling C++ sources")
old_compiler = self.compiler.compiler_so[0]
self.compiler.compiler_so[0] = self.compiler.compiler_cxx[0]
@@ -197,6 +201,7 @@ class build_clib(old_build_clib):
self.compiler.compiler_so[0] = old_compiler
if f_sources:
+ log.info("compling Fortran sources")
f_objects = fcompiler.compile(f_sources,
output_dir=self.build_temp,
macros=macros,
diff --git a/scipy_distutils/command/build_ext.py b/scipy_distutils/command/build_ext.py
index c501957c5..0efe755d8 100644
--- a/scipy_distutils/command/build_ext.py
+++ b/scipy_distutils/command/build_ext.py
@@ -150,14 +150,19 @@ class build_ext (old_build_ext):
else:
kws = {}
- c_objects = self.compiler.compile(c_sources,
- output_dir=self.build_temp,
- macros=macros,
- include_dirs=ext.include_dirs,
- debug=self.debug,
- extra_postargs=extra_args,
- **kws)
+ c_objects = []
+ if c_sources:
+ log.info("compling C sources")
+ c_objects = self.compiler.compile(c_sources,
+ output_dir=self.build_temp,
+ macros=macros,
+ include_dirs=ext.include_dirs,
+ debug=self.debug,
+ extra_postargs=extra_args,
+ **kws)
if cxx_sources:
+ log.info("compling C++ sources")
+
old_compiler = self.compiler.compiler_so[0]
self.compiler.compiler_so[0] = self.compiler.compiler_cxx[0]
@@ -188,13 +193,16 @@ class build_ext (old_build_ext):
extra_postargs += self.fcompiler.module_options(\
module_dirs,module_build_dir)
- f_objects = self.fcompiler.compile(fmodule_sources,
- output_dir=self.build_temp,
- macros=macros,
- include_dirs=include_dirs,
- debug=self.debug,
- extra_postargs=extra_postargs,
- depends=ext.depends)
+ f_objects = []
+ if fmodule_sources:
+ log.info("compling Fortran 90 module sources")
+ f_objects = self.fcompiler.compile(fmodule_sources,
+ output_dir=self.build_temp,
+ macros=macros,
+ include_dirs=include_dirs,
+ debug=self.debug,
+ extra_postargs=extra_postargs,
+ depends=ext.depends)
if check_for_f90_modules \
and self.fcompiler.module_dir_switch is None:
@@ -203,13 +211,15 @@ class build_ext (old_build_ext):
continue
self.move_file(f, module_build_dir)
- f_objects += self.fcompiler.compile(f_sources,
- output_dir=self.build_temp,
- macros=macros,
- include_dirs=include_dirs,
- debug=self.debug,
- extra_postargs=extra_postargs,
- depends=ext.depends)
+ if f_sources:
+ log.info("compling Fortran sources")
+ f_objects += self.fcompiler.compile(f_sources,
+ output_dir=self.build_temp,
+ macros=macros,
+ include_dirs=include_dirs,
+ debug=self.debug,
+ extra_postargs=extra_postargs,
+ depends=ext.depends)
else:
f_objects = []
diff --git a/scipy_distutils/fcompiler.py b/scipy_distutils/fcompiler.py
index e922072a4..6d85dab77 100644
--- a/scipy_distutils/fcompiler.py
+++ b/scipy_distutils/fcompiler.py
@@ -416,13 +416,16 @@ class FCompiler(CCompiler):
def _compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts):
"""Compile 'src' to product 'obj'."""
if is_f_file(src):
+ flavor = ':f77'
compiler = self.compiler_f77
elif is_free_format(src):
+ flavor = ':f90'
compiler = self.compiler_f90
if compiler is None:
raise DistutilsExecError, 'f90 not supported by '\
+self.__class__.__name__
else:
+ flavor = ':fix'
compiler = self.compiler_fix
if compiler is None:
raise DistutilsExecError, 'f90 (fixed) not supported by '\
@@ -437,8 +440,7 @@ class FCompiler(CCompiler):
command = compiler + cc_args + s_args + o_args + extra_postargs
- display = '%s: %s' % (os.path.basename(compiler[0]) \
- + (compiler is self.compiler_fix and ':fix' or ''),
+ display = '%s: %s' % (os.path.basename(compiler[0]) + flavor,
src)
try:
self.spawn(command,display=display)