Skip to content

Commit

Permalink
Numba available only for py3
Browse files Browse the repository at this point in the history
  • Loading branch information
mrodozov authored and cmsbuild committed May 22, 2020
1 parent ab0cf66 commit a68594f
Show file tree
Hide file tree
Showing 9 changed files with 87 additions and 10 deletions.
2 changes: 1 addition & 1 deletion codechecker.spec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
### RPM external codechecker 0.1
## INITENV +PATH LD_LIBRARY_PATH %i/lib64

%define tag b27bf495772dd04843b44847302f46c522198f5e
%define tag d0f091c40569bf5b618f3e415a9b07fa6d9044fc
%define branch llvm10
%define github_user cms-externals
Source: git+https://github.com/%github_user/CMSCodeChecker.git?obj=%{branch}/%{tag}&export=%{n}-%{realversion}&output=/%{n}-%{realversion}.tgz
Expand Down
4 changes: 2 additions & 2 deletions llvm.spec
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ AutoReq: no

%define llvmCommit 80c6853a9ea2d6b142111a4177f94fb8b39ba2cf
%define llvmBranch cms/release/10.x/92d5c1b
%define iwyuCommit a40a28740c963636d8d41e75f297e8e078302d70
%define iwyuBranch clang_10
%define iwyuCommit a5a6f27dabeb7fbc59b06ea949a312201c2fbdcf
%define iwyuBranch master

Source0: git+https://github.com/cms-externals/llvm-project.git?obj=%{llvmBranch}/%{llvmCommit}&export=llvm-%{realversion}-%{llvmCommit}&module=llvm-%{realversion}-%{llvmCommit}&output=/llvm-%{realversion}-%{llvmCommit}.tgz
Source1: git+https://github.com/include-what-you-use/include-what-you-use.git?obj=%{iwyuBranch}/%{iwyuCommit}&export=iwyu-%{realversion}-%{iwyuCommit}&module=iwyu-%{realversion}-%{iwyuCommit}&output=/iwyu-%{realversion}-%{iwyuCommit}.tgz
Expand Down
3 changes: 0 additions & 3 deletions pip/numba.file

This file was deleted.

2 changes: 1 addition & 1 deletion pip/oamap.file
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Requires: py2-numpy py2-numba py2-uproot py2-h5py py3-numpy
Requires: py2-numpy py3-numba py2-uproot py2-h5py py3-numpy py2-cachetools
Patch0: py2-oamap-Const2Literal
5 changes: 5 additions & 0 deletions pip/py3-numba.file
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Requires: py2-funcsigs py2-six py2-singledispatch py2-llvmlite py3-numpy python3
Patch0: py3-numba-llvm33

%define source0 git+https://github.com/numba/numba?obj=master/1ea770564cb3c0c6cb9d8ab92e7faf23cd4c4c19&export=numba-%{realversion}&output=/source.tar.gz
%define RelocatePython %{i}/bin/*
4 changes: 2 additions & 2 deletions pip/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ kiwisolver==1.1.0
lazy-object-proxy==1.4.3
lizard==1.17.3
#NO_AUTO_UPDATE: Source is defined in llvmlite.file, changing version here is not going to get new sources
llvmlite==0.32.0x
llvmlite==0.33.0dev
lxml==4.5.0
lz4==2.2.1
Mako==1.1.2
Expand All @@ -142,7 +142,7 @@ nose-parameterized==0.6.0
nose==1.3.7
notebook==5.7.8 ; python_version<'3.0'
notebook==6.0.2 ; python_version>'3.0'
numba==0.47.0
numba==0.50.0dev0 ; python_version>'3.0'
numexpr==2.7.1
numpy==1.16.6 ; python_version<'3.0'
numpy==1.17.5 ; python_version>'3.0'
Expand Down
47 changes: 47 additions & 0 deletions py3-llvmlite-llvm9.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
diff -Naur a/ffi/build.py b/ffi/build.py
--- a/ffi/build.py 2020-01-10 14:51:38.000000000 +0100
+++ b/ffi/build.py 2020-01-10 14:45:27.059843040 +0100
@@ -110,7 +110,7 @@
out = out.decode('latin1')
print(out)
if not (out.startswith('8.0.') or out.startswith('7.0.')
- or out.startswith('7.1.')):
+ or out.startswith('7.1.') or out.startswith('9.0.') or out.startswith('11.0.')):
msg = (
"Building llvmlite requires LLVM 7.0.x, 7.1.x or 8.0.x Be sure to "
"set LLVM_CONFIG to the right executable path.\n"
diff --git a/ffi/linker.cpp b/ffi/linker.cpp
index 57bb80b..2cc0019 100644
--- a/ffi/linker.cpp
+++ b/ffi/linker.cpp
@@ -42,7 +42,7 @@ LLVMPY_LinkModules(LLVMModuleRef Dest, LLVMModuleRef Src, const char **Err)
auto OldDiagnosticHandler = Ctx.getDiagnosticHandler();

// set the handler to a new one
- Ctx.setDiagnosticHandler(llvm::make_unique<ReportNotAbortDiagnosticHandler>(errstream));
+ Ctx.setDiagnosticHandler(std::make_unique<ReportNotAbortDiagnosticHandler>(errstream));

// link
bool failed = LLVMLinkModules2(Dest, Src);
diff --git a/ffi/transforms.cpp b/ffi/transforms.cpp
index 23bfd72..8cb8830 100644
--- a/ffi/transforms.cpp
+++ b/ffi/transforms.cpp
@@ -6,7 +6,7 @@

extern "C" {

-namespace llvm {
+ /*namespace llvm {
inline PassManagerBuilder *unwrap(LLVMPassManagerBuilderRef P) {
return reinterpret_cast<PassManagerBuilder*>(P);
}
@@ -14,7 +14,7 @@ namespace llvm {
inline LLVMPassManagerBuilderRef wrap(PassManagerBuilder *P) {
return reinterpret_cast<LLVMPassManagerBuilderRef>(P);
}
-}
+ }*/


API_EXPORT(LLVMPassManagerBuilderRef)
28 changes: 28 additions & 0 deletions py3-numba-llvm33.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
diff --git a/setup.py b/setup.py
index d9af186..edfdd3c 100644
--- a/setup.py
+++ b/setup.py
@@ -302,12 +302,8 @@ def get_ext_modules():

packages = find_packages(include=["numba", "numba.*"])

-build_requires = [f'numpy >={min_numpy_build_version}']
-install_requires = [
- f'llvmlite >={min_llvmlite_version},<={max_llvmlite_version}',
- f'numpy >={min_numpy_run_version}',
- 'setuptools',
-]
+build_requires = ['numpy >=1.11']
+install_requires = ['llvmlite>=0.31.0dev0,<=0.33.0.dev0', 'numpy', 'setuptools']

metadata = dict(
name='numba',
@@ -346,7 +342,7 @@ metadata = dict(
packages=packages,
setup_requires=build_requires,
install_requires=install_requires,
- python_requires=f">={min_python_version}",
+ python_requires=">=3.6",
license="BSD",
cmdclass=cmdclass,
)
2 changes: 1 addition & 1 deletion python_tools.spec
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Requires: py2-downhill
Requires: py2-theanets
Requires: py2-xgboost
Requires: py2-llvmlite
Requires: py2-numba
Requires: py3-numba
Requires: py2-hep_ml
Requires: py2-rep
Requires: py2-uncertainties
Expand Down

0 comments on commit a68594f

Please sign in to comment.