Opened 13 years ago
Closed 6 days ago
#31310 closed defect (wontfix)
py-numpy: +atlas +gcc44 +universal fixes, tested with py27-numpy 1.6.1_0 on ppc/ppc64
Reported by: | ccorn@… | Owned by: | michaelld (Michael Dickens) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 2.0.3 |
Keywords: | haspatch | Cc: | Veence (Vincent), ob+macport@…, petrrr |
Port: | py-numpy |
Description
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 forgrep
andsed
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 justCOMMAND
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.
Attachments (3)
Change History (13)
Changed 13 years ago by ccorn@…
Attachment: | Portfile.required.diff added |
---|
Changed 13 years ago by ccorn@…
Attachment: | Portfile.stylistic.diff added |
---|
Might be meaningless, but I understand it better this way.
Changed 13 years ago by ccorn@…
Attachment: | wrapper-template.diff added |
---|
Robustness patches to files/wrapper-template
comment:1 Changed 13 years ago by mf2k (Frank Schima)
Cc: | dh@… ram@… added; dh ram removed |
---|---|
Keywords: | ppc64 powerpc LP64 universal removed |
Trac requires complete email addresses.
comment:2 Changed 13 years ago by skymoo (Adam Mercer)
Cc: | ram@… vince@… added; ram@… removed |
---|
Vince: As you originally added the universal support to numpy could you take a look at this?
comment:3 Changed 13 years ago by skymoo (Adam Mercer)
Cc: | ram@… added; ram@… removed |
---|
comment:5 Changed 12 years ago by skymoo (Adam Mercer)
Cc: | ram@… removed |
---|
comment:7 Changed 9 years ago by petrrr
Cc: | michaelld@… added; dh@… removed |
---|---|
Owner: | changed from macports-tickets@… to dh@… |
Assigning (CC-ing) maintainers to review this ticket.
comment:8 Changed 9 years ago by mf2k (Frank Schima)
Port: | py-numpy added; py27-numpy removed |
---|
comment:9 Changed 8 years ago by mf2k (Frank Schima)
Cc: | michaelld@… removed |
---|---|
Owner: | changed from dh@… to michaelld@… |
dh has retired. See #51239.
comment:10 Changed 6 days ago by reneeotten (Renee Otten)
Resolution: | → wontfix |
---|---|
Status: | new → closed |
presumably fixed with this commit from 2015? This ticket is so out-of-data with respect to compilers, NumPy versions and such that there is no point in keeping it open.
Required patches to make +universal work