nikademus79 / psutil

Automatically exported from code.google.com/p/psutil
Other
0 stars 0 forks source link

Warnings when compiling psutil for Mac OS X 10.7 Lion #181

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. sudo easy_install psutil

What is the expected output? What do you see instead?
The psutil module is build without no errors / warnings

This is the output:

Searching for psutil
Reading http://pypi.python.org/simple/psutil/
Reading http://code.google.com/p/psutil/
Best match: psutil 0.2.1
Downloading http://psutil.googlecode.com/files/psutil-0.2.1.tar.gz
Processing psutil-0.2.1.tar.gz
Running psutil-0.2.1/setup.py -q bdist_egg --dist-dir 
/tmp/easy_install-ZLzr5D/psutil-0.2.1/egg-dist-tmp-KEhddk
In file included from psutil/_psutil_osx.c:26:
/usr/include/mach/shared_memory_server.h:48:2: warning: #warning 
"<mach/shared_memory_server.h> is deprecated.  Please use 
<mach/shared_region.h> instead."
psutil/_psutil_osx.c: In function ‘get_cpu_times’:
psutil/_psutil_osx.c:246: warning: implicit conversion shortens 64-bit value 
into a 32-bit value
psutil/_psutil_osx.c:247: warning: implicit conversion shortens 64-bit value 
into a 32-bit value
psutil/_psutil_osx.c:254: warning: implicit conversion shortens 64-bit value 
into a 32-bit value
psutil/_psutil_osx.c:255: warning: implicit conversion shortens 64-bit value 
into a 32-bit value
In file included from psutil/_psutil_osx.c:26:
/usr/include/mach/shared_memory_server.h:48:2: warning: #warning 
"<mach/shared_memory_server.h> is deprecated.  Please use 
<mach/shared_region.h> instead."
psutil/_psutil_osx.c: In function ‘get_process_name’:
psutil/_psutil_osx.c:78: warning: implicit conversion shortens 64-bit value 
into a 32-bit value
psutil/_psutil_osx.c: In function ‘get_process_ppid’:
psutil/_psutil_osx.c:115: warning: implicit conversion shortens 64-bit value 
into a 32-bit value
psutil/_psutil_osx.c: In function ‘get_process_uids’:
psutil/_psutil_osx.c:133: warning: implicit conversion shortens 64-bit value 
into a 32-bit value
psutil/_psutil_osx.c: In function ‘get_process_gids’:
psutil/_psutil_osx.c:153: warning: implicit conversion shortens 64-bit value 
into a 32-bit value
psutil/_psutil_osx.c: In function ‘get_cpu_times’:
psutil/_psutil_osx.c:210: warning: implicit conversion shortens 64-bit value 
into a 32-bit value
psutil/_psutil_osx.c:246: warning: implicit conversion shortens 64-bit value 
into a 32-bit value
psutil/_psutil_osx.c:247: warning: implicit conversion shortens 64-bit value 
into a 32-bit value
psutil/_psutil_osx.c:254: warning: implicit conversion shortens 64-bit value 
into a 32-bit value
psutil/_psutil_osx.c:255: warning: implicit conversion shortens 64-bit value 
into a 32-bit value
psutil/_psutil_osx.c: In function ‘get_process_create_time’:
psutil/_psutil_osx.c:272: warning: implicit conversion shortens 64-bit value 
into a 32-bit value
psutil/_psutil_osx.c: In function ‘get_memory_info’:
psutil/_psutil_osx.c:304: warning: implicit conversion shortens 64-bit value 
into a 32-bit value
psutil/_psutil_osx.c: In function ‘get_process_num_threads’:
psutil/_psutil_osx.c:371: warning: implicit conversion shortens 64-bit value 
into a 32-bit value
psutil/_psutil_osx.c: In function ‘get_process_status’:
psutil/_psutil_osx.c:559: warning: implicit conversion shortens 64-bit value 
into a 32-bit value
psutil/_psutil_osx.c: In function ‘get_process_threads’:
psutil/_psutil_osx.c:592: warning: implicit conversion shortens 64-bit value 
into a 32-bit value
psutil/_psutil_osx.c: In function ‘get_process_open_files’:
psutil/_psutil_osx.c:665: warning: implicit conversion shortens 64-bit value 
into a 32-bit value
psutil/_psutil_osx.c:672: warning: implicit conversion shortens 64-bit value 
into a 32-bit value
psutil/_psutil_osx.c:679: warning: implicit conversion shortens 64-bit value 
into a 32-bit value
psutil/_psutil_osx.c:691: warning: implicit conversion shortens 64-bit value 
into a 32-bit value
psutil/_psutil_osx.c: In function ‘get_process_connections’:
psutil/_psutil_osx.c:799: warning: implicit conversion shortens 64-bit value 
into a 32-bit value
psutil/_psutil_osx.c:806: warning: implicit conversion shortens 64-bit value 
into a 32-bit value
psutil/_psutil_osx.c:813: warning: implicit conversion shortens 64-bit value 
into a 32-bit value
psutil/_psutil_osx.c:823: warning: implicit conversion shortens 64-bit value 
into a 32-bit value
psutil/arch/osx/process_info.c: In function ‘pid_exists’:
psutil/arch/osx/process_info.c:36: warning: implicit conversion shortens 64-bit 
value into a 32-bit value
psutil/arch/osx/process_info.c: In function ‘get_arg_list’:
psutil/arch/osx/process_info.c:168: warning: implicit conversion shortens 
64-bit value into a 32-bit value
psutil/arch/osx/process_info.c:186: warning: implicit conversion shortens 
64-bit value into a 32-bit value
psutil/_psutil_posix.c: In function ‘posix_getpriority’:
psutil/_psutil_posix.c:27: warning: implicit conversion shortens 64-bit value 
into a 32-bit value
psutil/_psutil_posix.c: In function ‘posix_setpriority’:
psutil/_psutil_posix.c:46: warning: implicit conversion shortens 64-bit value 
into a 32-bit value
zip_safe flag not set; analyzing archive contents...
Adding psutil 0.2.1 to easy-install.pth file

