summaryrefslogtreecommitdiff
path: root/numpy/distutils
diff options
context:
space:
mode:
authorThomas Green <tomgreen66@hotmail.com>2021-11-16 22:55:13 +0000
committerGitHub <noreply@github.com>2021-11-16 22:55:13 +0000
commitfbb4a6b8b1423b2da508e3ca5a3842c2da4460bc (patch)
treecbdb744668f2603943de849993c0b5e7dcdfee23 /numpy/distutils
parent640fff6b33eb092319160b300b80bbbe3669cd35 (diff)
downloadnumpy-fbb4a6b8b1423b2da508e3ca5a3842c2da4460bc.tar.gz
Create armccompiler.py
From https://gitlab.com/arm-hpc/packages/-/wikis/packages/numpy Added `-fPIC` due to relocation errors when building shared library from static library such as quadmath.
Diffstat (limited to 'numpy/distutils')
-rw-r--r--numpy/distutils/armccompiler.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/numpy/distutils/armccompiler.py b/numpy/distutils/armccompiler.py
new file mode 100644
index 000000000..92385e905
--- /dev/null
+++ b/numpy/distutils/armccompiler.py
@@ -0,0 +1,23 @@
+from __future__ import division, absolute_import, print_function
+
+from distutils.unixccompiler import UnixCCompiler
+
+class ArmCCompiler(UnixCCompiler):
+
+ """
+ Arm compiler.
+ """
+
+ compiler_type = 'arm'
+ cc_exe = 'armclang'
+ cxx_exe = 'armclang++'
+
+ 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 + ' -mcpu=native -O3 -fPIC',
+ compiler_so=cc_compiler + ' -mcpu=native -O3 -fPIC',
+ compiler_cxx=cxx_compiler + ' -mcpu=native -O3 -fPIC',
+ linker_exe=cc_compiler + ' -lamath',
+ linker_so=cc_compiler + ' -lamath -shared')