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