Skip to content

Commit

Permalink
pygpu: fix linking with gpuarray (spack#17033)
Browse files Browse the repository at this point in the history
* add build_ext_args to link pygpu with gpuarray
* libgpuarray: add version 0.7.6
  • Loading branch information
bhatiaharsh authored Jun 12, 2020
1 parent 804b6f2 commit cb20f01
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
1 change: 1 addition & 0 deletions var/spack/repos/builtin/packages/libgpuarray/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class Libgpuarray(CMakePackage):
homepage = "http://deeplearning.net/software/libgpuarray/"
url = "https://github.com/Theano/libgpuarray/archive/v0.6.1.tar.gz"

version('0.7.6', sha256='ad1c00dd47c3d36ee1708e5167377edbfcdb7226e837ef9c68b841afbb4a4f6a')
version('0.7.5', sha256='39c4d2e743848be43c8819c736e089ae51b11aa446cc6ee05af945c2dfd63420')
version('0.7.2', sha256='ef11ee6f8d62d53831277fd3dcab662aa770a5b5de2d30fe3018c4af959204da')
version('0.7.1', sha256='4d0f9dd63b0595a8c04d8cee91b2619847c033b011c71d776caa784322382ed6')
Expand Down
16 changes: 15 additions & 1 deletion var/spack/repos/builtin/packages/py-pygpu/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# SPDX-License-Identifier: (Apache-2.0 OR MIT)

from spack import *
import os


class PyPygpu(PythonPackage):
Expand All @@ -12,6 +13,7 @@ class PyPygpu(PythonPackage):
homepage = "http://deeplearning.net/software/libgpuarray/"
url = "https://github.com/Theano/libgpuarray/archive/v0.6.1.tar.gz"

version('0.7.6', sha256='ad1c00dd47c3d36ee1708e5167377edbfcdb7226e837ef9c68b841afbb4a4f6a')
version('0.7.5', sha256='39c4d2e743848be43c8819c736e089ae51b11aa446cc6ee05af945c2dfd63420')
version('0.7.2', sha256='ef11ee6f8d62d53831277fd3dcab662aa770a5b5de2d30fe3018c4af959204da')
version('0.7.1', sha256='4d0f9dd63b0595a8c04d8cee91b2619847c033b011c71d776caa784322382ed6')
Expand All @@ -21,11 +23,23 @@ class PyPygpu(PythonPackage):
version('0.6.1', sha256='b2466311e0e3bacdf7a586bba0263f6d232bf9f8d785e91ddb447653741e6ea5')
version('0.6.0', sha256='a58a0624e894475a4955aaea25e82261c69b4d22c8f15ec07041a4ba176d35af')

depends_on('libgpuarray')
depends_on('[email protected]', when='@0.7.6')
depends_on('[email protected]', when='@0.7.5')
depends_on('libgpuarray') # default
# not just build-time, requires pkg_resources
depends_on('py-setuptools', type=('build', 'run'))
depends_on('[email protected]:', type=('build', 'run'))
depends_on('py-nose', type=('build', 'run'))
depends_on('py-numpy', type=('build', 'run'))
depends_on('py-mako', type=('build', 'run'))
depends_on('check')

phases = ['build_ext', 'install']

def build_ext_args(self, spec, prefix):

_ = self.spec['libgpuarray'].prefix
include_flags = '-I{0}'.format(os.path.join(_, 'include'))
library_flags = '-L{0}'.format(os.path.join(_, 'lib'))

return [include_flags, library_flags]

0 comments on commit cb20f01

Please sign in to comment.