summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPearu Peterson <pearu.peterson@gmail.com>2004-01-19 13:42:53 +0000
committerPearu Peterson <pearu.peterson@gmail.com>2004-01-19 13:42:53 +0000
commitebeb16d01af0cbb47a7a268c663b0a357b64c59f (patch)
tree2f9d70464eef41d109fbd97c17c072d14d9aad09
parentc879ef7d77eb19cb4d795e4550573de9c58955b4 (diff)
downloadnumpy-ebeb16d01af0cbb47a7a268c663b0a357b64c59f.tar.gz
Added lahey,pg compilers, renamed forte to sun.
-rw-r--r--scipy_distutils/fcompiler.py10
-rw-r--r--scipy_distutils/intelfcompiler.py44
-rw-r--r--scipy_distutils/laheyfcompiler.py43
-rw-r--r--scipy_distutils/pgfcompiler.py40
-rw-r--r--scipy_distutils/sunfcompiler.py (renamed from scipy_distutils/fortefcompiler.py)10
5 files changed, 137 insertions, 10 deletions
diff --git a/scipy_distutils/fcompiler.py b/scipy_distutils/fcompiler.py
index b4bf950c8..229e22e78 100644
--- a/scipy_distutils/fcompiler.py
+++ b/scipy_distutils/fcompiler.py
@@ -465,16 +465,16 @@ fcompiler_class = {'gnu':('gnufcompiler','GnuFCompiler',
"Absoft Corp Fortran Compiler"),
'mips':('mipsfcompiler','MipsFCompiler',
"MIPSpro Fortran Compiler"),
- 'forte':('fortefcompiler','ForteFCompiler',
- "Forte Fortran 95 Compiler"),
'sun':('sunfcompiler','SunFCompiler',
- "Sun Fortran Compiler"),
+ "Sun|Forte Fortran 95 Compiler"),
'intel':('intelfcompiler','IntelFCompiler',
"Intel Fortran Compiler for 32-bit apps"),
'intelv':('intelfcompiler','IntelVisualFCompiler',
"Intel Visual Fortran Compiler for 32-bit apps"),
- 'intelitanium':('intelfcompiler','IntelItaniumFCompiler',
- "Intel Fortran Compiler for Itanium apps"),
+ 'intele':('intelfcompiler','IntelItaniumFCompiler',
+ "Intel Fortran Compiler for Itanium apps"),
+ 'intelev':('intelfcompiler','IntelItaniumVisualFCompiler',
+ "Intel Visual Fortran Compiler for Itanium apps"),
'nag':('nagfcompiler','NAGFCompiler',
"NAGWare Fortran 95 Compiler"),
'compaq':('compaqfcompiler','CompaqFCompiler',
diff --git a/scipy_distutils/intelfcompiler.py b/scipy_distutils/intelfcompiler.py
index df91f5ce3..6a719b7cc 100644
--- a/scipy_distutils/intelfcompiler.py
+++ b/scipy_distutils/intelfcompiler.py
@@ -60,6 +60,27 @@ class IntelFCompiler(FCompiler):
opt.append('-nofor_main')
return opt
+class IntelItaniumFCompiler(IntelFCompiler):
+ compiler_type = 'intele'
+ version_pattern = r'Intel\(R\) Fortran 90 Compiler Itanium\(TM\) Compiler'\
+ ' for the Itanium\(TM\)-based applications,'\
+ ' Version (?P<version>[^\s*]*)'
+
+ for fc_exe in map(find_executable,['efort','efc','ifort']):
+ if os.path.isfile(fc_exe):
+ break
+
+ executables = {
+ '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_f90' : [fc_exe],
+ 'linker_so' : [fc_exe,"-shared"],
+ 'archiver' : ["ar", "-cr"],
+ 'ranlib' : ["ranlib"]
+ }
+
class IntelVisualFCompiler(FCompiler):
compiler_type = 'intelv'
@@ -109,7 +130,28 @@ class IntelVisualFCompiler(FCompiler):
if cpu.has_mmx():
opt.append('/QaxM')
return opt
-
+
+class IntelItaniumVisualFCompiler(IntelVisualFCompiler):
+
+ compiler_type = 'intelev'
+ version_pattern = r'Intel\(R\) Fortran 90 Compiler Itanium\(TM\) Compiler'\
+ ' for the Itanium\(TM\)-based applications,'\
+ ' Version (?P<version>[^\s*]*)'
+
+ fc_exe = 'efl' # XXX this is a wild guess
+ ar_exe = IntelVisualFCompiler.ar_exe
+
+ executables = {
+ '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","-4L72","-w"],
+ 'compiler_f90' : [fc_exe],
+ 'linker_so' : [fc_exe,"-shared"],
+ 'archiver' : [ar_exe, "/verbose", "/OUT:"],
+ 'ranlib' : None
+ }
+
if __name__ == '__main__':
from distutils import log
log.set_verbosity(2)
diff --git a/scipy_distutils/laheyfcompiler.py b/scipy_distutils/laheyfcompiler.py
new file mode 100644
index 000000000..b3ed4d2d0
--- /dev/null
+++ b/scipy_distutils/laheyfcompiler.py
@@ -0,0 +1,43 @@
+import os
+import sys
+
+from cpuinfo import cpu
+from fcompiler import FCompiler
+
+class LaheyFCompiler(FCompiler):
+
+ compiler_type = 'lahey'
+ version_pattern = r'Lahey/Fujitsu Fortran 95 Compiler Release (?P<version>[^\s*]*)'
+
+ executables = {
+ 'version_cmd' : ["lf95", "--version"],
+ 'compiler_f77' : ["lf95", "--fix"],
+ 'compiler_fix' : ["lf95", "--fix"],
+ 'compiler_f90' : ["lf95"],
+ 'linker_so' : ["lf95","-shared"],
+ 'archiver' : ["ar", "-cr"],
+ 'ranlib' : ["ranlib"]
+ }
+
+ def get_flags_opt(self):
+ return ['-O']
+ def get_flags_debug(self):
+ return ['-g','--chk','--chkglobal']
+ def get_library_dirs(self):
+ opt = FCompiler.get_library_dirs(self)
+ d = os.environ.get('LAHEY')
+ if d:
+ opt.append(os.path.join(d,'lib'))
+ return opt
+ def get_libraries(self):
+ opt = FCompiler.get_libraries(self)
+ opt.extend(['fj9f6', 'fj9i6', 'fj9ipp', 'fj9e6'])
+ return opt
+
+if __name__ == '__main__':
+ from distutils import log
+ log.set_verbosity(2)
+ from fcompiler import new_fcompiler
+ compiler = new_fcompiler(compiler='lahey')
+ compiler.customize()
+ print compiler.get_version()
diff --git a/scipy_distutils/pgfcompiler.py b/scipy_distutils/pgfcompiler.py
new file mode 100644
index 000000000..0a297335b
--- /dev/null
+++ b/scipy_distutils/pgfcompiler.py
@@ -0,0 +1,40 @@
+
+# http://www.pgroup.com
+
+import os
+import sys
+
+from cpuinfo import cpu
+from fcompiler import FCompiler
+
+class PGroupFCompiler(FCompiler):
+
+ compiler_type = 'pg'
+ version_pattern = r'\s*pg(f77|f90|hpf) (?P<version>[\d.-]+).*'
+
+ executables = {
+ 'version_cmd' : ["pgf77", "-V 2>/dev/null"],
+ 'compiler_f77' : ["pgf77"],
+ 'compiler_fix' : ["pgf90", "-Mfixed"],
+ 'compiler_f90' : ["pgf90"],
+ 'linker_so' : ["pgf90","-shared"],
+ 'archiver' : ["ar", "-cr"],
+ 'ranlib' : ["ranlib"]
+ }
+
+ def get_flags(self):
+ opt = ['-Minform=inform','-Mnosecond_underscore']
+ opt.append('-fpic')
+ return opt
+ def get_flags_opt(self):
+ return ['-fast']
+ def get_flags_debug(self):
+ return ['-g']
+
+if __name__ == '__main__':
+ from distutils import log
+ log.set_verbosity(2)
+ from fcompiler import new_fcompiler
+ compiler = new_fcompiler(compiler='pg')
+ compiler.customize()
+ print compiler.get_version()
diff --git a/scipy_distutils/fortefcompiler.py b/scipy_distutils/sunfcompiler.py
index 37b736c29..dd51b6360 100644
--- a/scipy_distutils/fortefcompiler.py
+++ b/scipy_distutils/sunfcompiler.py
@@ -4,10 +4,10 @@ import sys
from cpuinfo import cpu
from fcompiler import FCompiler
-class ForteFCompiler(FCompiler):
+class SunFCompiler(FCompiler):
- compiler_type = 'forte'
- version_pattern = r'(f90|f95): Forte Developer 7 Fortran 95 (?P<version>[^\s]+).*'
+ compiler_type = 'sun'
+ version_pattern = r'(f90|f95): (Sun|Forte Developer 7) Fortran 95 (?P<version>[^\s]+).*'
executables = {
'version_cmd' : ["f90", "-V"],
@@ -31,7 +31,9 @@ class ForteFCompiler(FCompiler):
return opt
if __name__ == '__main__':
+ from distutils import log
+ log.set_verbosity(2)
from fcompiler import new_fcompiler
- compiler = new_fcompiler(compiler='forte')
+ compiler = new_fcompiler(compiler='sun')
compiler.customize()
print compiler.get_version()