Skip to content

Commit b6219c2

Browse files
author
Diptorup Deb
committed
Revert more changes.
1 parent e03a3b3 commit b6219c2

File tree

4 files changed

+24
-34
lines changed

4 files changed

+24
-34
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@ conda install dpctl
4242

4343
Build and Install with setuptools
4444
=================================
45-
`dpctl` relies on DPC++ runtime. With Intel oneAPI installed you should activate it.
45+
dpctl relies on DPC++ runtime. With Intel oneAPI installed you should activate it.
4646
`setup.py` requires environment variable `ONEAPI_ROOT` and following packages
4747
installed:
4848
- `cython`
4949
- `numpy`
5050
- `cmake` - for building C API
5151
- `ninja` - only on Windows
5252

53-
You need `DPC++` to build `dpctl`. If you want to build using the `DPC++` in a
53+
You need DPC++ to build dpctl. If you want to build using the DPC++ in a
5454
oneAPI distribution, activate DPC++ compiler as follows:
5555
```bash
5656
export ONEAPI_ROOT=/opt/intel/oneapi

scripts/build_backend.py

Lines changed: 7 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -34,29 +34,13 @@
3434
else:
3535
assert False, sys.platform + " not supported"
3636

37+
ONEAPI_ROOT = os.environ.get("ONEAPI_ROOT")
3738
CODE_COVERAGE = os.environ.get("CODE_COVERAGE")
38-
DPCPP_HOME = os.environ.get("DPCPP_HOME")
3939

40-
# Check if we want to enable L0 module creation support in dpctl
41-
if os.environ.get("HAS_LO_HEADERS"):
42-
ENABLE_LO_PROGRAM_CREATION = "ON"
43-
else:
44-
ENABLE_LO_PROGRAM_CREATION = "OFF"
45-
46-
# If DPCPP_HOME is not set then look for ONEAPI_ROOT
47-
if not DPCPP_HOME:
48-
ONEAPI_ROOT = os.environ.get("ONEAPI_ROOT")
49-
if not ONEAPI_ROOT:
50-
print("Fatal Error. A dpcpp toolchain is needed to build dpctl.")
51-
import sys
52-
53-
sys.exit()
54-
if IS_LIN:
55-
DPCPP_HOME = os.path.join(ONEAPI_ROOT, r"compiler/latest/linux")
56-
elif IS_WIN:
57-
DPCPP_HOME = os.path.join(ONEAPI_ROOT, r"compiler\latest\windows")
58-
else:
59-
assert False, sys.platform + " not supported"
40+
if IS_LIN:
41+
DPCPP_ROOT = os.path.join(ONEAPI_ROOT, r"compiler/latest/linux")
42+
if IS_WIN:
43+
DPCPP_ROOT = os.path.join(ONEAPI_ROOT, r"compiler\latest\windows")
6044

6145
dpctl_dir = os.getcwd()
6246
build_cmake_dir = os.path.join(dpctl_dir, "build_cmake")
@@ -78,8 +62,7 @@
7862
"-DCMAKE_BUILD_TYPE=Debug",
7963
"-DCMAKE_INSTALL_PREFIX=" + INSTALL_PREFIX,
8064
"-DCMAKE_PREFIX_PATH=" + INSTALL_PREFIX,
81-
"-DDPCPP_INSTALL_DIR=" + DPCPP_HOME,
82-
"-DDPCTL_ENABLE_LO_PROGRAM_CREATION=" + ENABLE_LO_PROGRAM_CREATION,
65+
"-DDPCTL_ENABLE_LO_PROGRAM_CREATION=ON"
8366
"-DDPCTL_BUILD_CAPI_TESTS=ON",
8467
"-DDPCTL_GENERATE_COVERAGE=ON",
8568
"-DDPCTL_COVERAGE_REPORT_OUTPUT_DIR=" + dpctl_dir,
@@ -96,8 +79,7 @@
9679
"-DCMAKE_BUILD_TYPE=Release",
9780
"-DCMAKE_INSTALL_PREFIX=" + INSTALL_PREFIX,
9881
"-DCMAKE_PREFIX_PATH=" + INSTALL_PREFIX,
99-
"-DDPCPP_INSTALL_DIR=" + DPCPP_HOME,
100-
"-DDPCTL_ENABLE_LO_PROGRAM_CREATION=" + ENABLE_LO_PROGRAM_CREATION,
82+
"-DDPCTL_ENABLE_LO_PROGRAM_CREATION=ON",
10183
backends,
10284
]
10385
subprocess.check_call(cmake_args, stderr=subprocess.STDOUT, shell=False)
@@ -115,7 +97,6 @@
11597
"-DCMAKE_BUILD_TYPE=Release",
11698
"-DCMAKE_INSTALL_PREFIX=" + INSTALL_PREFIX,
11799
"-DCMAKE_PREFIX_PATH=" + INSTALL_PREFIX,
118-
"-DDPCPP_INSTALL_DIR=" + DPCPP_HOME,
119100
backends,
120101
]
121102
subprocess.check_call(cmake_args, stderr=subprocess.STDOUT, shell=False)

scripts/build_for_develop.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ fi
1616
export CODE_COVERAGE=ON
1717
python setup.py clean --all
1818
python setup.py develop
19-
pytest --pyargs dpctl -vv
19+
pytest -q -ra --disable-warnings --cov dpctl --cov-report term-missing --pyargs dpctl -vv --cov-config=.coveragerc

setup.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,19 @@
3838
elif sys.platform in ["win32", "cygwin"]:
3939
IS_WIN = True
4040
else:
41-
assert False, "We currently do not build for " + sys.platform
41+
assert False, sys.platform + " not supported"
4242

43-
dpctl_sycl_interface_lib = "dpctl"
44-
dpctl_sycl_interface_include = r"dpctl/include"
43+
if IS_LIN:
44+
os.environ["DPCTL_SYCL_INTERFACE_LIBDIR"] = "dpctl"
45+
os.environ["DPCTL_SYCL_INTERFACE_INCLDIR"] = r"dpctl/include"
46+
os.environ["CFLAGS"] = "-fPIC"
47+
elif IS_WIN:
48+
os.environ["DPCTL_SYCL_INTERFACE_LIBDIR"] = "dpctl"
49+
os.environ["DPCTL_SYCL_INTERFACE_INCLDIR"] = r"dpctl\include"
50+
51+
dpctl_sycl_interface_lib = os.environ["DPCTL_SYCL_INTERFACE_LIBDIR"]
52+
dpctl_sycl_interface_include = os.environ["DPCTL_SYCL_INTERFACE_INCLDIR"]
53+
sycl_lib = os.environ["ONEAPI_ROOT"] + r"\compiler\latest\windows\lib"
4554

4655
# Get long description
4756
with open("README.md", "r", encoding="utf-8") as file:
@@ -120,12 +129,12 @@ def extensions():
120129
elif IS_MAC:
121130
pass
122131
elif IS_WIN:
123-
libs += ["DPCTLSyclInterface"]
132+
libs += ["DPCTLSyclInterface", "sycl"]
124133

125134
if IS_LIN:
126135
librarys = [dpctl_sycl_interface_lib]
127136
elif IS_WIN:
128-
librarys = [dpctl_sycl_interface_lib]
137+
librarys = [dpctl_sycl_interface_lib, sycl_lib]
129138
elif IS_MAC:
130139
librarys = [dpctl_sycl_interface_lib]
131140

0 commit comments

Comments
 (0)