author | Alan Coopersmith <Alan.Coopersmith@Oracle.COM> |
Mon, 19 Sep 2016 00:22:44 -0700 | |
changeset 6954 | bdf0b42d8cef |
permissions | -rw-r--r-- |
6954
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
1 |
Fix 64-bit builds with Studio compilers |
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
2 |
|
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
3 |
Migrated from desktop gate patches/numpy27-01-sun64.diff |
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
4 |
Upstream status unknown |
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
5 |
|
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
6 |
|
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
7 |
--- a/numpy/distutils/fcompiler/sun.py.orig Mon Oct 20 16:15:23 2014 |
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
8 |
+++ b/numpy/distutils/fcompiler/sun.py Mon Oct 20 16:13:11 2014 |
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
9 |
@@ -25,7 +25,7 @@ |
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
10 |
} |
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
11 |
module_dir_switch = '-moddir=' |
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
12 |
module_include_switch = '-M' |
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
13 |
- pic_flags = ['-xcode=pic32'] |
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
14 |
+ pic_flags = ['-KPIC'] |
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
15 |
|
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
16 |
def get_flags_f77(self): |
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
17 |
ret = ["-ftrap=%none"] |
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
18 |
--- a/numpy/distutils/ccompiler.py.orig Mon Oct 20 16:05:36 2014 |
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
19 |
+++ b/numpy/distutils/ccompiler.py Mon Oct 20 16:11:46 2014 |
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
20 |
@@ -520,6 +520,15 @@ |
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
21 |
ccompiler._default_compilers = (('nt', 'mingw32'),) \ |
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
22 |
+ ccompiler._default_compilers |
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
23 |
|
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
24 |
+if sys.platform == 'sunos5': |
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
25 |
+ compiler_class['sun64'] = ('sunccompiler','SunCCompiler64', |
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
26 |
+ "Sun Studio C Compiler for solaris") |
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
27 |
+ compiler_class['sun32'] = ('sunccompiler','SunCCompiler32', |
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
28 |
+ "Sun Studio C Compiler for solaris") |
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
29 |
+ log.info('Setting sunos as default compiler for solaris.') |
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
30 |
+ ccompiler._default_compilers = (('linux', 'sun64'), |
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
31 |
+ ('linux', 'sun32'),) \ |
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
32 |
+ + ccompiler._default_compilers |
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
33 |
|
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
34 |
_distutils_new_compiler = new_compiler |
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
35 |
def new_compiler (plat=None, |
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
36 |
--- /dev/null 2014-10-20 17:24:13.000000000 +0530 |
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
37 |
+++ b/numpy/distutils/sunccompiler.py 2014-10-20 16:36:32.438378171 +0530 |
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
38 |
@@ -0,0 +1,40 @@ |
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
39 |
+"""Sun studio compiler (both solaris and linux).""" |
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
40 |
+from distutils.unixccompiler import UnixCCompiler |
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
41 |
+from numpy.distutils.exec_command import find_executable |
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
42 |
+from numpy.distutils.misc_util import get_build_architecture |
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
43 |
+from numpy.distutils.cpuinfo import SunOSCPUInfo |
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
44 |
+import sys |
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
45 |
+ |
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
46 |
+class SunCCompiler64(UnixCCompiler): |
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
47 |
+ """Sun C compiler """ |
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
48 |
+ compiler_type = 'sun64' |
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
49 |
+ # Use suncc instead of cc, because it makes it more obvious to follow |
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
50 |
+ # what's going on when several compilers are available. |
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
51 |
+ cc_exe = 'cc' |
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
52 |
+ |
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
53 |
+ def __init__ (self, verbose=0, dry_run=0, force=0): |
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
54 |
+ UnixCCompiler.__init__ (self, verbose,dry_run, force) |
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
55 |
+ self.cc_exe = 'cc -m64 -KPIC' |
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
56 |
+ compiler = self.cc_exe |
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
57 |
+ self.set_executables(compiler=compiler, |
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
58 |
+ compiler_so=compiler, |
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
59 |
+ compiler_cxx=compiler, |
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
60 |
+ linker_exe=compiler, |
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
61 |
+ linker_so=compiler + ' -64 -shared') |
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
62 |
+ |
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
63 |
+class SunCCompiler32(UnixCCompiler): |
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
64 |
+ """Sun C compiler """ |
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
65 |
+ compiler_type = 'sun32' |
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
66 |
+ # Use suncc instead of cc, because it makes it more obvious to follow |
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
67 |
+ # what's going on when several compilers are available. |
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
68 |
+ cc_exe = 'cc' |
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
69 |
+ |
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
70 |
+ def __init__ (self, verbose=0, dry_run=0, force=0): |
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
71 |
+ UnixCCompiler.__init__ (self, verbose,dry_run, force) |
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
72 |
+ self.cc_exe = 'cc -m32 -xarch=sse2 -KPIC' |
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
73 |
+ compiler = self.cc_exe |
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
74 |
+ self.set_executables(compiler=compiler, |
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
75 |
+ compiler_so=compiler, |
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
76 |
+ compiler_cxx=compiler, |
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
77 |
+ linker_exe=compiler, |
bdf0b42d8cef
23245488 Move numpy 1.9.0 to Userland
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff
changeset
|
78 |
+ linker_so=compiler + ' -shared') |