8000 ENH: add support for the PathScale compilers on Linux. Closes #1043. · numpy/numpy@8d0b581 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8d0b581

Browse files
rgommerscharris
rgommers
authored andcommitted
ENH: add support for the PathScale compilers on Linux. Closes #1043.
Thanks to R. Perez.
1 parent a70de5c commit 8d0b581

File tree

4 files changed

+63
-2
lines changed

4 files changed

+63
-2
lines changed

numpy/distutils/ccompiler.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,11 @@ def CCompiler_cxx_compiler(self):
506506
"Intel C Compiler for 32-bit applications")
507507
compiler_class['intele'] = ('intelccompiler','IntelItaniumCCompiler',
508508
"Intel C Itanium Compiler for Itanium-based applications")
509-
ccompiler._default_compilers += (('linux.*','intel'),('linux.*','intele'))
509+
compiler_class['pathcc'] = ('pathccompiler','PathScaleCCompiler',
510+
"PathScale Compiler for SiCortex-based applications")
511+
ccompiler._default_compilers += (('linux.*','intel'),
512+
('linux.*','intele'),
513+
('linux.*','pathcc'))
510514

511515
if sys.platform == 'win32':
512516
compiler_class['mingw32'] = ('mingw32ccompiler', 'Mingw32CCompiler',

numpy/distutils/fcompiler/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,7 @@ def _environment_hook(self, name, hook_name):
694694
'intelvem', 'intelem')),
695695
('cygwin.*', ('gnu','intelv','absoft','compaqv','intelev','gnu95','g95')),
696696
('linux.*', ('gnu','intel','lahey','pg','absoft','nag','vast','compaq',
697-
'intele','intelem','gnu95','g95')),
697+
'intele','intelem','gnu95','g95','pathf95')),
698698
('darwin.*', ('nag', 'absoft', 'ibm', 'intel', 'gnu', 'gnu95', 'g95', 'pg')),
699699
('sunos.*', ('sun','gnu','gnu95','g95')),
700700
('irix.*', ('mips','gnu','gnu95',)),

numpy/distutils/fcompiler/pathf95.py

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
from numpy.distutils.fcompiler import FCompiler
2+
3+
compilers = ['PathScaleFCompiler']
4+
5+
class PathScaleFCompiler(FCompiler):
6+
7+
compiler_type = 'pathf95'
8+
description = 'PathScale Fortran Compiler'
9+
version_pattern = r'PathScale\(TM\) Compiler Suite: Version (?P<version>[\d.]+)'
10+
11+
executables = {
12+
'version_cmd' : ["pathf95", "-version"],
13+
'compiler_f77' : ["pathf95", "-fixedform"],
14+
'compiler_fix' : ["pathf95", "-fixedform"],
15+
'compiler_f90' : ["pathf95"],
16+
'linker_so' : ["pathf95", "-shared"],
17+
'archiver' : ["ar", "-cr"],
18+
'ranlib' : ["ranlib"]
19+
}
20+
pic_flags = ['-fPIC']
21+
module_dir_switch = '-module ' # Don't remove ending space!
22+
module_include_switch = '-I'
23+
24+
def get_flags_opt(self):
25+
return ['-O3']
26+
def get_flags_debug(self):
27+
return ['-g']
28+
29+
if __name__ == '__main__':
30+
from distutils import log
31+
log.set_verbosity(2)
32+
#compiler = PathScaleFCompiler()
33+
from numpy.distutils.fcompiler import new_fcompiler
34+
compiler = new_fcompiler(compiler='pathf95')
35+
compiler.customize()
36+
print compiler.get_version()

numpy/distutils/pathccompiler.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
from distutils.unixccompiler import UnixCCompiler
2+
3+
class PathScaleCCompiler(UnixCCompiler):
4+
5+
"""
6+
PathScale compiler compatible with an gcc built Python.
7+
"""
8+
9+
compiler_type = 'pathcc'
10+
cc_exe = 'pathcc'
11+
cxx_exe = 'pathCC'
12+
13+
def __init__ (self, verbose=0, dry_run=0, force=0):
14+
UnixCCompiler.__init__ (self, verbose, dry_run, force)
15+
cc_compiler = self.cc_exe
16+
cxx_compiler = self.cxx_exe
17+
self.set_executables(compiler=cc_compiler,
18+
compiler_so=cc_compiler,
19+
compiler_cxx=cxx_compiler,
20+
linker_exe=cc_compiler,
21+
linker_so=cc_compiler + ' -shared')

0 commit comments

Comments
 (0)
0