[MacPorts] #31310: py-numpy: +atlas +gcc44 +universal fixes, tested with py27-numpy 1.6.1_0 on ppc/ppc64

MacPorts noreply at macports.org
Sun Sep 18 12:07:43 PDT 2011


#31310: py-numpy: +atlas +gcc44 +universal fixes, tested with py27-numpy 1.6.1_0 on
ppc/ppc64
---------------------------------------------------+------------------------
 Reporter:  ccorn@…                                |       Owner:  macports-tickets@…                   
     Type:  defect                                 |      Status:  new                                  
 Priority:  Normal                                 |   Milestone:                                       
Component:  ports                                  |     Version:  2.0.3                                
 Keywords:  ppc64 powerpc LP64 universal haspatch  |        Port:  py27-numpy                           
---------------------------------------------------+------------------------
 '''Platform:''' PowerMac G5 running MacOS X 10.5.8 ({{{powerpc-apple-
 darwin9.8.0}}})

 {{{universal_archs = ppc64 ppc}}}

 '''Portfile''': {{{python/py-numpy}}} (-r83853)

 '''Problem:''' I have successfully built {{{atlas +gcc44 +universal}}}.
 The subsequent build of {{{py27-numpy +atlas +gcc44 +universal}}}
 succeeded, but in {{{arch -ppc64 python2.7}}}, {{{import numpy}}} failed.
 Reason: {{{multiarray.so}}} had been built for architecture {{{ppc}}}
 only.

 '''Cause:''' Python's installation procedure rebuilds in the
 {{{destroot}}} phase, therefore all essential configuration settings in
 the environment must be reproduced then. The Portfile has done so in most
 places, but missed one branch conditioned for {{{universal}}} builds, and
 even got the condition slightly wrong.

 '''Proposed solution''': The patch attached as
 {{{Portfile.required.diff}}} is definitely required to fix this. "Fixing"
 means that I can run {{{arch -ppc64 python2.7}}} as well as {{{arch -ppc
 python2.7}}} and in both cases successfully {{{import numpy}}}.

 '''Further issues, fortunately uncritical:''' While working on the
 Portfile, I found the expression {{{variant universal}}} used instead of
 {{{if {[variant_isset universal]} }}}. I am not sure whether these two are
 the same, but it seems that the latter is meant. Therefore I have changed
 that. See the patch attached as {{{Portfile.stylistic.diff}}}.

 I also took a look at {{{files/wrapper-template}}} and found that it has
 some errors and some weaknesses, which (for me) might turn out to be
 inconsequential. However, I wanted to make things sure, so I changed a lot
 of things:

 - Uses {{{-E}}} flag for {{{grep}}} and {{{sed}}} because the C++ suffix
 pattern is {{{-E}}} style

 - Returns compiler error codes instead of 1

 - Also checks {{{lipo}}}'s exit status

 - Checks for unknown or conflicting {{{-arch}}} options

 - Removes directory components when guessing implicit output filenames

 - Corrects default linker output name ({{{a.out}}})

 - Changes "{{{if `COMMAND`; then}}}" into "{{{if COMMAND; then}}}" (the
 original version would execute not just {{{COMMAND}}} but also its output,
 if any.)

 - Uses {{{set -f}}} and quotes around {{{$VAR}}}s where this makes sense,
 to reduce damage from weird args, leaving vulnerable only the compiler
 commands where word splitting is needed

 - Replaces special {{{+=}}} syntax with a portable form

 - Simplifies heavily nested {{{if}}}s

 I have also run across a {{{python26}}}-specific tweak in {{{files
 /wrapper-template}}}:
 {{{
 # For some reason, -dynamiclib and -lpython2.6 are missing when linking
 # .so files. Add them, except if -bundle is set (incompatible switches)
 }}}
 I have rewritten that part to be more robust, but I have not generalized
 its functionality to other python versions. This does not seem to be an
 omission: {{{py27-numpy}}} built ok without {{{python26}}} installed
 (probably because {{{python27}}} uses {{{-bundle}}}).

 The patches to {{{files/wrapper-template}}} are attached as {{{wrapper-
 template.diff}}}. I consider these changes optional, but I recommend them
 unconditionally. Note that you have to {{{chmod +x files/wrapper-
 template}}}.

 '''Applicability:'''
 I suppose that the proposed patches are not specific to PowerPC.
 I also suppose that they are not specific to {{{py27-numpy}}}.
 But that remains to be verified.

-- 
Ticket URL: <https://trac.macports.org/ticket/31310>
MacPorts <http://www.macports.org/>
Ports system for Mac OS


More information about the macports-tickets mailing list