[Numpy-svn] r4041 - in numpy.sunperf/numpy/distutils: . fcompiler

numpy-svn@scip... numpy-svn@scip...
Sun Sep 16 05:28:20 CDT 2007


Author: cdavid
Date: 2007-09-16 05:28:11 -0500 (Sun, 16 Sep 2007)
New Revision: 4041

Added:
   numpy.sunperf/numpy/distutils/sunccompiler.py
Modified:
   numpy.sunperf/numpy/distutils/ccompiler.py
   numpy.sunperf/numpy/distutils/fcompiler/sun.py
Log:
Add support for sun compiler (C and fortran) on Linux: seems to work with g77 compiled blas/lapack

Modified: numpy.sunperf/numpy/distutils/ccompiler.py
===================================================================
--- numpy.sunperf/numpy/distutils/ccompiler.py	2007-09-16 08:17:47 UTC (rev 4040)
+++ numpy.sunperf/numpy/distutils/ccompiler.py	2007-09-16 10:28:11 UTC (rev 4041)
@@ -313,6 +313,10 @@
                            "Intel C Itanium Compiler for Itanium-based applications")
 ccompiler._default_compilers += (('linux.*','intel'),('linux.*','intele'))
 
+compiler_class['sun'] = ('sunccompiler','SunCCompiler',
+                           "Sun Studio C Compiler for Linux")
+ccompiler._default_compilers += (('linux.*','sun'),)
+
 if sys.platform == 'win32':
     compiler_class['mingw32'] = ('mingw32ccompiler', 'Mingw32CCompiler',
                                  "Mingw32 port of GNU C Compiler for Win32"\

Modified: numpy.sunperf/numpy/distutils/fcompiler/sun.py
===================================================================
--- numpy.sunperf/numpy/distutils/fcompiler/sun.py	2007-09-16 08:17:47 UTC (rev 4040)
+++ numpy.sunperf/numpy/distutils/fcompiler/sun.py	2007-09-16 10:28:11 UTC (rev 4041)
@@ -1,3 +1,5 @@
+import sys
+
 from numpy.distutils.ccompiler import simple_version_match
 from numpy.distutils.fcompiler import FCompiler
 
@@ -38,7 +40,9 @@
         return ['-xtarget=generic']
     def get_libraries(self):
         opt = []
-        opt.extend(['fsu','sunmath','mvec','f77compat'])
+        opt.extend(['fsu','sunmath'])
+        if not sys.platform[:5] == 'linux':
+            opt.extend(['mvec', 'f77compat'])
         return opt
 
 if __name__ == '__main__':

Added: numpy.sunperf/numpy/distutils/sunccompiler.py
===================================================================
--- numpy.sunperf/numpy/distutils/sunccompiler.py	2007-09-16 08:17:47 UTC (rev 4040)
+++ numpy.sunperf/numpy/distutils/sunccompiler.py	2007-09-16 10:28:11 UTC (rev 4041)
@@ -0,0 +1,19 @@
+"""Sun studio compiler (both solaris and linux)."""
+from distutils.unixccompiler import UnixCCompiler
+from numpy.distutils.exec_command import find_executable
+
+class SunCCompiler(UnixCCompiler):
+    """ A modified Intel compiler compatible with an gcc built Python. """
+    compiler_type = 'sun'
+    # Use suncc instead of cc, because it makes it more obvious to follow
+    # what's going on when several compilers are available.
+    cc_exe = 'suncc'
+
+    def __init__ (self, verbose=0, dry_run=0, force=0):
+        UnixCCompiler.__init__ (self, verbose,dry_run, force)
+        compiler = self.cc_exe
+        self.set_executables(compiler=compiler,
+                             compiler_so=compiler,
+                             compiler_cxx=compiler,
+                             linker_exe=compiler,
+                             linker_so=compiler + ' -shared')



More information about the Numpy-svn mailing list