forked from M-Labs/artiq
Fold llvmlite patches into m-labs/llvmlite repository.
This commit is contained in:
parent
fd46d8b11e
commit
3378dd57b8
|
@ -1,12 +1,11 @@
|
||||||
import os, sys, fileinput, ctypes
|
import os, sys, fileinput, ctypes
|
||||||
from pythonparser import diagnostic
|
from pythonparser import diagnostic
|
||||||
from llvmlite import binding as llvm
|
from llvmlite_artiq import binding as llvm
|
||||||
from .. import Module
|
from .. import Module
|
||||||
|
|
||||||
llvm.initialize()
|
llvm.initialize()
|
||||||
llvm.initialize_native_target()
|
llvm.initialize_native_target()
|
||||||
llvm.initialize_native_asmprinter()
|
llvm.initialize_native_asmprinter()
|
||||||
llvm.check_jit_execution()
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
libartiq_personality = os.getenv('LIBARTIQ_PERSONALITY')
|
libartiq_personality = os.getenv('LIBARTIQ_PERSONALITY')
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import sys, fileinput
|
import sys, fileinput
|
||||||
from pythonparser import diagnostic
|
from pythonparser import diagnostic
|
||||||
from llvmlite import ir as ll
|
from llvmlite_artiq import ir as ll
|
||||||
from .. import Module
|
from .. import Module
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
into LLVM intermediate representation.
|
into LLVM intermediate representation.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import llvmlite.ir as ll
|
|
||||||
from pythonparser import ast
|
from pythonparser import ast
|
||||||
|
from llvmlite_artiq import ir as ll
|
||||||
from .. import types, builtins, ir
|
from .. import types, builtins, ir
|
||||||
|
|
||||||
class LLVMIRGenerator:
|
class LLVMIRGenerator:
|
||||||
|
|
|
@ -4,10 +4,5 @@ set CMAKE_PREFIX_PATH=%LIBRARY_PREFIX%
|
||||||
@rem Ensure there are no build leftovers (CMake can complain)
|
@rem Ensure there are no build leftovers (CMake can complain)
|
||||||
if exist ffi\build rmdir /S /Q ffi\build
|
if exist ffi\build rmdir /S /Q ffi\build
|
||||||
|
|
||||||
@rem Apply patches
|
|
||||||
patch -p1 < %RECIPE_DIR%/../../misc/llvmlite-add-all-targets.patch
|
|
||||||
patch -p1 < %RECIPE_DIR%/../../misc/llvmlite-rename.patch
|
|
||||||
patch -p1 < %RECIPE_DIR%/../../misc/llvmlite-build-as-debug-on-windows.patch
|
|
||||||
|
|
||||||
%PYTHON% -S setup.py install
|
%PYTHON% -S setup.py install
|
||||||
if errorlevel 1 exit 1
|
if errorlevel 1 exit 1
|
||||||
|
|
|
@ -1,6 +1,3 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
patch -p1 < ${RECIPE_DIR}/../../misc/llvmlite-add-all-targets.patch
|
|
||||||
patch -p1 < ${RECIPE_DIR}/../../misc/llvmlite-rename.patch
|
|
||||||
patch -p1 < ${RECIPE_DIR}/../../misc/llvmlite-build-as-debug-on-windows.patch
|
|
||||||
PATH=/usr/local/llvm-or1k/bin:$PATH $PYTHON setup.py install
|
PATH=/usr/local/llvm-or1k/bin:$PATH $PYTHON setup.py install
|
||||||
|
|
|
@ -300,11 +300,8 @@ Installing the host-side software
|
||||||
|
|
||||||
$ cd ~/artiq-dev
|
$ cd ~/artiq-dev
|
||||||
$ git clone https://github.com/m-labs/llvmlite
|
$ git clone https://github.com/m-labs/llvmlite
|
||||||
$ git checkout backport-3.5
|
$ git checkout artiq
|
||||||
$ cd llvmlite
|
$ cd llvmlite
|
||||||
$ patch -p1 < ~/artiq-dev/artiq/misc/llvmlite-add-all-targets.patch
|
|
||||||
$ patch -p1 < ~/artiq-dev/artiq/misc/llvmlite-rename.patch
|
|
||||||
$ patch -p1 < ~/artiq-dev/artiq/misc/llvmlite-build-as-debug-on-windows.patch
|
|
||||||
$ LLVM_CONFIG=/usr/local/llvm-or1k/bin/llvm-config python3 setup.py install --user
|
$ LLVM_CONFIG=/usr/local/llvm-or1k/bin/llvm-config python3 setup.py install --user
|
||||||
|
|
||||||
* Install ARTIQ: ::
|
* Install ARTIQ: ::
|
||||||
|
|
|
@ -1,38 +0,0 @@
|
||||||
diff --git a/ffi/initfini.cpp b/ffi/initfini.cpp
|
|
||||||
index 42c8965..067be62 100644
|
|
||||||
--- a/ffi/initfini.cpp
|
|
||||||
+++ b/ffi/initfini.cpp
|
|
||||||
@@ -37,9 +37,10 @@ LLVMPY_Shutdown(){
|
|
||||||
// NOTE: it is important that we don't export functions which we don't use,
|
|
||||||
// especially those which may pull in large amounts of additional code or data.
|
|
||||||
|
|
||||||
-// INIT(AllTargetInfos)
|
|
||||||
-// INIT(AllTargets)
|
|
||||||
-// INIT(AllTargetMCs)
|
|
||||||
+INIT(AllTargetInfos)
|
|
||||||
+INIT(AllTargets)
|
|
||||||
+INIT(AllTargetMCs)
|
|
||||||
+INIT(AllAsmPrinters)
|
|
||||||
INIT(NativeTarget)
|
|
||||||
INIT(NativeAsmParser)
|
|
||||||
INIT(NativeAsmPrinter)
|
|
||||||
diff --git a/llvmlite/binding/initfini.py b/llvmlite/binding/initfini.py
|
|
||||||
index bfaa5b2..7d0df11 100644
|
|
||||||
--- a/llvmlite/binding/initfini.py
|
|
||||||
+++ b/llvmlite/binding/initfini.py
|
|
||||||
@@ -8,6 +8,15 @@ def initialize():
|
|
||||||
ffi.lib.LLVMPY_InitializeCore()
|
|
||||||
|
|
||||||
|
|
||||||
+def initialize_all_targets():
|
|
||||||
+ ffi.lib.LLVMPY_InitializeAllTargetInfos()
|
|
||||||
+ ffi.lib.LLVMPY_InitializeAllTargets()
|
|
||||||
+ ffi.lib.LLVMPY_InitializeAllTargetMCs()
|
|
||||||
+
|
|
||||||
+def initialize_all_asmprinters():
|
|
||||||
+ ffi.lib.LLVMPY_InitializeAllAsmPrinters()
|
|
||||||
+
|
|
||||||
+
|
|
||||||
def initialize_native_target():
|
|
||||||
"""
|
|
||||||
Initialize the native (host) target. Necessary before doing any
|
|
|
@ -1,13 +0,0 @@
|
||||||
diff --git a/ffi/build.py b/ffi/build.py
|
|
||||||
index 3889ba5..58f93ec 100755
|
|
||||||
--- a/ffi/build.py
|
|
||||||
+++ b/ffi/build.py
|
|
||||||
@@ -58,7 +58,7 @@ def find_win32_generator():
|
|
||||||
|
|
||||||
def main_win32():
|
|
||||||
generator = find_win32_generator()
|
|
||||||
- config = 'Release'
|
|
||||||
+ config = 'Debug'
|
|
||||||
if not os.path.exists(build_dir):
|
|
||||||
os.mkdir(build_dir)
|
|
||||||
try_cmake(here_dir, build_dir, generator)
|
|
|
@ -1,65 +0,0 @@
|
||||||
diff --git a/setup.py b/setup.py
|
|
||||||
index 6d28265..f4edd29 100644
|
|
||||||
--- a/setup.py
|
|
||||||
+++ b/setup.py
|
|
||||||
@@ -15,10 +15,10 @@ from llvmlite.utils import get_library_files
|
|
||||||
import versioneer
|
|
||||||
|
|
||||||
versioneer.VCS = 'git'
|
|
||||||
-versioneer.versionfile_source = 'llvmlite/_version.py'
|
|
||||||
-versioneer.versionfile_build = 'llvmlite/_version.py'
|
|
||||||
+versioneer.versionfile_source = 'llvmlite_or1k/_version.py'
|
|
||||||
+versioneer.versionfile_build = 'llvmlite_or1k/_version.py'
|
|
||||||
versioneer.tag_prefix = 'v' # tags are like v1.2.0
|
|
||||||
-versioneer.parentdir_prefix = 'llvmlite-' # dirname like 'myproject-1.2.0'
|
|
||||||
+versioneer.parentdir_prefix = 'llvmlite_or1k-' # dirname like 'myproject-1.2.0'
|
|
||||||
|
|
||||||
|
|
||||||
here_dir = os.path.dirname(__file__)
|
|
||||||
@@ -54,7 +54,7 @@ class LlvmliteBuildExt(build_ext):
|
|
||||||
# HACK: this makes sure the library file (which is large) is only
|
|
||||||
# included in binary builds, not source builds.
|
|
||||||
self.distribution.package_data = {
|
|
||||||
- "llvmlite.binding": get_library_files(),
|
|
||||||
+ "llvmlite_or1k.binding": get_library_files(),
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@@ -63,7 +63,7 @@ class LlvmliteInstall(install):
|
|
||||||
# This seems to only be necessary on OSX.
|
|
||||||
def run(self):
|
|
||||||
self.distribution.package_data = {
|
|
||||||
- "llvmlite.binding": get_library_files(),
|
|
||||||
+ "llvmlite_or1k.binding": get_library_files(),
|
|
||||||
}
|
|
||||||
install.run(self)
|
|
||||||
|
|
||||||
@@ -74,14 +74,14 @@ cmdclass.update({'build': LlvmliteBuild,
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
-packages = ['llvmlite',
|
|
||||||
- 'llvmlite.binding',
|
|
||||||
- 'llvmlite.ir',
|
|
||||||
- 'llvmlite.llvmpy',
|
|
||||||
- 'llvmlite.tests',
|
|
||||||
+packages = ['llvmlite_or1k',
|
|
||||||
+ 'llvmlite_or1k.binding',
|
|
||||||
+ 'llvmlite_or1k.ir',
|
|
||||||
+ 'llvmlite_or1k.llvmpy',
|
|
||||||
+ 'llvmlite_or1k.tests',
|
|
||||||
]
|
|
||||||
|
|
||||||
-setup(name='llvmlite',
|
|
||||||
+setup(name='llvmlite_or1k',
|
|
||||||
description="lightweight wrapper around basic LLVM functionality",
|
|
||||||
version=versioneer.get_version(),
|
|
||||||
classifiers=[
|
|
||||||
@@ -96,6 +96,7 @@ setup(name='llvmlite',
|
|
||||||
"Topic :: Software Development :: Code Generators",
|
|
||||||
"Topic :: Software Development :: Compilers",
|
|
||||||
],
|
|
||||||
+ package_dir={"llvmlite_or1k" : "llvmlite"},
|
|
||||||
# Include the separately-compiled shared library
|
|
||||||
author="Continuum Analytics, Inc.",
|
|
||||||
author_email="numba-users@continuum.io",
|
|
3
setup.py
3
setup.py
|
@ -20,7 +20,8 @@ class PushDocCommand(Command):
|
||||||
requirements = [
|
requirements = [
|
||||||
"sphinx", "sphinx-argparse", "pyserial", "numpy", "scipy",
|
"sphinx", "sphinx-argparse", "pyserial", "numpy", "scipy",
|
||||||
"python-dateutil", "prettytable", "h5py", "pydaqmx", "pyelftools",
|
"python-dateutil", "prettytable", "h5py", "pydaqmx", "pyelftools",
|
||||||
"quamash", "pyqtgraph", "pythonparser", "lit", "OutputCheck"
|
"quamash", "pyqtgraph", "pythonparser",
|
||||||
|
"llvmlite_artiq", "lit", "OutputCheck"
|
||||||
]
|
]
|
||||||
|
|
||||||
scripts = [
|
scripts = [
|
||||||
|
|
Loading…
Reference in New Issue