Skip to content

Commit a731a5c

Browse files
author
Kent Knox
committed
Updated setup.py file to add appropriate paths for 64-bit and Linux
1 parent eb01ea2 commit a731a5c

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

src/wrappers/python/README.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Dependencies:
99
3. Cython from http://cython.org/, ( 0.18 minimum )
1010
4. OpenCL runtime, such as AMD's catalyst package ( AMD v2.9 SDK tested )
1111

12-
NOTE: This has only been tested with 32-bit python on windows
12+
NOTE: This has been tested with 32-bit python on windows & 64-bit on OpenSUSE
1313

1414
NOTE: Only sgemm has been wrapped as proof-of-concept
1515

src/wrappers/python/setup.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
from Cython.Distutils import build_ext
2020
from os import path, environ
2121
import argparse
22+
import platform
2223

2324
def main():
2425
parser = argparse.ArgumentParser(description='Set up the pyclBLAS extension module')
@@ -70,12 +71,22 @@ def main():
7071
print( "or pass the command line option --clBlasRoot" )
7172
exit( )
7273

74+
# 64bit and 32bit have different library paths
75+
if( platform.architecture( )[0] == '64bit' ):
76+
libraryPath = 'lib64'
77+
else:
78+
libraryPath = 'lib'
79+
80+
# Windows and linux have different library paths
81+
if( platform.system( ) == 'Windows' ):
82+
libraryPath = path.join( libraryPath, 'import' )
83+
7384
module = [
7485
Extension( name = 'pyclBLAS',
7586
sources = ['pyclBLAS.pyx'],
7687
include_dirs = [ path.join( clRootPath, 'include' ),
7788
path.join( clBlasRootPath, 'include' ) ],
78-
library_dirs = [ path.join( clBlasRootPath, 'lib', 'import' ) ],
89+
library_dirs = [ path.join( clBlasRootPath, libraryPath ) ],
7990
libraries=['clBLAS'] )
8091
]
8192

0 commit comments

Comments
 (0)