use the Accelerate framework on Darwin instead of the obsolete vecLib

This commit is contained in:
dbj 2015-01-27 05:04:06 +00:00
parent a4e4a24a87
commit 036f13cda8
8 changed files with 124 additions and 25 deletions

View file

@ -1,8 +1,8 @@
$NetBSD: distinfo,v 1.15 2007/12/27 14:07:25 joerg Exp $ $NetBSD: distinfo,v 1.16 2015/01/27 05:04:06 dbj Exp $
SHA1 (Numeric-24.2.tar.gz) = 72869ef80c12630a9a125ba10c96093b6ae16aff SHA1 (Numeric-24.2.tar.gz) = 72869ef80c12630a9a125ba10c96093b6ae16aff
RMD160 (Numeric-24.2.tar.gz) = c9502db28663558c535e236392c9beddec9743bb RMD160 (Numeric-24.2.tar.gz) = c9502db28663558c535e236392c9beddec9743bb
Size (Numeric-24.2.tar.gz) = 743800 bytes Size (Numeric-24.2.tar.gz) = 743800 bytes
SHA1 (patch-aa) = 31920706522b5730644da8191e0c1c8191d4add1 SHA1 (patch-aa) = 31920706522b5730644da8191e0c1c8191d4add1
SHA1 (patch-ab) = 35dd9debd94e9cea059d0802149192e7ecdcf938
SHA1 (patch-ac) = 45ca40e38123dc72ec42b3775b2401c0037674c0 SHA1 (patch-ac) = 45ca40e38123dc72ec42b3775b2401c0037674c0
SHA1 (patch-setup.py) = a7dab66b75c2bb5a75e8d841ef2ebe15d8b7176c

View file

@ -1,19 +0,0 @@
$NetBSD: patch-ab,v 1.10 2007/12/27 14:07:25 joerg Exp $
--- setup.py.orig 2007-12-21 23:31:57.000000000 +0100
+++ setup.py
@@ -15,12 +15,8 @@ if not hasattr(sys, 'version_info') or s
raise SystemExit, "Python 2.0 or later required to build Numeric."
from glob import glob
-try:
- from setuptools import setup
- have_setuptools = 1
-except ImportError:
- from distutils.core import setup
- have_setuptools = 0
+from distutils.core import setup
+have_setuptools = 0
from distutils.core import Extension
from distutils.command.config import config
from distutils.sysconfig import get_config_var, customize_compiler

View file

