summaryrefslogtreecommitdiff
path: root/numpy/distutils
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/distutils')
-rw-r--r--numpy/distutils/ccompiler.py6
-rw-r--r--numpy/distutils/fcompiler/__init__.py2
-rw-r--r--numpy/distutils/fcompiler/pathf95.py36
-rw-r--r--numpy/distutils/pathccompiler.py21
4 files changed, 63 insertions, 2 deletions
diff --git a/numpy/distutils/ccompiler.py b/numpy/distutils/ccompiler.py
index 0889d11a0..011122b60 100644
--- a/numpy/distutils/ccompiler.py
+++ b/numpy/distutils/ccompiler.py
@@ -506,7 +506,11 @@ compiler_class['intel'] = ('intelccompiler','IntelCCompiler',
"Intel C Compiler for 32-bit applications")
compiler_class['intele'] = ('intelccompiler','IntelItaniumCCompiler',
"Intel C Itanium Compiler for Itanium-based applications")
-ccompiler._default_compilers += (('linux.*','intel'),('linux.*','intele'))
+compiler_class['pathcc'] = ('pathccompiler','PathScaleCCompiler',
+ "PathScale Compiler for SiCortex-based applications")
+ccompiler._default_compilers += (('linux.*','intel'),
+ ('linux.*','intele'),
+ ('linux.*','pathcc'))
if sys.platform == 'win32':
compiler_class['mingw32'] = ('mingw32ccompiler', 'Mingw32CCompiler',
diff --git a/numpy/distutils/fcompiler/__init__.py b/numpy/distutils/fcompiler/__init__.py
index 5c9395869..397b36ce9 100644
--- a/numpy/distutils/fcompiler/__init__.py
+++ b/numpy/distutils/fcompiler/__init__.py
@@ -694,7 +694,7 @@ _default_compilers = (
'intelvem', 'intelem')),
('cygwin.*', ('gnu','intelv','absoft','compaqv','intelev','gnu95','g95')),
('linux.*', ('gnu','intel','lahey','pg','absoft','nag','vast','compaq',
- 'intele','intelem','gnu95','g95')),
+ 'intele','intelem','gnu95','g95','pathf95')),
('darwin.*', ('nag', 'absoft', 'ibm', 'intel', 'gnu', 'gnu95', 'g95', 'pg')),
('sunos.*', ('sun','gnu','gnu95','g95')),
('irix.*', ('mips','gnu','gnu95',)),
diff --git a/numpy/distutils/fcompiler/pathf95.py b/numpy/distutils/fcompiler/pathf95.py
new file mode 100644
index 000000000..c92653ba7
--- /dev/null
+++ b/numpy/distutils/fcompiler/pathf95.py
@@ -0,0 +1,36 @@
+from numpy.distutils.fcompiler import FCompiler
+
+compilers = ['PathScaleFCompiler']
+
+class PathScaleFCompiler(FCompiler):
+
+ compiler_type = 'pathf95'
+ description = 'PathScale Fortran Compiler'
+ version_pattern = r'PathScale\(TM\) Compiler Suite: Version (?P<version>[\d.]+)'
+
+ executables = {
+ 'version_cmd' : ["pathf95", "-version"],
+ 'compiler_f77' : ["pathf95", "-fixedform"],
+ 'compiler_fix' : ["pathf95", "-fixedform"],
+ 'compiler_f90' : ["pathf95"],
+ 'linker_so' : ["pathf95", "-shared"],
+ 'archiver' : ["ar", "-cr"],
+ 'ranlib' : ["ranlib"]
+ }
+ pic_flags = ['-fPIC']
+ module_dir_switch = '-module ' # Don't remove ending space!
+ module_include_switch = '-I'
+
+ def get_flags_opt(self):
+ return ['-O3']
+ def get_flags_debug(self):
+ return ['-g']
+
+if __name__ == '__main__':
+ from distutils import log
+ log.set_verbosity(2)
+ #compiler = PathScaleFCompiler()
+ from numpy.distutils.fcompiler import new_fcompiler
+ compiler = new_fcompiler(compiler='pathf95')
+ compiler.customize()
+ print compiler.get_version()
diff --git a/numpy/distutils/pathccompiler.py b/numpy/distutils/pathccompiler.py
new file mode 100644
index 000000000..48051810e
--- /dev/null
+++ b/numpy/distutils/pathccompiler.py
@@ -0,0 +1,21 @@
+from distutils.unixccompiler import UnixCCompiler
+
+class PathScaleCCompiler(UnixCCompiler):
+
+ """
+ PathScale compiler compatible with an gcc built Python.
+ """
+
+ compiler_type = 'pathcc'
+ cc_exe = 'pathcc'
+ cxx_exe = 'pathCC'
+
+ def __init__ (self, verbose=0, dry_run=0, force=0):
+ UnixCCompiler.__init__ (self, verbose, dry_run, force)
+ cc_compiler = self.cc_exe
+ cxx_compiler = self.cxx_exe
+ self.set_executables(compiler=cc_compiler,
+ compiler_so=cc_compiler,
+ compiler_cxx=cxx_compiler,
+ linker_exe=cc_compiler,
+ linker_so=cc_compiler + ' -shared')