Skip to content

Commit 4bd4091

Browse files
committed
Move back platform definition to setup.py
1 parent b62ef67 commit 4bd4091

File tree

2 files changed

+17
-18
lines changed

2 files changed

+17
-18
lines changed

setup.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
from utils.command_style import source_style
5050
from utils.command_clean import source_clean
5151
from utils.command_build_clib import custom_build_clib
52-
from utils.dpnp_build_utils import find_cmplr, find_mathlib, find_omp, IS_LIN, IS_WIN
52+
from utils.dpnp_build_utils import find_cmplr, find_mathlib, find_omp
5353

5454

5555
"""
@@ -96,6 +96,18 @@
9696
Operating System :: MacOS
9797
"""
9898

99+
IS_WIN = False
100+
IS_MAC = False
101+
IS_LIN = False
102+
103+
if 'linux' in sys.platform:
104+
IS_LIN = True
105+
elif sys.platform == 'darwin':
106+
IS_MAC = True
107+
elif sys.platform in ['win32', 'cygwin']:
108+
IS_WIN = True
109+
else:
110+
raise EnvironmentError("Intel NumPy: " + sys.platform + " not supported")
99111

100112
"""
101113
Set compiler for the project

utils/dpnp_build_utils.py

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,6 @@
3131

3232
IS_CONDA_BUILD = os.environ.get("CONDA_BUILD") == "1"
3333

34-
IS_WIN = False
35-
IS_MAC = False
36-
IS_LIN = False
37-
38-
if 'linux' in sys.platform:
39-
IS_LIN = True
40-
elif sys.platform == 'darwin':
41-
IS_MAC = True
42-
elif sys.platform in ['win32', 'cygwin']:
43-
IS_WIN = True
44-
else:
45-
raise EnvironmentError(f"Intel NumPy: {sys.platform} not supported")
46-
4734

4835
def find_library(var_name, rel_header_paths, rel_lib_paths,
4936
rel_include_path="include", rel_libdir_path="lib", verbose=False):
@@ -106,10 +93,10 @@ def _find_cmplr_in_dpcpp_root(verbose=False):
10693
"""
10794
rel_header_paths = rel_lib_paths = []
10895

109-
if IS_LIN:
96+
if 'linux' in sys.platform:
11097
rel_include_path = os.path.join('linux', 'include')
11198
rel_libdir_path = os.path.join('linux', 'lib')
112-
elif IS_WIN:
99+
elif sys.platform in ['win32', 'cygwin']:
113100
rel_include_path = os.path.join('windows', 'include')
114101
rel_libdir_path = os.path.join('windows', 'lib')
115102
else:
@@ -225,10 +212,10 @@ def _find_omp_in_dpcpp_root(verbose=False):
225212
"""
226213
rel_header_paths = rel_lib_paths = []
227214

228-
if IS_LIN:
215+
if 'linux' in sys.platform:
229216
rel_include_path = os.path.join('linux', 'compiler', 'include')
230217
rel_libdir_path = os.path.join('linux', 'compiler', 'lib', 'intel64')
231-
elif IS_WIN:
218+
elif sys.platform in ['win32', 'cygwin']:
232219
rel_include_path = os.path.join('windows', 'compiler', 'include')
233220
rel_libdir_path = os.path.join('windows', 'compiler', 'lib', 'intel64_win')
234221
else:

0 commit comments

Comments
 (0)