@ -0,0 +1,59 @@
$NetBSD: patch-setup.py,v 1.1 2015/01/27 05:04:06 dbj Exp $
--- setup.py.orig 2005-11-11 08:56:59.000000000 +0000
+++ setup.py
@@ -15,12 +15,8 @@ if not hasattr(sys, 'version_info') or s
raise SystemExit, "Python 2.0 or later required to build Numeric."
from glob import glob
-try:
- from setuptools import setup
- have_setuptools = 1
-except ImportError:
- from distutils.core import setup
- have_setuptools = 0
+from distutils.core import setup
+have_setuptools = 0
from distutils.core import Extension
from distutils.command.config import config
from distutils.sysconfig import get_config_var, customize_compiler
@@ -128,10 +124,10 @@ elif sys.platform in ['mac', 'beos5']:
if os.path.isfile(os.path.join("Src","config.h")):
extra_compile_args.append('-DHAVE_CONFIG')
-# For Mac OS X >= 10.2, an optimized BLAS and most of LAPACK (all the
+# For Mac OS X >= 10.3, an optimized BLAS and most of LAPACK (all the
# routines we need, at least) should already be installed
-VECLIB_PATH = '/System/Library/Frameworks/vecLib.framework'
-have_veclib = os.path.exists(VECLIB_PATH)
+ACCELERATE_PATH = '/System/Library/Frameworks/Accelerate.framework'
+have_accelerate = os.path.exists(ACCELERATE_PATH)
def extension(name, sources, **kw):
def prepend(name, value, kw=kw):
@@ -146,8 +142,8 @@ lapack_source = [path('Src/lapack_litemo
lapack_link_args = customize.lapack_extra_link_args
if customize.use_system_lapack:
pass
-elif have_veclib:
- lapack_link_args.extend(['-framework', 'vecLib'])
+elif have_accelerate:
+ lapack_link_args.extend(['-framework', 'Accelerate'])
else:
lapack_source.extend([path('Src/f2c_lite.c'),
path('Src/zlapack_lite.c'),
@@ -172,11 +168,10 @@ if customize.use_dotblas:
customize.dotblas_cblas_header)],
extra_link_args=customize.dotblas_extra_link_args,
)
-elif have_veclib:
+elif have_accelerate:
dotblas_ext = extension('_dotblas', dotblas_source,
- include_dirs=[os.path.join(VECLIB_PATH, 'Headers')],
- define_macros=[('CBLAS_HEADER', '<cblas.h>')],
- extra_link_args=['-framework', 'vecLib'],
+ define_macros=[('CBLAS_HEADER', '<Accelerate/Accelerate.h>')],
+ extra_link_args=['-framework', 'Accelerate'],
)
else:
dotblas_ext = None

View file

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.19 2014/05/09 07:37:11 wiz Exp $ # $NetBSD: Makefile,v 1.20 2015/01/27 05:05:30 dbj Exp $
DISTNAME= numarray-1.5.2 DISTNAME= numarray-1.5.2
PKGNAME= ${PYPKGPREFIX}-numarray-1.5.2 PKGNAME= ${PYPKGPREFIX}-numarray-1.5.2
@ -11,8 +11,7 @@ HOMEPAGE= http://www.numpy.org/old_array_packages.html
COMMENT= Array manipulation COMMENT= Array manipulation
PLIST_VARS+= blas PLIST_VARS+= blas
.if exists(/System/Library/Frameworks/vecLib.framework/Headers) .if exists(/System/Library/Frameworks/Accelerate.framework)
BUILDLINK_PASSTHRU_DIRS+= /System/Library/Frameworks/vecLib.framework/Headers
PLIST.blas= yes PLIST.blas= yes
.endif .endif

View file

@ -1,6 +1,9 @@
$NetBSD: distinfo,v 1.8 2006/10/17 14:25:43 drochner Exp $ $NetBSD: distinfo,v 1.9 2015/01/27 05:05:30 dbj Exp $
SHA1 (numarray-1.5.2.tar.gz) = 17f6c4bb5f0d97e93923b8ca4f55fccc1ee985e9 SHA1 (numarray-1.5.2.tar.gz) = 17f6c4bb5f0d97e93923b8ca4f55fccc1ee985e9
RMD160 (numarray-1.5.2.tar.gz) = 51cc7681958cada32c515872e8def6fc0ff296ca RMD160 (numarray-1.5.2.tar.gz) = 51cc7681958cada32c515872e8def6fc0ff296ca
Size (numarray-1.5.2.tar.gz) = 1196014 bytes Size (numarray-1.5.2.tar.gz) = 1196014 bytes
SHA1 (patch-Include_numarray_arraybase.h) = 4ea0b49b50a7cb0e9c9cb539eab5e750584795f7
SHA1 (patch-Src___dotblas.c) = fcb6109d0c73ad50e0c33c79d6655a1b4cfeca0d
SHA1 (patch-aa) = 6edaab221c6d52a47e5a52b3039e37b8fef814b1 SHA1 (patch-aa) = 6edaab221c6d52a47e5a52b3039e37b8fef814b1
SHA1 (patch-cfg__packages.py) = 6ded69dabce1942624daa588fe3c64ef67758e34

View file

@ -0,0 +1,17 @@
$NetBSD: patch-Include_numarray_arraybase.h,v 1.1 2015/01/27 05:05:30 dbj Exp $
--- Include/numarray/arraybase.h.orig 2006-01-23 11:45:03.000000000 +0000
+++ Include/numarray/arraybase.h
@@ -42,7 +42,12 @@ typedef struct { Float64 r, i; } Complex
#if LP64
typedef long int Int64;
+#ifdef __APPLE__
+/* match the definition in MacTypes.h */
+typedef unsigned long long UInt64;
+#else
typedef unsigned long int UInt64;
+#endif
typedef Int64 Long;
#else /* 32-bit platforms */
typedef Int32 Long;

View file

@ -0,0 +1,16 @@
$NetBSD: patch-Src___dotblas.c,v 1.1 2015/01/27 05:05:30 dbj Exp $
--- Src/_dotblas.c.orig 2006-07-24 20:11:35.000000000 +0000
+++ Src/_dotblas.c
@@ -12,7 +12,11 @@ static char module_doc[] =
#include "Python.h"
#include "libnumarray.h"
#include "arrayobject.h"
+#ifdef __APPLE__
+#include <Accelerate/Accelerate.h>
+#else
#include <cblas.h>
+#endif
#include <stdio.h>

View file

@ -0,0 +1,24 @@
$NetBSD: patch-cfg__packages.py,v 1.1 2015/01/27 05:05:30 dbj Exp $
The vecLib framework has been obsolete since at least osx 10.3
use the Accelerate framework instead
--- cfg_packages.py.orig 2005-07-21 13:57:10.000000000 +0000
+++ cfg_packages.py
@@ -28,13 +28,12 @@ if USE_LAPACK:
lapack_link_args = []
lapack_include_dirs = ["Packages/LinearAlgebra2/Src"]
- if os.path.exists('/System/Library/Frameworks/vecLib.framework'):
+ if os.path.exists('/System/Library/Frameworks/Accelerate.framework'):
# use Apple's optimized BLAS implementation
lapack_libs = []
- lapack_link_args = ['-framework', 'vecLib']
- lapack_compile_args = ['-framework', 'vecLib']
+ lapack_link_args = ['-framework', 'Accelerate']
+ lapack_compile_args = ['-framework', 'Accelerate']
lapack_dirs = []
- lapack_include_dirs += ['/System/Library/Frameworks/vecLib.framework/Headers']
elif USE_ABSOFT: # Absoft Fortran
lapack_dirs = ['/usr/local/lib/atlas', '/opt/absoft/lib']
lapack_libs = ['lapack', 'f77blas', 'cblas', 'atlas',