summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPearu Peterson <pearu.peterson@gmail.com>2004-01-31 22:02:30 +0000
committerPearu Peterson <pearu.peterson@gmail.com>2004-01-31 22:02:30 +0000
commit271fc73f95abab3a7962169cb54c1ba1ddba50e1 (patch)
tree1706a106c346be104465e157bc7d55dabb808555
parent85ac6be83d87d902fc1dad3e00752fcd6c7ccd7d (diff)
downloadnumpy-271fc73f95abab3a7962169cb54c1ba1ddba50e1.tar.gz
fcompiler classes
-rw-r--r--scipy_distutils/absoftfcompiler.py5
-rw-r--r--scipy_distutils/compaqfcompiler.py6
-rw-r--r--scipy_distutils/exec_command.py21
-rw-r--r--scipy_distutils/fcompiler.py276
-rw-r--r--scipy_distutils/gnufcompiler.py14
-rw-r--r--scipy_distutils/hpuxfcompiler.py6
-rw-r--r--scipy_distutils/intelfcompiler.py13
-rw-r--r--scipy_distutils/laheyfcompiler.py3
-rw-r--r--scipy_distutils/mipsfcompiler.py5
-rw-r--r--scipy_distutils/pgfcompiler.py6
-rw-r--r--scipy_distutils/sunfcompiler.py7
-rw-r--r--scipy_distutils/vastfcompiler.py2
12 files changed, 279 insertions, 85 deletions
diff --git a/scipy_distutils/absoftfcompiler.py b/scipy_distutils/absoftfcompiler.py
index a79701ec4..efee2dde9 100644
--- a/scipy_distutils/absoftfcompiler.py
+++ b/scipy_distutils/absoftfcompiler.py
@@ -1,5 +1,6 @@
# http://www.absoft.com/literature/osxuserguide.pdf
+# http://www.absoft.com/documentation.html
import os
import sys
@@ -23,6 +24,10 @@ class AbsoftFCompiler(FCompiler):
'ranlib' : ["ranlib"]
}
+ if os.name != 'nt':
+ pic_flags = ['-fpic']
+ module_dir_switch = None
+ module_include_switch = '-p '
def get_library_dirs(self):
opt = FCompiler.get_library_dirs(self)
diff --git a/scipy_distutils/compaqfcompiler.py b/scipy_distutils/compaqfcompiler.py
index c80574a75..d0c029835 100644
--- a/scipy_distutils/compaqfcompiler.py
+++ b/scipy_distutils/compaqfcompiler.py
@@ -27,6 +27,9 @@ class CompaqFCompiler(FCompiler):
'ranlib' : ["ranlib"]
}
+ module_dir_switch = None #XXX Fix me
+ module_include_switch = None #XXX Fix me
+
def get_flags(self):
return ['-assume no2underscore','-nomixed_str_len_arg']
def get_flags_debug(self):
@@ -49,9 +52,12 @@ class CompaqVisualFCompiler(FCompiler):
compile_switch = '/c '
object_switch = '/object:'
+ library_switch = '/OUT:' #No space after /OUT:!
static_lib_extension = ".lib"
static_lib_format = "%s%s"
+ module_dir_switch = None #XXX Fix me
+ module_include_switch = None #XXX Fix me
ar_exe = 'lib.exe'
fc_exe = 'DF'
diff --git a/scipy_distutils/exec_command.py b/scipy_distutils/exec_command.py
index fbc46ca0c..d07627ca0 100644
--- a/scipy_distutils/exec_command.py
+++ b/scipy_distutils/exec_command.py
@@ -244,6 +244,11 @@ def _exec_command_posix( command,
**env ):
log.debug('_exec_command_posix(...)')
+ if type(command) is type([]):
+ command_str = ' '.join(command)
+ else:
+ command_str = command
+
tmpfile = tempfile.mktemp()
if use_tee:
stsfile = tempfile.mktemp()
@@ -251,9 +256,9 @@ def _exec_command_posix( command,
if use_tee == 2:
filter = r'| tr -cd "\n" | tr "\n" "."; echo'
command_posix = '( %s 2>&1 ; echo $? > %s ) | tee %s %s'\
- % (command,stsfile,tmpfile,filter)
+ % (command_str,stsfile,tmpfile,filter)
else:
- command_posix = '%s > %s 2>&1' % (command,tmpfile)
+ command_posix = '%s > %s 2>&1' % (command_str,tmpfile)
log.debug('Running os.system(%r)' % (command_posix))
status = os.system(command_posix)
@@ -330,12 +335,18 @@ def _exec_command( command, use_shell=None, **env ):
# We use shell (unless use_shell==0) so that wildcards can be
# used.
sh = os.environ.get('SHELL','/bin/sh')
- argv = [sh,'-c',command]
+ if type(command) is type([]):
+ argv = [sh,'-c'] + command
+ else:
+ argv = [sh,'-c',command]
else:
# On NT, DOS we avoid using command.com as it's exit status is
# not related to the exit status of a command.
- argv = splitcmdline(command)
-
+ if type(command) is type([]):
+ argv = command[:]
+ else:
+ argv = splitcmdline(command)
+
if hasattr(os,'spawnvpe'):
spawn_command = os.spawnvpe
else:
diff --git a/scipy_distutils/fcompiler.py b/scipy_distutils/fcompiler.py
index 229e22e78..7ad9ab298 100644
--- a/scipy_distutils/fcompiler.py
+++ b/scipy_distutils/fcompiler.py
@@ -8,20 +8,26 @@ for the Scipy_istutils Fortran compiler abstraction model.
import re
import os
import sys
+import atexit
+from types import StringType, NoneType, ListType, TupleType
+from glob import glob
from distutils.version import StrictVersion
-from distutils.ccompiler import CCompiler
+from distutils.ccompiler import CCompiler, gen_lib_options
# distutils.ccompiler provides the following functions:
# gen_preprocess_options(macros, include_dirs)
# gen_lib_options(compiler, library_dirs, runtime_library_dirs, libraries)
-from distutils.errors import DistutilsModuleError,DistutilsArgError
+from distutils.errors import DistutilsModuleError,DistutilsArgError,\
+ DistutilsExecError,CompileError,LinkError,DistutilsPlatformError
from distutils.core import Command
from distutils.util import split_quoted
from distutils.fancy_getopt import FancyGetopt
from distutils.version import LooseVersion
-from distutils import log
from distutils.sysconfig import get_config_var
+from scipy_distutils.command.config_compiler import config_fc
+
+import log
from exec_command import find_executable, exec_command
@@ -127,8 +133,6 @@ class FCompiler(CCompiler):
# mkpath(name, mode=0777)
#
- src_extensions = ['.for','.ftn','.f77','.f','.f90','.f95']
-
language_map = {'.f':'f77',
'.for':'f77',
'.ftn':'f77',
@@ -145,30 +149,37 @@ class FCompiler(CCompiler):
'compiler_f90' : ["f90"],
'compiler_fix' : ["f90","-fixed"],
'linker_so' : ["f90","-shared"],
+ #'linker_exe' : ["f90"], # XXX do we need it??
'archiver' : ["ar","-cr"],
'ranlib' : None,
}
- compile_switch = "-c " # Ending space matters!
- object_switch = "-o " # Ending space matters!
- object_extension = ".o"
- shared_lib_extension = get_config_var('SO')
- static_lib_extension = ".a"
- static_lib_format = "lib%s%s"
- shared_lib_format = "%s%s"
+ compile_switch = "-c"
+ object_switch = "-o " # Ending space matters! It will be stripped
+ # but if it is missing then object_switch
+ # will be prefixed to object file name by
+ # string concatenation.
+ library_switch = "-o " # Ditto!
- def __init__(self,verbose=0,dry_run=0,force=0):
- # Set the following attributes (see ccompiler.py for explanations):
- # output_dir
- # macros
- # include_dirs
- # libraries
- # library_dirs
- # runtime_library_dirs
- # objects
- # and call set_executables.
- CCompiler.__init__(self,verbose,dry_run,force)
+ # Switch to specify where module files are created and searched
+ # for USE statement. Normally it is a string and also here ending
+ # space matters. See above.
+ module_dir_switch = None
+
+ # Switch to specify where module files are searched for USE statement.
+ module_include_switch = '-I'
+
+ pic_flags = [] # Flags to create position-independent code
+
+ src_extensions = ['.for','.ftn','.f77','.f','.f90','.f95']
+ obj_extension = ".o"
+ shared_lib_extension = get_config_var('SO') # or .dll
+ static_lib_extension = ".a" # or .lib
+ static_lib_format = "lib%s%s" # or %s%s
+ shared_lib_format = "%s%s"
+ exe_extension = ""
+ ######################################################################
## Methods that subclasses may redefine. But don't call these methods!
## They are private to FCompiler class and may return unexpected
## results if used elsewhere. So, you have been warned..
@@ -211,7 +222,7 @@ class FCompiler(CCompiler):
def get_flags(self):
""" List of flags common to all compiler types. """
- return []
+ return [] + self.pic_flags
def get_flags_version(self):
""" List of compiler flags to print out version information. """
if self.executables['version_cmd']:
@@ -310,8 +321,8 @@ class FCompiler(CCompiler):
noarch = conf.get('noarch',[None,noopt])[1]
debug = conf.get('debug',[None,0])[1]
- f77 = self.__get_cmd('compiler_f77','F77',(conf,'f77_exec'))
- f90 = self.__get_cmd('compiler_f90','F90',(conf,'f90_exec'))
+ f77 = self.__get_cmd('compiler_f77','F77',(conf,'f77exec'))
+ f90 = self.__get_cmd('compiler_f90','F90',(conf,'f90exec'))
# Temporarily setting f77,f90 compilers so that
# version_cmd can use their executables.
if f77:
@@ -334,7 +345,7 @@ class FCompiler(CCompiler):
(conf,'f90flags'))
# XXX Assuming that free format is default for f90 compiler.
- fix = self.__get_cmd('compiler_fix','F90',(conf,'f90_exec'))
+ fix = self.__get_cmd('compiler_fix','F90',(conf,'f90exec'))
if fix:
fixflags = self.__get_flags(self.get_flags_fix) + f90flags
@@ -375,6 +386,7 @@ class FCompiler(CCompiler):
if fix:
self.set_executables(compiler_fix=[fix]+fixflags+fflags)
+ #XXX: Do we need LDSHARED->SOSHARED, LDFLAGS->SOFLAGS
linker_so = self.__get_cmd(self.get_linker_so,'LDSHARED')
if linker_so:
linker_so_flags = self.__get_flags(self.get_flags_linker_so,'LDFLAGS')
@@ -395,7 +407,27 @@ class FCompiler(CCompiler):
verbose = conf.get('verbose',[None,0])[1]
if verbose:
self.dump_properties()
-
+ return
+
+ def customize_cmd(self, cmd):
+ if cmd.include_dirs is not None:
+ self.set_include_dirs(cmd.include_dirs)
+ if cmd.define is not None:
+ for (name,value) in cmd.define:
+ self.define_macro(name, value)
+ if cmd.undef is not None:
+ for macro in cmd.undef:
+ self.undefine_macro(macro)
+ if cmd.libraries is not None:
+ self.set_libraries(self.get_libraries() + cmd.libraries)
+ if cmd.library_dirs is not None:
+ self.set_library_dirs(self.get_library_dirs() + cmd.library_dirs)
+ if cmd.rpath is not None:
+ self.set_runtime_library_dirs(cmd.rpath)
+ if cmd.link_objects is not None:
+ self.set_link_objects(cmd.link_objects)
+ return
+
def dump_properties(self):
""" Print out the attributes of a compiler instance. """
props = []
@@ -413,14 +445,161 @@ class FCompiler(CCompiler):
if l[:4]==' --':
l = ' ' + l[4:]
print l
+ return
def exec_command(self,*args,**kws):
""" Return status,output of a command. """
- log.info('%s.exec_command(*%s,**%s)' % (self.__class__.__name__,args,kws))
+ quiet = kws.get('quiet',1)
+ try: del kws['quiet']
+ except KeyError: pass
+ if not quiet:
+ log.info('%s.exec_command(*%s,**%s)' % (self.__class__.__name__,
+ args,kws))
status, output = exec_command(*args,**kws)
- log.info('*****status:%s\n*****output:\n%s\n*****' % (status,output))
+ if not quiet:
+ log.info('*****status:%s\n*****output:\n%s\n*****' % (status,output))
return status, output
+ ###################
+
+ def _get_cc_args(self, pp_opts, debug, before):
+ #XXX
+ print self.__class__.__name__ + '._get_cc_args:',pp_opts, debug, before
+ return []
+
+ def _compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts):
+ """Compile 'src' to product 'obj'."""
+ print self.__class__.__name__ + '._compile:',obj, src, ext, cc_args, extra_postargs, pp_opts
+
+ if is_f_file(src):
+ compiler = self.compiler_f77
+ elif is_free_format(src):
+ compiler = self.compiler_f90
+ if compiler is None:
+ raise DistutilsExecError, 'f90 not supported by '\
+ +self.__class__.__name__
+ else:
+ compiler = self.compiler_fix
+ if compiler is None:
+ raise DistutilsExecError, 'f90 (fixed) not supported by '\
+ +self.__class__.__name__
+ if self.object_switch[-1]==' ':
+ o_args = [self.object_switch.strip(),obj]
+ else:
+ o_args = [self.object_switch.strip()+obj]
+
+ assert self.compile_switch.strip()
+ s_args = [self.compile_switch, src]
+
+ command = compiler + cc_args + pp_opts + s_args + o_args + extra_postargs
+ log.info(' '.join(command))
+ try:
+ s,o = self.exec_command(command)
+ except DistutilsExecError, msg:
+ raise CompileError, msg
+ if s:
+ raise CompileError, o
+
+ return
+
+ def module_options(self, module_dirs, module_build_dir):
+ options = []
+ if self.module_dir_switch is not None:
+ if self.module_dir_switch[-1]==' ':
+ options.extend([self.module_dir_switch.strip(),module_build_dir])
+ else:
+ options.append(self.module_dir_switch.strip()+module_build_dir)
+ else:
+ print 'XXX: module_build_dir=%r option ignored' % (module_build_dir)
+ print 'XXX: Fix module_dir_switch for ',self.__class__.__name__
+ if self.module_include_switch is not None:
+ for d in [module_build_dir]+module_dirs:
+ options.append('%s%s' % (self.module_include_switch, d))
+ else:
+ print 'XXX: module_dirs=%r option ignored' % (module_dirs)
+ print 'XXX: Fix module_include_switch for ',self.__class__.__name__
+ return options
+
+ def library_option(self, lib):
+ return "-l" + lib
+ def library_dir_option(self, dir):
+ return "-L" + dir
+
+ if sys.version[:3]<'2.3':
+ def compile(self, sources, output_dir=None, macros=None,
+ include_dirs=None, debug=0, extra_preargs=None,
+ extra_postargs=None, depends=None):
+ if output_dir is None: output_dir = self.output_dir
+ if macros is None: macros = self.macros
+ elif type(macros) is ListType: macros = macros + (self.macros or [])
+ if include_dirs is None: include_dirs = self.include_dirs
+ elif type(include_dirs) in (ListType, TupleType):
+ include_dirs = list(include_dirs) + (self.include_dirs or [])
+ if extra_preargs is None: extra_preargs=[]
+ from distutils.sysconfig import python_build
+ objects = self.object_filenames(sources,strip_dir=python_build,
+ output_dir=output_dir)
+ from distutils.ccompiler import gen_preprocess_options
+ pp_opts = gen_preprocess_options(macros, include_dirs)
+ build = {}
+ for i in range(len(sources)):
+ src,obj = sources[i],objects[i]
+ ext = os.path.splitext(src)[1]
+ self.mkpath(os.path.dirname(obj))
+ build[obj] = src, ext
+ cc_args = self._get_cc_args(pp_opts, debug, extra_preargs)
+ for obj, (src, ext) in build.items():
+ self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
+ return objects
+ def detect_language(self, sources):
+ return
+
+ def link(self, target_desc, objects,
+ output_filename, output_dir=None, libraries=None,
+ library_dirs=None, runtime_library_dirs=None,
+ export_symbols=None, debug=0, extra_preargs=None,
+ extra_postargs=None, build_temp=None, target_lang=None):
+ objects, output_dir = self._fix_object_args(objects, output_dir)
+ libraries, library_dirs, runtime_library_dirs = \
+ self._fix_lib_args(libraries, library_dirs, runtime_library_dirs)
+
+ lib_opts = gen_lib_options(self, library_dirs, runtime_library_dirs,
+ libraries)
+ if type(output_dir) not in (StringType, NoneType):
+ raise TypeError, "'output_dir' must be a string or None"
+ if output_dir is not None:
+ output_filename = os.path.join(output_dir, output_filename)
+
+ if self._need_link(objects, output_filename):
+ if self.library_switch[-1]==' ':
+ o_args = [self.library_switch.strip(),output_filename]
+ else:
+ o_args = [self.library_switch.strip()+output_filename]
+ ld_args = (objects + self.objects +
+ lib_opts + o_args)
+ #if debug:
+ # ld_args[:0] = ['-g']
+ if extra_preargs:
+ ld_args[:0] = extra_preargs
+ if extra_postargs:
+ ld_args.extend(extra_postargs)
+ self.mkpath(os.path.dirname(output_filename))
+ if target_desc == CCompiler.EXECUTABLE:
+ raise NotImplementedError,self.__class__.__name__+'.linker_exe attribute'
+ else:
+ linker = self.linker_so[:]
+ command = linker + ld_args
+ log.info(' '.join(command))
+ try:
+ s,o = self.exec_command(command)
+ except DistutilsExecError, msg:
+ raise LinkError, msg
+ if s:
+ raise LinkError, o
+ else:
+ log.debug("skipping %s (up-to-date)", output_filename)
+ return
+
############################################################
## Private methods:
@@ -457,6 +636,8 @@ class FCompiler(CCompiler):
## class FCompiler
+##############################################################################
+
fcompiler_class = {'gnu':('gnufcompiler','GnuFCompiler',
"GNU Fortran Compiler"),
'pg':('pgfcompiler','PGroupFCompiler',
@@ -536,11 +717,13 @@ def new_fcompiler(plat=None,
except KeyError:
msg = "don't know how to compile Fortran code on platform '%s'" % plat
if compiler is not None:
- msg = msg + " with '%s' compiler" % compiler
+ msg = msg + " with '%s' compiler." % compiler
+ msg = msg + " Supported compilers are: %s)" \
+ % (','.join(fcompiler_class.keys()))
raise DistutilsPlatformError, msg
try:
- module_name = module_name
+ module_name = 'scipy_distutils.'+module_name
__import__ (module_name)
module = sys.modules[module_name]
klass = vars(module)[class_name]
@@ -602,41 +785,12 @@ def show_fcompilers(dist = None):
pretty_printer.print_help("List of unimplemented Fortran compilers:")
print "For compiler details, run 'config_fc --verbose' setup command."
-class config_fc(Command):
- """ Distutils command to hold user specified options
- to Fortran compilers.
-
- This is used in FCompiler.customize() method.
- """
-
- user_options = [
- ('fcompiler=',None,"specify Fortran compiler type"),
- ('f77-exec=', None, "specify F77 compiler command"),
- ('f90-exec=', None, "specify F90 compiler command"),
- ('f77flags=',None,"specify F77 compiler flags"),
- ('f90flags=',None,"specify F90 compiler flags"),
- ('opt=',None,"specify optimization flags"),
- ('arch=',None,"specify architecture specific optimization flags"),
- ('debug','g',"compile with debugging information"),
- ('noopt',None,"compile without optimization"),
- ('noarch',None,"compile without arch-dependent optimization"),
- ]
-
- boolean_options = ['debug','noopt','noarch']
-
- help_options = [
- ('help-fcompiler', None,
- "list available Fortran compilers", show_fcompilers),
- ]
-
def dummy_fortran_file():
import tempfile
dummy_name = tempfile.mktemp()+'__dummy'
dummy = open(dummy_name+'.f','w')
dummy.write(" subroutine dummy()\n end\n")
dummy.close()
- import atexit
- from distutils import log
def rm_file(name=dummy_name,log_threshold=log._global_log.threshold):
save_th = log._global_log.threshold
log.set_threshold(log_threshold)
diff --git a/scipy_distutils/gnufcompiler.py b/scipy_distutils/gnufcompiler.py
index c8cbe1d1d..9fa686dd1 100644
--- a/scipy_distutils/gnufcompiler.py
+++ b/scipy_distutils/gnufcompiler.py
@@ -31,13 +31,10 @@ class GnuFCompiler(FCompiler):
'archiver' : ["ar", "-cr"],
'ranlib' : ["ranlib"],
}
-
-
- def get_flags(self):
- opt = FCompiler.get_flags(self)
- if os.name != 'nt':
- opt.append('-fPIC')
- return opt
+ module_dir_switch = None
+ module_include_switch = None
+ if os.name != 'nt':
+ pic_flags = ['-fPIC']
def get_linker_so(self):
# win32 linking should be handled by standard linker
@@ -115,6 +112,7 @@ class GnuFCompiler(FCompiler):
break
return opt
march_flag = 1
+ # 0.5.25 corresponds to 2.95.x
if self.get_version() == '0.5.26': # gcc 3.0
if cpu.is_AthlonK6():
opt.append('-march=k6')
@@ -166,7 +164,7 @@ class GnuFCompiler(FCompiler):
return opt
if __name__ == '__main__':
- from distutils import log
+ from scipy_distutils import log
log.set_verbosity(2)
from fcompiler import new_fcompiler
compiler = new_fcompiler(compiler='gnu')
diff --git a/scipy_distutils/hpuxfcompiler.py b/scipy_distutils/hpuxfcompiler.py
index 60682a81e..5a792030d 100644
--- a/scipy_distutils/hpuxfcompiler.py
+++ b/scipy_distutils/hpuxfcompiler.py
@@ -18,9 +18,11 @@ class HPUXFCompiler(FCompiler):
'archiver' : ["ar", "-cr"],
'ranlib' : ["ranlib"]
}
-
+ module_dir_switch = None #XXX: fix me
+ module_include_switch = None #XXX: fix me
+ pic_flags = ['+pic=long']
def get_flags(self):
- return ['+pic=long','+ppu']
+ return self.pic_flags + ['+ppu']
def get_flags_opt(self):
return ['-O3']
def get_libraries(self):
diff --git a/scipy_distutils/intelfcompiler.py b/scipy_distutils/intelfcompiler.py
index 6a719b7cc..7a1097c9a 100644
--- a/scipy_distutils/intelfcompiler.py
+++ b/scipy_distutils/intelfcompiler.py
@@ -28,8 +28,12 @@ class IntelFCompiler(FCompiler):
'ranlib' : ["ranlib"]
}
+ pic_flags = ['-KPIC']
+ module_dir_switch = '-module ' # Don't remove ending space!
+ module_include_switch = '-I'
+
def get_flags(self):
- opt = ["-KPIC","-cm"]
+ opt = self.pic_flags + ["-cm"]
return opt
def get_flags_opt(self):
@@ -74,7 +78,7 @@ class IntelItaniumFCompiler(IntelFCompiler):
'version_cmd' : [fc_exe, "-FI -V -c %(fname)s.f -o %(fname)s.o" \
% {'fname':dummy_fortran_file()}],
'compiler_f77' : [fc_exe,"-FI","-w90","-w95"],
- 'compiler_fix' : [fc_exe,"-FI","-72"],
+ 'compiler_fix' : [fc_exe,"-FI"],
'compiler_f90' : [fc_exe],
'linker_so' : [fc_exe,"-shared"],
'archiver' : ["ar", "-cr"],
@@ -105,7 +109,10 @@ class IntelVisualFCompiler(FCompiler):
}
compile_switch = '/c '
- object_switch = '/Fo' #No space after /Fo!
+ object_switch = '/Fo' #No space after /Fo!
+ library_switch = '/OUT:' #No space after /OUT:!
+ module_dir_switch = '/module:' #No space after /module:
+ module_include_switch = '/I'
def get_flags(self):
opt = ['/nologo','/MD','/nbs','/Qlowercase','/us']
diff --git a/scipy_distutils/laheyfcompiler.py b/scipy_distutils/laheyfcompiler.py
index b3ed4d2d0..228eb9206 100644
--- a/scipy_distutils/laheyfcompiler.py
+++ b/scipy_distutils/laheyfcompiler.py
@@ -19,6 +19,9 @@ class LaheyFCompiler(FCompiler):
'ranlib' : ["ranlib"]
}
+ module_dir_switch = None #XXX Fix me
+ module_include_switch = None #XXX Fix me
+
def get_flags_opt(self):
return ['-O']
def get_flags_debug(self):
diff --git a/scipy_distutils/mipsfcompiler.py b/scipy_distutils/mipsfcompiler.py
index daa4468ec..31eed4dde 100644
--- a/scipy_distutils/mipsfcompiler.py
+++ b/scipy_distutils/mipsfcompiler.py
@@ -18,9 +18,12 @@ class MipsFCompiler(FCompiler):
'archiver' : ["ar", "-cr"],
'ranlib' : None
}
+ module_dir_switch = None #XXX: fix me
+ module_include_switch = None #XXX: fix me
+ pic_flags = ['-KPIC']
def get_flags(self):
- return ['-KPIC','-n32']
+ return self.pic_flags + ['-n32']
def get_flags_opt(self):
return ['-O3']
def get_flags_arch(self):
diff --git a/scipy_distutils/pgfcompiler.py b/scipy_distutils/pgfcompiler.py
index 0a297335b..68480482f 100644
--- a/scipy_distutils/pgfcompiler.py
+++ b/scipy_distutils/pgfcompiler.py
@@ -21,11 +21,13 @@ class PGroupFCompiler(FCompiler):
'archiver' : ["ar", "-cr"],
'ranlib' : ["ranlib"]
}
+ pic_flags = ['-fpic']
+ module_dir_switch = '-module '
+ module_include_switch = '-I'
def get_flags(self):
opt = ['-Minform=inform','-Mnosecond_underscore']
- opt.append('-fpic')
- return opt
+ return self.pic_flags + opt
def get_flags_opt(self):
return ['-fast']
def get_flags_debug(self):
diff --git a/scipy_distutils/sunfcompiler.py b/scipy_distutils/sunfcompiler.py
index dd51b6360..77e78a5f3 100644
--- a/scipy_distutils/sunfcompiler.py
+++ b/scipy_distutils/sunfcompiler.py
@@ -18,9 +18,10 @@ class SunFCompiler(FCompiler):
'archiver' : ["ar", "-cr"],
'ranlib' : ["ranlib"]
}
+ module_dir_switch = '-moddir='
+ module_include_switch = '-M'
+ pic_flags = ['-xcode=pic32']
- def get_flags(self):
- return ['-xcode=pic32']
def get_opt(self):
return ['-fast','-dalign']
def get_arch(self):
@@ -31,7 +32,7 @@ class SunFCompiler(FCompiler):
return opt
if __name__ == '__main__':
- from distutils import log
+ from scipy_distutils import log
log.set_verbosity(2)
from fcompiler import new_fcompiler
compiler = new_fcompiler(compiler='sun')
diff --git a/scipy_distutils/vastfcompiler.py b/scipy_distutils/vastfcompiler.py
index 125195dac..710711ac6 100644
--- a/scipy_distutils/vastfcompiler.py
+++ b/scipy_distutils/vastfcompiler.py
@@ -24,6 +24,8 @@ class VastFCompiler(GnuFCompiler):
'archiver' : ["ar", "-cr"],
'ranlib' : ["ranlib"]
}
+ module_dir_switch = None #XXX Fix me
+ module_include_switch = None #XXX Fix me
def get_version_cmd(self):
f90 = self.compiler_f90[0]