Skip to content

Commit ef1ceed

Browse files
Update package wheel (#268)
* Update packages wheel deps * Make wheel version public-like * Fix package version * Remove install_requires * Append cflags and ldflags from env to build * Fix issues * Fix issue with external flags * Add wheel install description to readme * Fix formatting * Fix readme format
1 parent 58cb0a3 commit ef1ceed

File tree

2 files changed

+39
-10
lines changed

2 files changed

+39
-10
lines changed

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,25 @@ For development:
6565
python setup.py develop
6666
```
6767

68+
Install Wheel Package from Pypi
69+
==================================
70+
1. Install dpCtl
71+
```cmd
72+
python -m pip install --index-url https://pypi.anaconda.org/intel/simple -extra-index-url https://pypi.org/simple dpctl
73+
```
74+
Note: dpCtl wheel package is placed on Pypi, but some of its dependencies (like Intel numpy) are in Anaconda Cloud.
75+
That is why install command requires additional intel Pypi channel from Anaconda Cloud.
76+
77+
2. Set path to Performance Libraries in case of using venv or system Python:
78+
On Linux:
79+
```cmd
80+
export LD_LIBRARY_PATH=<path_to_your_env>/lib
81+
```
82+
On Windows:
83+
```cmd
84+
set PATH=<path_to_your_env>\bin;<path_to_your_env>\Library\bin;%PATH%
85+
```
86+
6887
Using dpCtl
6988
===========
7089
dpCtl relies on DPC++ runtime. With Intel oneAPI installed you could activate it.

setup.py

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,29 +55,37 @@
5555
dpctl_sycl_interface_include = os.environ["DPCTL_SYCL_INTERFACE_INCLDIR"]
5656
sycl_lib = os.environ["ONEAPI_ROOT"] + "\compiler\latest\windows\lib"
5757

58+
# Get long description
59+
with open("README.md", "r", encoding="utf-8") as file:
60+
long_description = file.read()
61+
5862

5963
def get_sdl_cflags():
64+
cflags = []
6065
if IS_LIN or IS_MAC:
61-
return [
66+
cflags = [
6267
"-fstack-protector",
6368
"-fPIC",
6469
"-D_FORTIFY_SOURCE=2",
6570
"-Wformat",
6671
"-Wformat-security",
6772
]
68-
elif IS_WIN:
69-
return []
73+
# Add cflags from environment
74+
cflags += os.getenv("CFLAGS", "").split(" ")
75+
76+
return cflags
7077

7178

7279
def get_sdl_ldflags():
80+
ldflags = []
7381
if IS_LIN:
74-
return [
75-
"-Wl,-z,noexecstack,-z,relro,-z,now",
76-
]
77-
elif IS_MAC:
78-
return []
82+
ldflags = ["-Wl,-z,noexecstack,-z,relro,-z,now"]
7983
elif IS_WIN:
80-
return ["/NXCompat", "/DynamicBase"]
84+
ldflags = ["/NXCompat", "/DynamicBase"]
85+
# Add ldflags from environment
86+
ldflags += os.getenv("LDFLAGS", "").split(" ")
87+
88+
return ldflags
8189

8290

8391
def get_other_cxxflags():
@@ -237,9 +245,11 @@ def _get_cmdclass():
237245

238246
setup(
239247
name="dpctl",
240-
version=versioneer.get_version(),
248+
version=versioneer.get_version().split("+")[0],
241249
cmdclass=_get_cmdclass(),
242250
description="A lightweight Python wrapper for a subset of OpenCL and SYCL.",
251+
long_description=long_description,
252+
long_description_content_type="text/markdown",
243253
license="Apache 2.0",
244254
author="Intel Corporation",
245255
url="https://github.com/IntelPython/dpCtl",

0 commit comments

Comments
 (0)