<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[130954] trunk/dports/python/py-numpy/Portfile</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="https://trac.macports.org/changeset/130954">130954</a></dd>
<dt>Author</dt> <dd>sean@macports.org</dd>
<dt>Date</dt> <dd>2015-01-03 22:01:06 -0800 (Sat, 03 Jan 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>py-numpy: refactor port to use compilers portgroup
This is a big refactor that cleans up a lot of old and now incorrect logic,
mostly with ATLAS. This changeset is accomplishes:
- ensure that numpy has a fortran compiler
- ensure that compilers match the same ones as ATLAS
- remove python 3.2</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkdportspythonpynumpyPortfile">trunk/dports/python/py-numpy/Portfile</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkdportspythonpynumpyPortfile"></a>
<div class="modfile"><h4>Modified: trunk/dports/python/py-numpy/Portfile (130953 => 130954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/python/py-numpy/Portfile        2015-01-04 06:01:04 UTC (rev 130953)
+++ trunk/dports/python/py-numpy/Portfile        2015-01-04 06:01:06 UTC (rev 130954)
</span><span class="lines">@@ -4,9 +4,11 @@
</span><span class="cx"> PortSystem 1.0
</span><span class="cx"> PortGroup python 1.0
</span><span class="cx"> PortGroup github 1.0
</span><ins>+PortGroup compilers 1.0
</ins><span class="cx">
</span><span class="cx"> github.setup numpy numpy 1.9.1 v
</span><span class="cx"> name py-numpy
</span><ins>+revision 1
</ins><span class="cx"> categories-append math
</span><span class="cx"> license BSD
</span><span class="cx"> platforms darwin
</span><span class="lines">@@ -17,8 +19,10 @@
</span><span class="cx"> checksums rmd160 c043ce0045166762e36c513458abc499d36bbcf5 \
</span><span class="cx"> sha256 504b7cbc3b47df592d683e0f3b992cfa4d29338f8d23fca07f040164018b607f
</span><span class="cx">
</span><del>-python.versions 26 27 32 33 34
</del><ins>+python.versions 26 27 33 34
</ins><span class="cx">
</span><ins>+compilers.setup require_fortran -clang -dragonegg -gcc44 -gcc45 -gcc46 -g95
+
</ins><span class="cx"> if {${name} ne ${subport}} {
</span><span class="cx"> patchfiles patch-f2py_setup.py.diff \
</span><span class="cx"> patch-fcompiler_g95.diff \
</span><span class="lines">@@ -28,18 +32,20 @@
</span><span class="cx"> port:py${python.version}-nose \
</span><span class="cx"> port:py${python.version}-cython
</span><span class="cx">
</span><del>- # http://trac.macports.org/ticket/34562
- destroot.env-append \
- CC="${configure.cc}" \
- CFLAGS="${configure.cflags} [get_canonical_archflags cc]" \
- CXX="${configure.cxx}" \
- CXXFLAGS="${configure.cxxflags} [get_canonical_archflags cxx]" \
- OBJC="${configure.objc}" \
- OBJCFLAGS="${configure.objcflags} [get_canonical_archflags objc]" \
- LDFLAGS="${configure.ldflags} [get_canonical_archflags ld]"
</del><ins>+ pre-configure {
+ # http://trac.macports.org/ticket/34562
+ destroot.env-append \
+ CC="${configure.cc}" \
+ CFLAGS="${configure.cflags} [get_canonical_archflags cc]" \
+ CXX="${configure.cxx}" \
+ CXXFLAGS="${configure.cxxflags} [get_canonical_archflags cxx]" \
+ OBJC="${configure.objc}" \
+ OBJCFLAGS="${configure.objcflags} [get_canonical_archflags objc]" \
+ LDFLAGS="${configure.ldflags} [get_canonical_archflags ld]"
</ins><span class="cx">
</span><del>- build.env-append ARCHFLAGS="[get_canonical_archflags ld]"
- destroot.env-append ARCHFLAGS="[get_canonical_archflags ld]"
</del><ins>+ build.env-append ARCHFLAGS="[get_canonical_archflags ld]"
+ destroot.env-append ARCHFLAGS="[get_canonical_archflags ld]"
+ }
</ins><span class="cx">
</span><span class="cx"> variant atlas description {Use the MacPorts' ATLAS libraries \
</span><span class="cx"> instead of Apple's Accelerate framework} {
</span><span class="lines">@@ -52,61 +58,8 @@
</span><span class="cx">
</span><span class="cx"> # when using ATLAS (whether by default or specified by the user via
</span><span class="cx"> # the +atlas variant) ...
</span><del>- set gcc_version ""
</del><span class="cx"> if {[variant_isset atlas]} {
</span><span class="cx">
</span><del>- # 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 gcc48.
-
- variant gcc43 conflicts gcc44 gcc45 gcc46 gcc47 gcc48 \
- description {Use the gcc43 compiler (enables fortran linking)} {
- configure.compiler macports-gcc-4.3
- }
-
- variant gcc44 conflicts gcc43 gcc45 gcc46 gcc47 gcc48 \
- description {Use the gcc44 compiler (enables fortran linking)} {
- configure.compiler macports-gcc-4.4
- }
-
- variant gcc45 conflicts gcc43 gcc44 gcc46 gcc47 gcc48 \
- description {Use the gcc45 compiler (enables fortran linking)} {
- configure.compiler macports-gcc-4.5
- }
-
- variant gcc46 conflicts gcc43 gcc44 gcc45 gcc47 gcc48 \
- description {Use the gcc46 compiler (enables fortran linking)} {
- configure.compiler macports-gcc-4.6
- }
-
- variant gcc47 conflicts gcc43 gcc44 gcc45 gcc46 gcc48 \
- description {Use the gcc47 compiler (enables fortran linking)} {
- configure.compiler macports-gcc-4.7
- }
-
- variant gcc48 conflicts gcc43 gcc44 gcc45 gcc46 gcc47 \
- description {Use the gcc48 compiler (enables fortran linking)} {
- configure.compiler macports-gcc-4.8
- }
-
- if {![variant_isset gcc43] && ![variant_isset gcc44] && ![variant_isset gcc45] && ![variant_isset gcc46] && ![variant_isset gcc47]} {
- default_variants +gcc48
- }
-
- 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"
- } elseif {[variant_isset gcc46]} {
- set gcc_version "4.6"
- } elseif {[variant_isset gcc47]} {
- set gcc_version "4.7"
- } elseif {[variant_isset gcc48]} {
- set gcc_version "4.8"
- }
-
</del><span class="cx"> # when using non-Apple GCC for universal install, it can
</span><span class="cx"> # create binaries only for the native OS architecture, at
</span><span class="cx"> # either 32 or 64 bits. Restrict the supported archs
</span><span class="lines">@@ -117,21 +70,48 @@
</span><span class="cx"> supported_archs ppc ppc64
</span><span class="cx"> }
</span><span class="cx">
</span><del>- # include all the correct GCC4X port
- depends_lib-append port:gcc[join [split ${gcc_version} "."] ""]
-
</del><span class="cx"> # force LDFLAGS for correct linking of the linalg module
</span><span class="cx"> # for non-Apple GCC compilers
</span><span class="cx"> patchfiles-append patch-numpy_linalg_setup.py.diff
</span><span class="cx">
</span><del>- 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"
</del><ins>+ pre-fetch {
+ # get the c compiler name, if blank set to clang which is what atlas
+ # does
+ set cc [c_variant_name]
+ if {$cc eq ""} {
+ set cc clang
+ }
+
+ # check the C compiler for atlas: if not the same then error out; we
+ # don't need to check the fortran compiler because if atlas is compiled
+ # with +clang then gcc48 (+gfortran in the compilers portgroup
+ # language) is used for fortran. If a +gcc variant is used to compile
+ # atlas, then that gcc's fortran is used so the c compiler check will
+ # suffice.
+ if {![catch {set result [active_variants atlas $cc ""]}]} {
+ if {!$result} {
+ return -code error \
+"You have selected the $cc compiler (either directly or indirectly) and the\
++atlas variant, which does not match the $cc compiler. Please ensure that both\
+are compiled with the same one."
+ }
+ }
</ins><span class="cx"> }
</span><ins>+
+ build.env-append ATLAS=${prefix}/lib \
+ LAPACK=${prefix}/lib \
+ BLAS=${prefix}/lib
+ destroot.env-append ATLAS=${prefix}/lib \
+ LAPACK=${prefix}/lib \
+ BLAS=${prefix}/lib
+
+ } else {
+ build.env-append ATLAS=None \
+ LAPACK=/usr/lib \
+ BLAS=/usr/lib
+ destroot.env-append ATLAS=None \
+ LAPACK=/usr/lib \
+ BLAS=/usr/lib
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> post-patch {
</span><span class="lines">@@ -188,23 +168,6 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> livecheck.type none
</span><del>-
- if {[variant_isset atlas]} {
- build.env-append ATLAS=${prefix}/lib \
- LAPACK=${prefix}/lib \
- BLAS=${prefix}/lib
- destroot.env-append ATLAS=${prefix}/lib \
- LAPACK=${prefix}/lib \
- BLAS=${prefix}/lib
- } else {
- build.env-append ATLAS=None \
- LAPACK=/usr/lib \
- BLAS=/usr/lib
- destroot.env-append ATLAS=None \
- LAPACK=/usr/lib \
- BLAS=/usr/lib
- }
-
</del><span class="cx"> } else {
</span><span class="cx"> livecheck.regex archive/[join ${github.tag_prefix} ""](\[\\d+(?:\\.\\d+)*"\]+)${extract.suffix}"
</span><span class="cx"> }
</span></span></pre>
</div>
</div>
</body>
</html>