8000 Tickets distutils by rgommers · Pull Request #24 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

Tickets distutils #24

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
ENH: add support for the PathScale compilers on Linux. Closes #1043.
Thanks to R. Perez.
  • Loading branch information
rgommers committed Nov 30, 2010
commit 0c93c7781a984e52241d219ace66ca177e8c42fc
6 changes: 5 additions & 1 deletion numpy/distutils/ccompiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,11 @@ def CCompiler_cxx_compiler(self):
"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',
Expand Down
2 changes: 1 addition & 1 deletion numpy/distutils/fcompiler/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@ def _environment_hook(self, name, hook_name):
'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',)),
Expand Down
36 changes: 36 additions & 0 deletions numpy/distutils/fcompiler/pathf95.py
Original file line number Diff line number Diff line change
@@ -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()
21 changes: 21 additions & 0 deletions numpy/distutils/pathccompiler.py
Original file line number Diff line number Diff line change
@@ -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')
0