[Numpy-discussion] numarray patch: use Apple's vecLib on Mac OS X

Andrea Riciputi ariciputi at pito.com
Mon Nov 22 05:01:14 EST 2004


Hi,
I've noticed your patch for MacOS X, and I think that a better solution  
should use sys.platform instead of a path search, since Apple could  
always change its framework location. I've also removed the  
VECLIB_PATH/Headers from the include path because AFAIK Apple gcc  
already knows where to search for the vecLib framework. Here it is a  
diff output between my addons.py and the CVS one.

HTH,
   Andrea.


> ** /Users/andrea/Installs/numarray-1.1.1/addons-mine.py        Mon Nov  
> 22 12:39:58 2004
> --- /Users/andrea/Installs/numarray-1.1.1/addons-cvs.py Fri Nov 19  
> 10:40:45 2004
> ***************
> *** 63,73 ****
>
>       # lapack_dirs = ['/home/jmiller/work/lib']
>
> !     if sys.platform == "darwin":
> !         lapack_include_dirs =   
> ["Packages/LinearAlgebra2/Src",'Include/numarray']
>           lapack_libs = []
>           lapack_dirs = []
> -         lapack_link_args = ['-framework', 'vecLib']
>
>   ADDONS_DATA_FILES = [('numarray/ma', ['Packages/MA/Legal.htm'])]
>
> --- 63,74 ----
>
>       # lapack_dirs = ['/home/jmiller/work/lib']
>
> !     VECLIB_PATH = '/System/Library/Frameworks/vecLib.framework'
> !     if os.path.exists(VECLIB_PATH):
> !         lapack_link_args = ['-framework', 'vecLib']
> !         lapack_include_dirs.append( os.path.join(VECLIB_PATH,  
> 'Headers'))
>           lapack_libs = []
>           lapack_dirs = []
>
>   ADDONS_DATA_FILES = [('numarray/ma', ['Packages/MA/Legal.htm'])]


On 18 Nov 2004, at 16:53, Andrew Straw wrote:

> Hi all,
>
> Here's a patch for numarray (against current CVS) to build using  
> Apple's vecLib (optimized BLAS library) on Mac OS X.  This was  
> inspired by/stolen from Bob Ippolito's recent Numeric patch (  
> http://mail.python.org/pipermail/pythonmac-sig/2004-November/ 
> 012077.html ). To build with vecLib, set the environment variable  
> USE_LAPACK=1.  I can test any modifications needed to incorporate this  
> into the main release.  After building with this patch (both with and  
> without vecLib) I ran Lib/testall.py with no problems -- are there  
> more tests I should do?
>
> Cheers!
> Andrew
>
> Index: addons.py
> ===================================================================
> RCS file: /cvsroot/numpy/numarray/addons.py,v
> retrieving revision 1.8
> diff -c -r1.8 addons.py
> *** addons.py	3 Nov 2004 15:06:33 -0000	1.8
> --- addons.py	18 Nov 2004 15:43:01 -0000
> ***************
> *** 24,31 ****
> --- 24,33 ----
>           os.path.join('Packages/LinearAlgebra2/Src',  
> 'zlapack_lite.c'),
>           os.path.join('Packages/LinearAlgebra2/Src', 'dlapack_lite.c')
>           ]
> +     lapack_include_dirs = ["Packages/LinearAlgebra2/Src",  
> 'Include/numarray']
>       lapack_libs = []
>       lapack_dirs = []
> +     lapack_link_args = []
>   else:
>       sourcelist = [
>           os.path.join('Packages/LinearAlgebra2/Src',  
> 'lapack_litemodule.c'),
> ***************
> *** 53,58 ****
> --- 55,70 ----
>
>       # lapack_dirs = ['/home/jmiller/work/lib']
>
> +     lapack_link_args = []
> +     lapack_include_dirs = ["Packages/LinearAlgebra2/Src",  
> 'Include/numarray']
> +
> +     VECLIB_PATH = '/System/Library/Frameworks/vecLib.framework'
> +     if os.path.exists(VECLIB_PATH):
> +         lapack_link_args = ['-framework', 'vecLib']
> +         lapack_include_dirs.append( os.path.join(VECLIB_PATH,  
> 'Headers'))
> +         lapack_libs = []
> +         lapack_dirs = []
> +
>   ADDONS_DATA_FILES = [('numarray/ma', ['Packages/MA/Legal.htm'])]
>
>   ADDONS_PACKAGES = ["numarray.convolve",
> ***************
> *** 102,110 ****
>                 include_dirs =  
> ['Packages/FFT2/Include','Include/numarray']),
>       Extension('numarray.linear_algebra.lapack_lite2',
>                 sourcelist,
> !               include_dirs = ["Packages/LinearAlgebra2/Src",  
> 'Include/numarray'],
>                 library_dirs = lapack_dirs,
> !               libraries = lapack_libs),
>       Extension("numarray.random_array.ranlib2",
>                 ["Packages/RandomArray2/Src/ranlib.c",
>                  "Packages/RandomArray2/Src/ranlibmodule.c",
> --- 114,124 ----
>                 include_dirs =  
> ['Packages/FFT2/Include','Include/numarray']),
>       Extension('numarray.linear_algebra.lapack_lite2',
>                 sourcelist,
> !               include_dirs = lapack_include_dirs,
>                 library_dirs = lapack_dirs,
> !               libraries = lapack_libs,
> !               extra_link_args = lapack_link_args,
> !               ),
>       Extension("numarray.random_array.ranlib2",
>                 ["Packages/RandomArray2/Src/ranlib.c",
>                  "Packages/RandomArray2/Src/ranlibmodule.c",
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: InterSystems CACHE
> FREE OODBMS DOWNLOAD - A multidimensional database that combines
> robust object and relational technologies, making it a perfect match
> for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8
> _______________________________________________
> Numpy-discussion mailing list
> Numpy-discussion at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/numpy-discussion
>





More information about the NumPy-Discussion mailing list