Installed 
/Library/Python/2.7/site-packages/psutil-0.2.1-py2.7-macosx-10.7-intel.egg
Processing dependencies for psutil
Finished processing dependencies for psutil

What version of psutil are you using? What Python version?
psutil-0.2.1
Python 2.7

On what operating system? Is it 32bit or 64bit version?
Mac OS X 10.7 Lion GM Seed 
64 bits

Please provide any additional information below.
Using  Xcode 4.1 Developer Preview 7

Original issue reported on code.google.com by fdv...@gmail.com on 8 Jul 2011 at 3:38

GoogleCodeExporter commented 8 years ago
After that, when executing:

import psutil
import os

for un in psutil.process_iter():
  try:
    print un
  except:
    pass

you get a lot of errors like this:

python(2089) malloc: *** mmap(size=140733193650176) failed (error code=12)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug

Original comment by fdv...@gmail.com on 8 Jul 2011 at 3:41

GoogleCodeExporter commented 8 years ago
I think this is similar to issue 135.
Assigning this to Jay and bumping up priority.

Original comment by g.rodola on 8 Jul 2011 at 3:48

GoogleCodeExporter commented 8 years ago
It looks like a compatibility issue with 10.7 - unfortunately I do not have 
10.7 and have no plans to upgrade in the near future so I am not sure how much 
I can do about debugging this given I don't get the warnings or run into any 
memory errors on 10.6 64bit 

Original comment by jlo...@gmail.com on 8 Jul 2011 at 3:50

GoogleCodeExporter commented 8 years ago
I'm getting a different error trying to install psutil on OSX Lion...

 ~/projects $ sudo easy_install -U psutil
