summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorRalf Gommers <ralf.gommers@gmail.com>2020-11-26 22:52:58 +0000
committerGitHub <noreply@github.com>2020-11-26 22:52:58 +0000
commitb66d03dfc4958d159c5dc3ddc9075f8bcc47f9c5 (patch)
tree20de40da360faf216e6075791e8dc33e4fd88e9c /numpy
parentaf4b110273346e5969fba04365bc477747529fe2 (diff)
parent2dac5ae6be9a4246665306cfebb999d7498c049b (diff)
downloadnumpy-b66d03dfc4958d159c5dc3ddc9075f8bcc47f9c5.tar.gz
Merge pull request #17655 from pitmanst/zos.build
BLD: Fix installing Numpy on z/OS
Diffstat (limited to 'numpy')
-rw-r--r--numpy/core/src/common/npy_config.h9
-rw-r--r--numpy/distutils/unixccompiler.py7
2 files changed, 16 insertions, 0 deletions
diff --git a/numpy/core/src/common/npy_config.h b/numpy/core/src/common/npy_config.h
index 27328aa73..61cc3c7f1 100644
--- a/numpy/core/src/common/npy_config.h
+++ b/numpy/core/src/common/npy_config.h
@@ -19,6 +19,15 @@
#endif
+/* Disable broken functions on z/OS */
+#if defined (__MVS__)
+
+#undef HAVE_POWF
+#undef HAVE_EXPF
+#undef HAVE___THREAD
+
+#endif
+
/* Disable broken MS math functions */
#if (defined(_MSC_VER) && (_MSC_VER < 1900)) || defined(__MINGW32_VERSION)
diff --git a/numpy/distutils/unixccompiler.py b/numpy/distutils/unixccompiler.py
index 9bb7251d8..0cd2d243e 100644
--- a/numpy/distutils/unixccompiler.py
+++ b/numpy/distutils/unixccompiler.py
@@ -3,6 +3,8 @@ unixccompiler - can handle very long argument lists for ar.
"""
import os
+import sys
+import subprocess
from distutils.errors import CompileError, DistutilsExecError, LibError
from distutils.unixccompiler import UnixCCompiler
@@ -56,6 +58,11 @@ def UnixCCompiler__compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts
# add commandline flags to dependency file
if deps:
+ # After running the compiler, the file created will be in EBCDIC
+ # but will not be tagged as such. This tags it so the file does not
+ # have multiple different encodings being written to it
+ if sys.platform == 'zos':
+ subprocess.check_output(['chtag', '-tc', 'IBM1047', obj + '.d'])
with open(obj + '.d', 'a') as f:
f.write(_commandline_dep_string(cc_args, extra_postargs, pp_opts))