Opened 8 years ago

Last modified 8 years ago

#50686 new defect

py-psutil 4.0.0 does not build on a PPC

Reported by: josephsacco Owned by: stromnov (Andrey Stromnov)
Priority: Normal Milestone:
Component: ports Version: 2.3.4
Keywords: powerpc haspatch Cc:
Port: py-psutil

Description (last modified by mf2k (Frank Schima))

Programming a PPC-based Mac is akin to riding a dead horse. Conventional wisdom suggests the best strategy when you discover you are riding a dead horse is to dismount. Still, we persist... :-)

The culprit file is psutil/_psutil_osx.c. If this file is replaced with its predecessor from version 3.4.2, the module builds, albeit with some minor complaints.

The compiler errors are shown below.

-Joseph

/usr/bin/gcc-4.2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch ppc -DPSUTIL_VERSION=400 -I/opt/local/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c psutil/_psutil_osx.c -o build/temp.macosx-10.5-ppc-2.7/psutil/_psutil_osx.o
psutil/_psutil_osx.c: In function ‘psutil_proc_memory_maps’:
psutil/_psutil_osx.c:351: warning: format ‘%016lx’ expects type ‘long unsigned int’, but argument 3 has type ‘vm_address_t’
psutil/_psutil_osx.c:351: warning: format ‘%016lx’ expects type ‘long unsigned int’, but argument 4 has type ‘vm_address_t’
psutil/_psutil_osx.c: In function ‘psutil_proc_memory_uss’:
psutil/_psutil_osx.c:603: error: ‘for’ loop initial declaration used outside C99 mode
psutil/_psutil_osx.c:624: error: ‘SM_LARGE_PAGE’ undeclared (first use in this function)
psutil/_psutil_osx.c:624: error: (Each undeclared identifier is reported only once
psutil/_psutil_osx.c:624: error: for each function it appears in.)
error: command '/usr/bin/gcc-4.2' failed with exit status 1

Attachments (4)

Portfile.diff (397 bytes) - added by josephsacco 8 years ago.
Portfile.diff
_psutil_osx.c.diff (811 bytes) - added by josephsacco 8 years ago.
_psutl_osx.c.diff
Portfile-2.diff (416 bytes) - added by stromnov (Andrey Stromnov) 8 years ago.
Alternative patch
patch-psutil__psutil_osx.c.diff (949 bytes) - added by stromnov (Andrey Stromnov) 8 years ago.
Intel-friendly patch

Download all attachments as: .zip

Change History (11)

comment:1 Changed 8 years ago by mf2k (Frank Schima)

Cc: stromnov@… removed
Keywords: powerpc added; PPC removed
Owner: changed from macports-tickets@… to stromnov@…

In the future, please use WikiFormatting.

comment:2 Changed 8 years ago by mf2k (Frank Schima)

Description: modified (diff)

Changed 8 years ago by josephsacco

Attachment: Portfile.diff added

Portfile.diff

Changed 8 years ago by josephsacco

Attachment: _psutil_osx.c.diff added

_psutl_osx.c.diff

comment:3 Changed 8 years ago by josephsacco

I patched psutil/_psutil_osx.c and got py27_psutil and py34_psutil to build on a G4 PowerMac running OS X 10.5.8. The resulting build passes many, but not all tests. [See attached patch].

-Joseph

comment:4 Changed 8 years ago by mf2k (Frank Schima)

Keywords: haspatch added

Thank you for the patch. FYI, according to the patch guidelines, you should prepend the text "patch-" to your patchfile name.

Changed 8 years ago by stromnov (Andrey Stromnov)

Attachment: Portfile-2.diff added

Alternative patch

Changed 8 years ago by stromnov (Andrey Stromnov)

Intel-friendly patch

comment:5 Changed 8 years ago by stromnov (Andrey Stromnov)

Feel free to check proposed patch and Portfile on G4 PowerMac.

comment:6 Changed 8 years ago by josephsacco

The proposed patch and Portfile work on a G4 PowerMac [as expected... :-)].

Be well,

-Joseph

comment:7 Changed 8 years ago by gnw3

Build fails on OS X Snow Leopard because SM_LARGE_PAGE is not defined. Adding " && defined(SM_LARGE_PAGE)" to the ppc tests should work:

+#if !defined(__ppc__) && ... && defined(SM_LARGE_PAGE)
Note: See TracTickets for help on using tickets.