[79045] trunk/dports/python/py-numpy
ryandesign at macports.org
ryandesign at macports.org
Mon May 30 23:35:21 PDT 2011
Revision: 79045
http://trac.macports.org/changeset/79045
Author: ryandesign at macports.org
Date: 2011-05-30 23:35:21 -0700 (Mon, 30 May 2011)
Log Message:
-----------
py-numpy: update to 1.6.0 and backport other changes from py25-numpy
Modified Paths:
--------------
trunk/dports/python/py-numpy/Portfile
trunk/dports/python/py-numpy/files/patch-f2py_setup.py.diff
Added Paths:
-----------
trunk/dports/python/py-numpy/files/patch-fcompiler_g95.diff
trunk/dports/python/py-numpy/files/patch-numpy_linalg_setup.py.diff
trunk/dports/python/py-numpy/files/patch-setup.py.diff
trunk/dports/python/py-numpy/files/patch-system_info.py.diff
Removed Paths:
-------------
trunk/dports/python/py-numpy/files/patch-g95_link.diff
Modified: trunk/dports/python/py-numpy/Portfile
===================================================================
--- trunk/dports/python/py-numpy/Portfile 2011-05-31 06:29:06 UTC (rev 79044)
+++ trunk/dports/python/py-numpy/Portfile 2011-05-31 06:35:21 UTC (rev 79045)
@@ -5,7 +5,7 @@
PortGroup python24 1.0
name py-numpy
-version 1.4.1
+version 1.6.0
categories python
platforms darwin
maintainers dh openmaintainer
@@ -16,18 +16,112 @@
master_sites sourceforge:numpy
distname numpy-${version}
-checksums md5 5c7b5349dc3161763f7f366ceb96516b \
- sha1 ec6078aa09acbcca3d90f9f36353fc83e7e1daa0 \
- rmd160 a0bbebd1138ffc93517095e3c06459cd9744a9d6
+checksums md5 e0993c74cb8e83292e560eac1a9be8e9 \
+ sha1 0692acfb5cdc55ca251aa2b950e321a662810c36 \
+ rmd160 29bee854e1436e0baad46150606d7a0d2d80ac61
-patchfiles patch-f2py_setup.py.diff
+patchfiles patch-f2py_setup.py.diff \
+ patch-system_info.py.diff \
+ patch-fcompiler_g95.diff
depends_lib-append port:fftw-3 \
port:py-nose
+if {[variant_isset universal] && ![variant_isset atlas]} {
+ build.env-append ARCHFLAGS="${configure.universal_ldflags}"
+} else {
+ build.env-append ARCHFLAGS="${configure.ld_archflags}"
+}
+
+variant atlas \
+description {Use the MacPorts' ATLAS libraries \
+ instead of Apple's Accelerate framework} {
+ build.env-append ATLAS=${prefix}/lib \
+ LAPACK=${prefix}/lib \
+ BLAS=${prefix}/lib
+ destroot.env-append ATLAS=${prefix}/lib \
+ LAPACK=${prefix}/lib \
+ BLAS=${prefix}/lib
+ depends_lib-append port:atlas
+}
+
+# use ATLAS by default; if MacPorts' ATLAS is not used, numpy will
+# link with that supplied by Apple's Accelerate framework.
+default_variants +atlas
+
+# when using ATLAS (whether by default or specified by the user via
+# the +atlas variant) ...
+set gcc_version ""
+if {[variant_isset atlas]} {
+ universal_variant no
+
+ # see if the user has set -gcc4X to disable using MacPorts'
+ # compiler; if not, either use what the user set (as +gcc4X) or
+ # default to gcc44.
+
+ variant gcc43 conflicts gcc44 gcc45 \
+ description {Use the gcc43 compiler (enables fortran linking)} {}
+
+ variant gcc44 conflicts gcc43 gcc45 \
+ description {Use the gcc44 compiler (enables fortran linking)} {}
+
+ variant gcc45 conflicts gcc43 gcc44 \
+ description {Use the gcc45 compiler (enables fortran linking)} {}
+
+ if {![variant_isset gcc43] && ![variant_isset gcc45]} {
+ default_variants +gcc44
+ }
+ if {[variant_isset gcc43]} {
+ set gcc_version "4.3"
+ } elseif {[variant_isset gcc44]} {
+ set gcc_version "4.4"
+ } elseif {[variant_isset gcc45]} {
+ set gcc_version "4.5"
+ }
+
+ # when using non-Apple GCC for universal install, it can
+ # create binaries only for the native OS architecture, at
+ # either 32 or 64 bits. Restrict the supported archs
+ # accordingly.
+ if {${os.arch} == "i386"} {
+ supported_archs i386 x86_64
+ } elseif {${os.arch} == "powerpc"} {
+ supported_archs ppc ppc64
+ }
+
+ # include all the correct GCC4X port
+ depends_lib-append port:gcc[join [split ${gcc_version} "."] ""]
+
+ # force LDFLAGS for correct linking of the linalg module
+ # for non-Apple GCC compilers
+ patchfiles-append patch-numpy_linalg_setup.py.diff
+
+ if {${gcc_version} == ""} {
+ # user specified -gcc4X but +atlas (either as default or
+ # explicitly); do not allow since it might lead to
+ # undetermined runtime execution.
+ return -code error \
+"\n\nWhen using the +atlas variant (either as the default or setting
+explicitly), one of the +gcc4X variants must be selected.\n"
+ }
+} else {
+ variant universal {
+ patchfiles-append patch-setup.py.diff
+ }
+}
+
post-patch {
- reinplace "s|@@MPORTS_PREFIX@@|${prefix}|" ${worksrcpath}/numpy/distutils/fcompiler/g95.py
- reinplace "s|@@MPORTS_PYTHON@@|${python.bin}|" ${worksrcpath}/numpy/f2py/setup.py
+ reinplace "s|@@MPORTS_PYTHON@@|${python.bin}|" \
+ ${worksrcpath}/numpy/f2py/setup.py
+
+ # disallow searching for any fortran executable except what is
+ # specified in this Portfile; NOTE: this change only works when
+ # setting the GCC version; if this flag is not set (meaning no
+ # +gcc4X variant is set), then F2PY may or not work.
+ if {${gcc_version} != ""} {
+ # set which fortran to use in the f2py Python scripts
+ reinplace "/possible_executables/s|\\\[.*\\\]|\['gfortran-mp-${gcc_version}'\]|g" ${worksrcpath}/numpy/distutils/fcompiler/gnu.py
+ }
}
post-destroot {
@@ -36,4 +130,6 @@
}
}
-livecheck.distname NumPy
+livecheck.type regex
+livecheck.url http://www.scipy.org
+livecheck.regex {NumPy (\d+(\.\d+)*) released}
Modified: trunk/dports/python/py-numpy/files/patch-f2py_setup.py.diff
===================================================================
--- trunk/dports/python/py-numpy/files/patch-f2py_setup.py.diff 2011-05-31 06:29:06 UTC (rev 79044)
+++ trunk/dports/python/py-numpy/files/patch-f2py_setup.py.diff 2011-05-31 06:35:21 UTC (rev 79045)
@@ -1,6 +1,6 @@
---- numpy/f2py/setup.py 2008-07-27 20:43:18.000000000 -0500
-+++ numpy/f2py/setup.py 2008-07-27 20:44:46.000000000 -0500
-@@ -52,7 +52,7 @@
+--- numpy/f2py/setup.py 2011-02-27 23:40:29.000000000 -0600
++++ numpy/f2py/setup.py 2011-05-15 09:18:40.000000000 -0500
+@@ -51,7 +51,7 @@
log.info('Creating %s', target)
f = open(target,'w')
f.write('''\
@@ -9,8 +9,8 @@
# See http://cens.ioc.ee/projects/f2py2e/
import os, sys
for mode in ["g3-numpy", "2e-numeric", "2e-numarray", "2e-numpy"]:
-@@ -78,7 +78,7 @@
- print >> sys.stderr, "Unknown mode:",`mode`
+@@ -75,7 +75,7 @@
+ sys.stderr.write("Unknown mode: " + repr(mode) + "\\n")
sys.exit(1)
main()
-'''%(os.path.basename(sys.executable)))
Copied: trunk/dports/python/py-numpy/files/patch-fcompiler_g95.diff (from rev 79037, trunk/dports/python/py25-numpy/files/patch-fcompiler_g95.diff)
===================================================================
--- trunk/dports/python/py-numpy/files/patch-fcompiler_g95.diff (rev 0)
+++ trunk/dports/python/py-numpy/files/patch-fcompiler_g95.diff 2011-05-31 06:35:21 UTC (rev 79045)
@@ -0,0 +1,11 @@
+--- numpy/distutils/fcompiler/__init__.py 2011-03-15 00:22:25.000000000 -0500
++++ numpy/distutils/fcompiler/__init__.py 2011-05-15 09:21:14.000000000 -0500
+@@ -698,7 +698,7 @@
+ ('cygwin.*', ('gnu','intelv','absoft','compaqv','intelev','gnu95','g95')),
+ ('linux.*', ('gnu','intel','lahey','pg','absoft','nag','vast','compaq',
+ 'intele','intelem','gnu95','g95','pathf95')),
+- ('darwin.*', ('nag', 'absoft', 'ibm', 'intel', 'gnu', 'gnu95', 'g95', 'pg')),
++ ('darwin.*', ('nag', 'absoft', 'ibm', 'intel', 'gnu', 'gnu95', 'pg')),
+ ('sunos.*', ('sun','gnu','gnu95','g95')),
+ ('irix.*', ('mips','gnu','gnu95',)),
+ ('aix.*', ('ibm','gnu','gnu95',)),
Deleted: trunk/dports/python/py-numpy/files/patch-g95_link.diff
===================================================================
--- trunk/dports/python/py-numpy/files/patch-g95_link.diff 2011-05-31 06:29:06 UTC (rev 79044)
+++ trunk/dports/python/py-numpy/files/patch-g95_link.diff 2011-05-31 06:35:21 UTC (rev 79045)
@@ -1,11 +0,0 @@
---- numpy/distutils/fcompiler/g95.py 2007-11-07 17:05:14.000000000 -0500
-+++ numpy/distutils/fcompiler/g95.py 2008-01-30 21:26:47.000000000 -0500
-@@ -21,7 +21,7 @@
- 'compiler_f77' : ["g95", "-ffixed-form"],
- 'compiler_fix' : ["g95", "-ffixed-form"],
- 'compiler_f90' : ["g95"],
-- 'linker_so' : ["<F90>","-shared"],
-+ 'linker_so' : ["<F90>","-dynamiclib -L@@MPORTS_PREFIX@@/Library/Frameworks/Python.framework/Versions/2.4/lib -lpython2.4"],
- 'archiver' : ["ar", "-cr"],
- 'ranlib' : ["ranlib"]
- }
Copied: trunk/dports/python/py-numpy/files/patch-numpy_linalg_setup.py.diff (from rev 79037, trunk/dports/python/py25-numpy/files/patch-numpy_linalg_setup.py.diff)
===================================================================
--- trunk/dports/python/py-numpy/files/patch-numpy_linalg_setup.py.diff (rev 0)
+++ trunk/dports/python/py-numpy/files/patch-numpy_linalg_setup.py.diff 2011-05-31 06:35:21 UTC (rev 79045)
@@ -0,0 +1,10 @@
+--- numpy/linalg/setup.py.orig 2010-09-14 11:44:21.000000000 -0400
++++ numpy/linalg/setup.py 2010-09-14 11:45:01.000000000 -0400
+@@ -27,6 +27,7 @@
+ 'zlapack_lite.c', 'dlapack_lite.c',
+ 'blas_lite.c', 'dlamch.c',
+ 'f2c_lite.c','f2c.h'],
++ extra_link_args=['-undefined dynamic_lookup -bundle'],
+ extra_info = lapack_info
+ )
+
Copied: trunk/dports/python/py-numpy/files/patch-setup.py.diff (from rev 79037, trunk/dports/python/py26-numpy/files/patch-setup.py.diff)
===================================================================
--- trunk/dports/python/py-numpy/files/patch-setup.py.diff (rev 0)
+++ trunk/dports/python/py-numpy/files/patch-setup.py.diff 2011-05-31 06:35:21 UTC (rev 79045)
@@ -0,0 +1,34 @@
+--- numpy/core/setup.py.orig 2009-04-05 04:09:20.000000000 -0400
++++ numpy/core/setup.py 2009-04-08 19:53:45.000000000 -0400
+@@ -309,7 +309,14 @@
+ if isinstance(d,str):
+ target_f.write('#define %s\n' % (d))
+ else:
+- target_f.write('#define %s %s\n' % (d[0],d[1]))
++ if d[0]!='SIZEOF_LONG' and d[0]!='SIZEOF_PY_INTPTR_T':
++ target_f.write('#define %s %s\n' % (d[0],d[1]))
++ else:
++ target_f.write('#ifdef __LP64__\n')
++ target_f.write('#define %s %s\n' % (d[0],8))
++ target_f.write('#else\n')
++ target_f.write('#define %s %s\n' % (d[0],4))
++ target_f.write('#endif\n')
+
+ # define inline to our keyword, or nothing
+ target_f.write('#ifndef __cplusplus\n')
+@@ -393,7 +393,14 @@
+ if isinstance(d,str):
+ target_f.write('#define %s\n' % (d))
+ else:
+- target_f.write('#define %s %s\n' % (d[0],d[1]))
++ if d[0]!='NPY_SIZEOF_LONG' and d[0]!='NPY_SIZEOF_PY_INTPTR_T':
++ target_f.write('#define %s %s\n' % (d[0],d[1]))
++ else:
++ target_f.write('#ifdef __LP64__\n')
++ target_f.write('#define %s %s\n' % (d[0],8))
++ target_f.write('#else\n')
++ target_f.write('#define %s %s\n' % (d[0],4))
++ target_f.write('#endif\n')
+
+ # define NPY_INLINE to recognized keyword
+ target_f.write('#define NPY_INLINE %s\n' % inline)
Copied: trunk/dports/python/py-numpy/files/patch-system_info.py.diff (from rev 79037, trunk/dports/python/py25-numpy/files/patch-system_info.py.diff)
===================================================================
--- trunk/dports/python/py-numpy/files/patch-system_info.py.diff (rev 0)
+++ trunk/dports/python/py-numpy/files/patch-system_info.py.diff 2011-05-31 06:35:21 UTC (rev 79045)
@@ -0,0 +1,20 @@
+--- numpy/distutils/system_info.py 2011-03-15 00:22:25.000000000 -0500
++++ numpy/distutils/system_info.py 2011-05-15 09:20:19.000000000 -0500
+@@ -1287,7 +1287,7 @@
+ if sys.platform=='darwin' and not os.environ.get('ATLAS',None):
+ args = []
+ link_args = []
+- if get_platform()[-4:] == 'i386':
++ if get_platform().rsplit('-', 1)[1] in ('i386', 'x86_64', 'intel'):
+ intel = 1
+ else:
+ intel = 0
+@@ -1374,7 +1374,7 @@
+ if sys.platform=='darwin' and not os.environ.get('ATLAS',None):
+ args = []
+ link_args = []
+- if get_platform()[-4:] == 'i386':
++ if get_platform().rsplit('-', 1)[1] in ('i386', 'x86_64', 'intel'):
+ intel = 1
+ else:
+ intel = 0
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20110530/d6812e4f/attachment-0001.html>
More information about the macports-changes
mailing list