Searching for psutil
Reading http://pypi.python.org/simple/psutil/
Reading http://code.google.com/p/psutil/
Best match: psutil 0.5.1
Downloading http://psutil.googlecode.com/files/psutil-0.5.1.tar.gz
Processing psutil-0.5.1.tar.gz
Writing /tmp/easy_install-bh6Y6f/psutil-0.5.1/setup.cfg
Running psutil-0.5.1/setup.py -q bdist_egg --dist-dir 
/tmp/easy_install-bh6Y6f/psutil-0.5.1/egg-dist-tmp-mXgR4S
warning: no files found matching '*.html' under directory 'docs'
warning: no files found matching '*.dia' under directory 'docs'
warning: no files found matching '*.png' under directory 'docs'
In file included from psutil/_psutil_osx.c:34:
/usr/include/mach/shared_memory_server.h:48:2: warning: #warning 
"<mach/shared_memory_server.h> is deprecated.  Please use 
<mach/shared_region.h> instead."
psutil/_psutil_osx.c:38:43: error: CoreFoundation/CoreFoundation.h: No such 
file or directory
In file included from psutil/_psutil_osx.c:39:
/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:45:35: error: 
CoreFoundation/CFBase.h: No such file or directory
/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:46:41: error: 
CoreFoundation/CFDictionary.h: No such file or directory
/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:47:38: error: 
CoreFoundation/CFRunLoop.h: No such file or directory
In file included from psutil/_psutil_osx.c:39:
/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:150: error: 
expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before 
‘IONotificationPortGetRunLoopSource’
/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:254: error: 
expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before 
‘IOObjectCopyClass’
/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:264: error: 
expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before 
‘IOObjectCopySuperclassForClass’
/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:274: error: 
expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before 
‘IOObjectCopyBundleIdentifierForClass’
/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:387: error: 
expected declaration specifiers or ‘...’ before ‘CFDictionaryRef’
/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:400: error: 
expected declaration specifiers or ‘...’ before ‘CFDictionaryRef’
/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:408: error: 
expected declaration specifiers or ‘...’ before ‘CFDictionaryRef’
/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:433: error: 
expected declaration specifiers or ‘...’ before ‘CFDictionaryRef’
/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:470: error: 
expected declaration specifiers or ‘...’ before ‘CFDictionaryRef’
/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:722: error: 
expected declaration specifiers or ‘...’ before ‘CFTypeRef’
/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:735: error: 
expected declaration specifiers or ‘...’ before ‘CFStringRef’
/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:736: error: 
expected declaration specifiers or ‘...’ before ‘CFTypeRef’
/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:1058: error: 
expected declaration specifiers or ‘...’ before ‘CFMutableDictionaryRef’
/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:1059: error: 
expected declaration specifiers or ‘...’ before ‘CFAllocatorRef’
/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:1072: error: 
expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before 
‘IORegistryEntryCreateCFProperty’
/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:1090: error: 
expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before 
‘IORegistryEntrySearchCFProperty’
/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:1117: error: 
expected declaration specifiers or ‘...’ before ‘CFTypeRef’
/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:1130: error: 
expected declaration specifiers or ‘...’ before ‘CFStringRef’
/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:1131: error: 
expected declaration specifiers or ‘...’ before ‘CFTypeRef’
/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:1214: error: 
expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before 
‘IOServiceMatching’
/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:1224: error: 
expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before 
‘IOServiceNameMatching’
/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:1236: error: 
expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before 
‘IOBSDNameMatching’
/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:1250: error: 
expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before 
‘IOOpenFirmwarePathMatching’
/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:1262: error: 
expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before 
‘IORegistryEntryIDMatching’
psutil/_psutil_osx.c: In function ‘get_process_memory_maps’:
psutil/_psutil_osx.c:251: warning: format ‘%016x’ expects type ‘unsigned 
int’, but argument 5 has type ‘vm_address_t’
psutil/_psutil_osx.c:251: warning: format ‘%016x’ expects type ‘unsigned 
int’, but argument 6 has type ‘long unsigned int’
psutil/_psutil_osx.c: In function ‘get_disk_io_counters’:
psutil/_psutil_osx.c:1416: error: ‘CFDictionaryRef’ undeclared (first use 
in this function)
psutil/_psutil_osx.c:1416: error: (Each undeclared identifier is reported only 
once
psutil/_psutil_osx.c:1416: error: for each function it appears in.)
psutil/_psutil_osx.c:1416: error: expected ‘;’ before ‘parent_dict’
psutil/_psutil_osx.c:1417: error: expected ‘;’ before ‘props_dict’
psutil/_psutil_osx.c:1418: error: expected ‘;’ before ‘stats_dict’
psutil/_psutil_osx.c:1426: warning: passing argument 2 of 
‘IOServiceGetMatchingServices’ makes pointer from integer without a cast
psutil/_psutil_osx.c:1426: error: too many arguments to function 
‘IOServiceGetMatchingServices’
psutil/_psutil_osx.c:1434: error: ‘parent_dict’ undeclared (first use in 
this function)
psutil/_psutil_osx.c:1435: error: ‘props_dict’ undeclared (first use in 
this function)
psutil/_psutil_osx.c:1436: error: ‘stats_dict’ undeclared (first use in 
this function)
psutil/_psutil_osx.c:1448: error: ‘CFMutableDictionaryRef’ undeclared 
(first use in this function)
psutil/_psutil_osx.c:1448: error: expected expression before ‘)’ token
psutil/_psutil_osx.c:1461: error: expected expression before ‘)’ token
psutil/_psutil_osx.c:1473: error: ‘CFStringRef’ undeclared (first use in 
this function)
psutil/_psutil_osx.c:1473: error: expected ‘;’ before ‘disk_name_ref’
psutil/_psutil_osx.c:1478: error: ‘disk_name_ref’ undeclared (first use in 
this function)
psutil/_psutil_osx.c:1483: error: expected ‘;’ before 
‘CFDictionaryGetValue’
psutil/_psutil_osx.c:1496: error: ‘CFNumberRef’ undeclared (first use in 
this function)
psutil/_psutil_osx.c:1496: error: expected ‘;’ before ‘number’
psutil/_psutil_osx.c:1500: error: ‘number’ undeclared (first use in this 
function)
psutil/_psutil_osx.c:1500: error: expected ‘)’ before 
‘CFDictionaryGetValue’
psutil/_psutil_osx.c:1504: error: ‘kCFNumberSInt64Type’ undeclared (first 
use in this function)
psutil/_psutil_osx.c:1506: error: expected ‘)’ before 
‘CFDictionaryGetValue’
psutil/_psutil_osx.c:1514: error: expected ‘)’ before 
‘CFDictionaryGetValue’
psutil/_psutil_osx.c:1520: error: expected ‘)’ before 
‘CFDictionaryGetValue’
psutil/_psutil_osx.c:1528: error: expected ‘)’ before 
‘CFDictionaryGetValue’
psutil/_psutil_osx.c:1534: error: expected ‘)’ before 
‘CFDictionaryGetValue’
error: Setup script exited with error: command 'gcc' failed with exit status 1

Original comment by jni.s...@gmail.com on 12 Jul 2012 at 10:15

GoogleCodeExporter commented 8 years ago
jni.soma, that's a completely unrelated different error. It looks like your gcc 
is unable to find the CoreFoundation/CoreFoundation.h header file which is 
causing a number of other nested errors. Are you using the latest version of 
XCode to install? Note that If you're using other OS X gcc tools instead of 
XCode it may not be able to locate the header files correctly.

I've also uploaded a binary distribution for OS X 10.6.8 which may work on Lion 
as well (unfortunately I don't have Lion so I can't test there). You can try 
that and see if it works for you without needing to compile from source.

Original comment by jlo...@gmail.com on 12 Jul 2012 at 11:08

GoogleCodeExporter commented 8 years ago
Can we close this one?

Original comment by g.rodola on 30 Apr 2014 at 12:49