-
-
Notifications
You must be signed in to change notification settings - Fork 173
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* build python3 packages of pycuda and pynvml * add dependency - also for python3 server * python3 string fixes, None vs int * python3 dict keys aren't lists * python3 needs to use temporary numpy array to upload bytearray git-svn-id: https://xpra.org/svn/Xpra/trunk@16399 3bb7dfac-3a0b-4e04-842a-767bc560f471
- Loading branch information
Showing
6 changed files
with
149 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,20 @@ | ||
%{!?__python2: %global __python2 /usr/bin/python2} | ||
# This file is part of Xpra. | ||
# Copyright (C) 2014-2017 Antoine Martin <[email protected]> | ||
# Xpra is released under the terms of the GNU GPL v2, or, at your option, any | ||
# later version. See the file COPYING for details. | ||
|
||
%{!?__python2: %global __python2 python2} | ||
%{!?__python3: %define __python3 python3} | ||
%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} | ||
%{!?python3_sitearch: %global python3_sitearch %(%{__python3} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} | ||
|
||
#we don't want to depend on libcuda via RPM dependencies | ||
#so that we can install NVidia drivers without using RPM packages: | ||
%define __requires_exclude ^libcuda.*$ | ||
|
||
Name: python2-pycuda | ||
Version: 2017.1 | ||
Release: 1 | ||
Release: 2 | ||
URL: http://mathema.tician.de/software/pycuda | ||
Summary: Python wrapper CUDA | ||
License: MIT | ||
|
@@ -29,16 +36,42 @@ BuildRequires: python-setuptools | |
%else | ||
BuildRequires: python-distribute | ||
%endif | ||
BuildRequires: boost-devel | ||
BuildRequires: numpy | ||
BuildRequires: boost-devel | ||
BuildRequires: cuda | ||
|
||
|
||
%description | ||
PyCUDA lets you access Nvidia‘s CUDA parallel computation API from Python. | ||
|
||
|
||
%if 0%{?fedora} | ||
%package -n python3-pycuda | ||
Summary: Python3 wrapper CUDA | ||
License: MIT | ||
Group: Development/Libraries/Python | ||
|
||
Requires: python3-decorator | ||
Requires: python3-numpy | ||
Requires: python3-pytools | ||
|
||
BuildRequires: gcc-c++ | ||
BuildRequires: python3-devel | ||
BuildRequires: python3-setuptools | ||
BuildRequires: python3-numpy | ||
BuildRequires: boost-devel | ||
BuildRequires: cuda | ||
|
||
%description -n python3-pycuda | ||
Python3 version. | ||
%endif | ||
|
||
%prep | ||
%setup -q -n pycuda-%{version} | ||
%if 0%{?fedora} | ||
rm -fr %{py3dir} | ||
cp -a . %{py3dir} | ||
%endif | ||
|
||
|
||
%build | ||
%{__python2} ./configure.py \ | ||
|
@@ -52,10 +85,32 @@ PyCUDA lets you access Nvidia‘s CUDA parallel computation API from Python. | |
# --boost-python-libname=boost_python-mt \ | ||
# --boost-thread-libname=boost_thread | ||
%{__python2} setup.py build | ||
%if 0%{?fedora} | ||
pushd %{py3dir} | ||
%{__python3} ./setup.py clean | ||
rm -f siteconf.py | ||
%{__python3} ./configure.py \ | ||
--cuda-enable-gl \ | ||
--cuda-root=/usr/local/cuda \ | ||
--cudadrv-lib-dir=/usr/local/lib64 \ | ||
--cudadrv-lib-dir=%{_libdir} \ | ||
--boost-inc-dir=%{_includedir} \ | ||
--boost-lib-dir=%{_libdir} \ | ||
--no-cuda-enable-curand | ||
# --boost-python-libname=boost_python-mt \ | ||
# --boost-thread-libname=boost_thread | ||
%{__python3} setup.py build | ||
popd | ||
%endif | ||
make | ||
|
||
%install | ||
%{__python2} setup.py install --prefix=%{_prefix} --root=%{buildroot} | ||
%if 0%{?fedora} | ||
pushd %{py3dir} | ||
%{__python3} setup.py install --prefix=%{_prefix} --root=%{buildroot} | ||
popd | ||
%endif | ||
|
||
%clean | ||
rm -rf %{buildroot} | ||
|
@@ -65,7 +120,17 @@ rm -rf %{buildroot} | |
%doc examples/ test/ | ||
%{python2_sitearch}/pycuda* | ||
|
||
%if 0%{?fedora} | ||
%files -n python3-pycuda | ||
%defattr(-,root,root) | ||
%doc examples/ test/ | ||
%{python3_sitearch}/pycuda* | ||
%endif | ||
|
||
%changelog | ||
* Tue Jul 18 2017 Antoine Martin <[email protected]> - 2017.1-2 | ||
- build python3 variant too | ||
|
||
* Thu Jun 01 2017 Antoine Martin <[email protected]> - 2017.1-1 | ||
- new upstream release | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,19 @@ | ||
%{!?__python2: %global __python2 /usr/bin/python2} | ||
%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} | ||
# This file is part of Xpra. | ||
# Copyright (C) 2015-2017 Antoine Martin <[email protected]> | ||
# Xpra is released under the terms of the GNU GPL v2, or, at your option, any | ||
# later version. See the file COPYING for details. | ||
|
||
%{!?__python2: %global __python2 python2} | ||
%{!?__python3: %define __python3 python3} | ||
%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} | ||
%{!?python3_sitearch: %global python3_sitearch %(%{__python3} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} | ||
|
||
#this is a pure python package so debug is meaningless here: | ||
%define debug_package %{nil} | ||
|
||
Name: python2-pynvml | ||
Version: 7.352.0 | ||
Release: 1 | ||
Release: 2 | ||
URL: http://pythonhosted.org/nvidia-ml-py/ | ||
Summary: Python wrapper for NVML | ||
License: BSD | ||
|
@@ -15,18 +22,37 @@ Source: https://pypi.python.org/packages/72/31/378ca145e919ca415641a0f17 | |
BuildRoot: %{_tmppath}/%{name}-%{version}-build | ||
Provides: python-pynvml | ||
|
||
|
||
%description | ||
Python Bindings for the NVIDIA Management Library | ||
|
||
%if 0%{?fedora} | ||
%package -n python3-pynvml | ||
Summary: Python3 wrapper for NVML | ||
License: BSD | ||
Group: Development/Libraries/Python | ||
|
||
%description -n python3-pynvml | ||
Python Bindings for the NVIDIA Management Library | ||
%endif | ||
|
||
%prep | ||
%setup -q -n nvidia-ml-py-%{version} | ||
|
||
%build | ||
%{__python2} ./setup.py build | ||
%if 0%{?fedora} | ||
rm -fr %{py3dir} | ||
cp -r . %{py3dir} | ||
find %{py3dir} -name "*.py" -exec 2to3 -w {} \; | ||
%endif | ||
|
||
%install | ||
%{__python2} ./setup.py install --prefix=%{_prefix} --root=%{buildroot} | ||
%if 0%{?fedora} | ||
pushd %{py3dir} | ||
%{__python3} ./setup.py install --prefix=%{_prefix} --root=%{buildroot} | ||
popd | ||
%endif | ||
|
||
%clean | ||
rm -rf %{buildroot} | ||
|
@@ -37,7 +63,20 @@ rm -rf %{buildroot} | |
%{python2_sitelib}/nvidia_smi.py* | ||
%{python2_sitelib}/nvidia_ml_py-%{version}-py*.egg-info | ||
|
||
%if 0%{?fedora} | ||
%files -n python3-pynvml | ||
%defattr(-,root,root) | ||
%{python3_sitelib}/__pycache__/nvidia* | ||
%{python3_sitelib}/__pycache__/pynvml* | ||
%{python3_sitelib}/pynvml.py* | ||
%{python3_sitelib}/nvidia_smi.py* | ||
%{python3_sitelib}/nvidia_ml_py-%{version}-py*.egg-info | ||
%endif | ||
|
||
%changelog | ||
* Tue Jul 18 2017 Antoine Martin <[email protected]> - 7.352.0-2 | ||
- build python3 variant too | ||
|
||
* Mon Aug 29 2016 Antoine Martin <[email protected]> - 7.352.0-1 | ||
- build newer version | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# This file is part of Xpra. | ||
# Copyright (C) 2010-2016 Antoine Martin <[email protected]> | ||
# Copyright (C) 2010-2017 Antoine Martin <[email protected]> | ||
# Xpra is released under the terms of the GNU GPL v2, or, at your option, any | ||
# later version. See the file COPYING for details. | ||
|
||
|
@@ -317,7 +317,10 @@ BuildRequires: pam-devel | |
BuildRequires: gcc | ||
BuildRequires: %{requires_cython} | ||
%ifarch x86_64 | ||
%if 0%{?fedora} | ||
%{Recommends}: python2-pynvml | ||
%{Recommends}: python2-pycuda | ||
%endif | ||
%endif | ||
%description -n python2-xpra-server | ||
This package contains the python2 xpra server. | ||
|
@@ -413,6 +416,12 @@ Recommends: gtk3-immodule-xim | |
Recommends: python3-setproctitle | ||
BuildRequires: gcc, gcc-c++ | ||
BuildRequires: python3-Cython | ||
%ifarch x86_64 | ||
%if 0%{?fedora} | ||
%{Recommends}: python3-pynvml | ||
%{Recommends}: python3-pycuda | ||
%endif | ||
%endif | ||
%description -n python3-xpra-server | ||
This package contains the python3 xpra server. | ||
%endif | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters