Ticket #24942: py26-numpy_svn_2.diff
File py26-numpy_svn_2.diff, 6.5 KB (added by michaelld (Michael Dickens), 14 years ago) |
---|
-
files/patch-numpy_linalg_setup.py.diff
1 --- numpy/linalg/setup.py.orig 2010-09-14 11:44:21.000000000 -0400 2 +++ numpy/linalg/setup.py 2010-09-14 11:45:01.000000000 -0400 3 @@ -27,6 +27,7 @@ 4 'zlapack_lite.c', 'dlapack_lite.c', 5 'blas_lite.c', 'dlamch.c', 6 'f2c_lite.c','f2c.h'], 7 + extra_link_args=['-undefined dynamic_lookup -bundle'], 8 extra_info = lapack_info 9 ) 10 -
Portfile
7 7 name py26-numpy 8 8 epoch 20100319 9 9 version 1.5.0 10 revision 1 10 11 categories python 11 12 platforms darwin 12 13 maintainers mcalhoun openmaintainer … … 26 27 patch-fcompiler_g95.diff 27 28 28 29 depends_lib-append port:fftw-3 \ 29 port:py26-nose \ 30 port:atlas 30 port:py26-nose 31 31 32 build.env-append ATLAS=${prefix}/lib \ 32 variant atlas \ 33 description {Use the MacPorts' ATLAS libraries \ 34 instead of Apple's Accelerate framework} { 35 build.env-append ATLAS=${prefix}/lib \ 33 36 LAPACK=${prefix}/lib \ 34 37 BLAS=${prefix}/lib 35 36 destroot.env-append ATLAS=${prefix}/lib \ 38 destroot.env-append ATLAS=${prefix}/lib \ 37 39 LAPACK=${prefix}/lib \ 38 40 BLAS=${prefix}/lib 41 depends_lib-append port:atlas 42 } 39 43 40 post-patch { 41 reinplace "s|@@MPORTS_PYTHON@@|${python.bin}|" ${worksrcpath}/numpy/f2py/setup.py 44 # use ALTAS by default; if MacPorts' ATLAS is not used, numpy will 45 # link with that supplied by Apple's Accelerate framework. 46 if {![variant_isset atlas]} { 47 default_variants +atlas 42 48 } 43 49 44 variant gcc43 conflicts gcc44 description {Use the gcc43 compiler (enables fortran code)} { 45 depends_lib-append port:gcc43 46 configure.compiler macports-gcc-4.3 47 build.env-append CC="${prefix}/bin/gcc-mp-4.3" \ 48 CXX="${prefix}/bin/g++-mp-4.3" 50 # when using ATLAS (whether by default or specified by the user via 51 # the +atlas variant) ... 52 set gcc_version "" 53 if {[variant_isset atlas]} { 54 # see if the user has set -gcc4X to disable using MacPorts' 55 # compiler; if not, either use what the user set (as +gcc4X) or 56 # default to gcc44. 49 57 50 destroot.env-append CC="${prefix}/bin/gcc-mp-4.3" \ 51 CXX="${prefix}/bin/g++-mp-4.3" 52 } 58 variant gcc43 conflicts gcc44 gcc45 \ 59 description {Use the gcc43 compiler (enables fortran linking)} {} 53 60 54 variant gcc44 conflicts gcc43 description {Use the gcc44 compiler (enables fortran code)} { 55 depends_lib-append port:gcc44 56 configure.compiler macports-gcc-4.4 57 build.env-append CC="${prefix}/bin/gcc-mp-4.4" \ 58 CXX="${prefix}/bin/g++-mp-4.4" 61 variant gcc44 conflicts gcc43 gcc45 \ 62 description {Use the gcc44 compiler (enables fortran linking)} {} 59 63 60 destroot.env-append CC="${prefix}/bin/gcc-mp-4.4" \ 61 CXX="${prefix}/bin/g++-mp-4.4" 62 } 64 variant gcc45 conflicts gcc43 gcc44 \ 65 description {Use the gcc45 compiler (enables fortran linking)} {} 63 66 64 if {![variant_isset gcc43]} { 65 default_variants +gcc44 66 } 67 if {![variant_isset gcc43] && 68 ![variant_isset gcc44] && 69 ![variant_isset gcc45]} { 70 default_variants +gcc44 71 } 72 if {[variant_isset gcc43]} { 73 set gcc_version "4.3" 74 } 75 if {[variant_isset gcc44]} { 76 set gcc_version "4.4" 77 } 78 if {[variant_isset gcc45]} { 79 set gcc_version "4.5" 80 } 67 81 68 variant no_atlas description {Do not use the macports atlas libs} { 69 build.env-delete ATLAS=${prefix}/lib \ 70 LAPACK=${prefix}/lib \ 71 BLAS=${prefix}/lib 82 if {${gcc_version} != ""} { 83 # when using non-Apple GCC for universal install, it can 84 # create binaries only for the native OS architecture, at 85 # either 32 or 64 bits. Restrict the supported archs 86 # accordingly. 87 if {[variant_exists universal] && [variant_isset universal]} { 88 if { ${os.arch}=="i386" } { 89 set universal_archs_supported { i386 x86_64 } 90 } else { 91 set universal_archs_supported { ppc ppc64 } 92 } 93 } 72 94 73 destroot.env-delete ATLAS=${prefix}/lib \ 74 LAPACK=${prefix}/lib \ 75 BLAS=${prefix}/lib 76 depends_lib-delete port:atlas 95 # include all the correct GCC4X port 96 depends_lib-append port:gcc[join [split ${gcc_version} "."] ""] 97 98 # set environment variable that's recognized by the setup.py script 99 build.env-append F90="${prefix}/bin/gfortran-mp-${gcc_version}" 100 101 # force LDFLAGS for correct linking of the linalg module 102 # for non-Apple GCC compilers 103 patchfiles-append patch-numpy_linalg_setup.py.diff 104 105 } else { 106 # user specified -gcc4X but +atlas (either as default or 107 # explicitly); do not allow since it might lead to 108 # undetermined runtime execution. 109 return -code error \ 110 "\n\nWhen using the +atlas variant (either as the default or setting 111 explicitly), one of the +gcc4X variants must be selected.\n" 112 } 77 113 } 78 114 79 115 variant universal { 80 116 patchfiles-append patch-setup.py.diff 81 117 } 82 118 119 post-patch { 120 reinplace "s|@@MPORTS_PYTHON@@|${python.bin}|" \ 121 ${worksrcpath}/numpy/f2py/setup.py 122 123 # disallow searching for any fortran executable except what is 124 # specified in this Portfile; NOTE: this change only works when 125 # setting the F90 flag above; if this flag is not set (meaning no 126 # +gcc4X variant is set), then F2PY may or not work. 127 if {${gcc_version} != ""} { 128 # set which fortran to use in the f2py Python scripts 129 reinplace "/possible_executables/s|\\\[.*\\\]|\['gfortran-mp-${gcc_version}'\]|g" ${worksrcpath}/numpy/distutils/fcompiler/gnu.py 130 } 131 } 132 83 133 livecheck.type regex 84 134 livecheck.url http://sourceforge.net/projects/numpy/files/ 85 135 livecheck.regex "files\/NumPy\/(\\d+(?:\\.\\d+)*)\/numpy"