about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/catboost/nix-support.patch
blob: b8294420e09c3075110c88339c6ce728aab9c352 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
diff --git a/catboost/python-package/setup.py b/catboost/python-package/setup.py
index fe9251a21f..86b880c5d0 100644
--- a/catboost/python-package/setup.py
+++ b/catboost/python-package/setup.py
@@ -80,7 +80,7 @@ class Helper(object):
         self.with_cuda = os.environ.get('CUDA_PATH') or os.environ.get('CUDA_ROOT') or None
         self.os_sdk = 'local'
         self.with_ymake = True
-        self.parallel = None
+        self.parallel = os.environ.get('NIX_BUILD_CORES') or None
 
     def finalize_options(self):
         if os.path.exists(str(self.with_cuda)):
@@ -222,11 +222,12 @@ class build_ext(_build_ext):
 
     def build_with_make(self, topsrc_dir, build_dir, catboost_ext, put_dir, verbose, dry_run):
         logging.info('Buildling {} with gnu make'.format(catboost_ext))
-        makefile = 'python{}.{}CLANG11-LINUX-X86_64.makefile'.format(python_version()[0], 'CUDA.' if self.with_cuda else '')
+        makefile = 'python{}.{}CLANG12-LINUX-X86_64.makefile'.format(python_version()[0], 'CUDA.' if self.with_cuda else '')
         make_cmd = [
             'make', '-f', '../../make/' + makefile,
-            'CC=clang-11',
-            'CXX=clang++-11',
+            'CC=clang',
+            'CXX=clang++',
+            'PYTHON=python{}'.format(python_version()[0]),
             'BUILD_ROOT=' + build_dir,
             'SOURCE_ROOT=' + topsrc_dir,
         ]
diff --git a/make/python2.CLANG12-LINUX-X86_64.makefile b/make/python2.CLANG12-LINUX-X86_64.makefile
index b49a36fb3f..33996af995 100644
--- a/make/python2.CLANG12-LINUX-X86_64.makefile
+++ b/make/python2.CLANG12-LINUX-X86_64.makefile
@@ -4,31 +4,6 @@ BUILD_ROOT = $(shell pwd)
 SOURCE_ROOT = $(shell pwd)
 PYTHON = $(shell which python)
 
-ifneq ($(MAKECMDGOALS),help)
-define _CC_TEST
-__clang_major__ __clang_minor__
-endef
-
-_CC_VERSION = $(shell echo '$(_CC_TEST)' | $(CC) -E -P -)
-$(info _CC_VERSION = '$(_CC_VERSION)')
-
-ifneq '$(_CC_VERSION)' '12 0'
-    $(error clang 12.0 is required)
-endif
-endif
-
-ifneq ($(MAKECMDGOALS),help)
-define _CXX_TEST
-__clang_major__ __clang_minor__
-endef
-
-_CXX_VERSION = $(shell echo '$(_CXX_TEST)' | $(CXX) -E -P -)
-$(info _CXX_VERSION = '$(_CXX_VERSION)')
-
-ifneq '$(_CXX_VERSION)' '12 0'
-    $(error clang 12.0 is required)
-endif
-endif
 
 
 all\
diff --git a/make/python2.CUDA.CLANG12-LINUX-X86_64.makefile b/make/python2.CUDA.CLANG12-LINUX-X86_64.makefile
index 82935b297e..093cc86532 100644
--- a/make/python2.CUDA.CLANG12-LINUX-X86_64.makefile
+++ b/make/python2.CUDA.CLANG12-LINUX-X86_64.makefile
@@ -4,31 +4,6 @@ BUILD_ROOT = $(shell pwd)
 SOURCE_ROOT = $(shell pwd)
 PYTHON = $(shell which python)
 
-ifneq ($(MAKECMDGOALS),help)
-define _CC_TEST
-__clang_major__ __clang_minor__
-endef
-
-_CC_VERSION = $(shell echo '$(_CC_TEST)' | $(CC) -E -P -)
-$(info _CC_VERSION = '$(_CC_VERSION)')
-
-ifneq '$(_CC_VERSION)' '12 0'
-    $(error clang 12.0 is required)
-endif
-endif
-
-ifneq ($(MAKECMDGOALS),help)
-define _CXX_TEST
-__clang_major__ __clang_minor__
-endef
-
-_CXX_VERSION = $(shell echo '$(_CXX_TEST)' | $(CXX) -E -P -)
-$(info _CXX_VERSION = '$(_CXX_VERSION)')
-
-ifneq '$(_CXX_VERSION)' '12 0'
-    $(error clang 12.0 is required)
-endif
-endif
 
 
 all\
diff --git a/make/python3.CLANG12-LINUX-X86_64.makefile b/make/python3.CLANG12-LINUX-X86_64.makefile
index 1c5d646ae4..6c091fbe17 100644
--- a/make/python3.CLANG12-LINUX-X86_64.makefile
+++ b/make/python3.CLANG12-LINUX-X86_64.makefile
@@ -4,31 +4,6 @@ BUILD_ROOT = $(shell pwd)
 SOURCE_ROOT = $(shell pwd)
 PYTHON = $(shell which python)
 
-ifneq ($(MAKECMDGOALS),help)
-define _CC_TEST
-__clang_major__ __clang_minor__
-endef
-
-_CC_VERSION = $(shell echo '$(_CC_TEST)' | $(CC) -E -P -)
-$(info _CC_VERSION = '$(_CC_VERSION)')
-
-ifneq '$(_CC_VERSION)' '12 0'
-    $(error clang 12.0 is required)
-endif
-endif
-
-ifneq ($(MAKECMDGOALS),help)
-define _CXX_TEST
-__clang_major__ __clang_minor__
-endef
-
-_CXX_VERSION = $(shell echo '$(_CXX_TEST)' | $(CXX) -E -P -)
-$(info _CXX_VERSION = '$(_CXX_VERSION)')
-
-ifneq '$(_CXX_VERSION)' '12 0'
-    $(error clang 12.0 is required)
-endif
-endif
 
 
 all\
diff --git a/make/python3.CUDA.CLANG12-LINUX-X86_64.makefile b/make/python3.CUDA.CLANG12-LINUX-X86_64.makefile
index fcdb75a719..4e1dbc3cd7 100644
--- a/make/python3.CUDA.CLANG12-LINUX-X86_64.makefile
+++ b/make/python3.CUDA.CLANG12-LINUX-X86_64.makefile
@@ -4,31 +4,6 @@ BUILD_ROOT = $(shell pwd)
 SOURCE_ROOT = $(shell pwd)
 PYTHON = $(shell which python)
 
-ifneq ($(MAKECMDGOALS),help)
-define _CC_TEST
-__clang_major__ __clang_minor__
-endef
-
-_CC_VERSION = $(shell echo '$(_CC_TEST)' | $(CC) -E -P -)
-$(info _CC_VERSION = '$(_CC_VERSION)')
-
-ifneq '$(_CC_VERSION)' '12 0'
-    $(error clang 12.0 is required)
-endif
-endif
-
-ifneq ($(MAKECMDGOALS),help)
-define _CXX_TEST
-__clang_major__ __clang_minor__
-endef
-
-_CXX_VERSION = $(shell echo '$(_CXX_TEST)' | $(CXX) -E -P -)
-$(info _CXX_VERSION = '$(_CXX_VERSION)')
-
-ifneq '$(_CXX_VERSION)' '12 0'
-    $(error clang 12.0 is required)
-endif
-endif
 
 
 all\