Installation on Mac OSX 10.5: "libproc.h: No such file or directory"

825 views
Skip to first unread message

Ingrid

unread,
Nov 19, 2013, 11:44:45 PM11/19/13
to psu...@googlegroups.com
Hi,

I am trying to install psutil on a Mac (OSX 10.5.8, python 2.7.6) but it fails with the following errors:

ingrid$ python setup.py install
running install
running bdist_egg
running egg_info
writing psutil.egg-info/PKG-INFO
writing top-level names to psutil.egg-info/top_level.txt
writing dependency_links to psutil.egg-info/dependency_links.txt
reading manifest file 'psutil.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'psutil.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.3-fat/egg
running install_lib
running build_py
creating build
creating build/lib.macosx-10.3-fat-2.7
creating build/lib.macosx-10.3-fat-2.7/psutil
copying psutil/__init__.py -> build/lib.macosx-10.3-fat-2.7/psutil
copying psutil/_common.py -> build/lib.macosx-10.3-fat-2.7/psutil
copying psutil/_compat.py -> build/lib.macosx-10.3-fat-2.7/psutil
copying psutil/_error.py -> build/lib.macosx-10.3-fat-2.7/psutil
copying psutil/_psbsd.py -> build/lib.macosx-10.3-fat-2.7/psutil
copying psutil/_pslinux.py -> build/lib.macosx-10.3-fat-2.7/psutil
copying psutil/_psmswindows.py -> build/lib.macosx-10.3-fat-2.7/psutil
copying psutil/_psosx.py -> build/lib.macosx-10.3-fat-2.7/psutil
copying psutil/_psposix.py -> build/lib.macosx-10.3-fat-2.7/psutil
copying psutil/_pssunos.py -> build/lib.macosx-10.3-fat-2.7/psutil
copying psutil/error.py -> build/lib.macosx-10.3-fat-2.7/psutil
running build_ext
building '_psutil_osx' extension
creating build/temp.macosx-10.3-fat-2.7
creating build/temp.macosx-10.3-fat-2.7/psutil
creating build/temp.macosx-10.3-fat-2.7/psutil/arch
creating build/temp.macosx-10.3-fat-2.7/psutil/arch/osx
gcc-4.0 -fno-strict-aliasing -fno-common -dynamic -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch ppc -arch i386 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c psutil/_psutil_osx.c -o build/temp.macosx-10.3-fat-2.7/psutil/_psutil_osx.o
psutil/_psutil_osx.c:18:21: psutil/_psutil_osx.c:18:21: error: error: libproc.h: No such file or directory
libproc.h: No such file or directory
psutil/_psutil_osx.c:19:27: error: psutil/_psutil_osx.c:19:27:sys/proc_info.h: No such file or directory
error: sys/proc_info.h: No such file or directory
psutil/_psutil_osx.c:32:32:psutil/_psutil_osx.c:32:32: error: error: mach/shared_region.h: No such file or directorymach/shared_region.h: No such file or directory

psutil/_psutil_osx.c: In function ‘get_process_cwd’:psutil/_psutil_osx.c: In function ‘get_process_cwd’:

[...long list of error messages here...]

psutil/_psutil_osx.c:1429: error: dereferencing pointer to incomplete type
lipo: can't figure out the architecture type of: /var/folders/NR/NRerLp3lH00IqJcwaTwU1U+++TM/-Tmp-//cciVujN2.out
error: command 'gcc-4.0' failed with exit status 1


Can anybody help me with this?  What is going wrong here, and what should I do?? 

(I get it that some files are missing, so

1. What are they?
2. Where can I get them from?, and
3. Where on my computer should I put them?)

Many thanks,
Ingrid

louis...@gmail.com

unread,
Nov 20, 2013, 12:04:28 AM11/20/13
to psu...@googlegroups.com, happyp...@gmail.com

Ingrid

unread,
Nov 20, 2013, 2:10:32 AM11/20/13
to psu...@googlegroups.com, happyp...@gmail.com, louis...@gmail.com
Thank you so much for the quick answer!  I tried it, but...

ingrid$ sudo apt-get install python-dev
Reading Package Lists... Done
Building Dependency Tree... Done
E: Couldn't find package python-dev


Where can I find this package??

Giampaolo Rodola'

unread,
Nov 20, 2013, 3:23:10 AM11/20/13
to psu...@googlegroups.com, happyp...@gmail.com, louis...@gmail.com
How about:

find /usr/include/ | grep libproc

...? Does it find anything? I've always tested psutil on OSX 10.6 so it is entirely possible that on 10.5 it won't work at all.


--
You received this message because you are subscribed to the "Python process utilities (psutil)" project group:
http://code.google.com/p/psutil
To post to this group, send email to psu...@googlegroups.com
To unsubscribe from this group, send email to psutil-un...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/psutil
---
You received this message because you are subscribed to the Google Groups "psutil" group.
To unsubscribe from this group and stop receiving emails from it, send an email to psutil+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ingrid

unread,
Nov 20, 2013, 3:30:41 AM11/20/13
to psu...@googlegroups.com, happyp...@gmail.com, louis...@gmail.com
Thanks for your help!  It does find

ingrid$ find /usr/include/ | grep libproc
/usr/include//libproc.h

Giampaolo Rodola'

unread,
Nov 20, 2013, 3:41:09 AM11/20/13
to psu...@googlegroups.com, happyp...@gmail.com, louis...@gmail.com
Mmm... I'm not an OSX user myself so I'm not so sure how to help.
When I first set up my current virtualized OSX 10.6 box 3 years ago in order to test/develop psutil I remember I installed something called XCode and possibly also the Python header files (what on Linux debian-like distros you do with "apt-get install python-dev").
Do you have any error complaining about missing Python.h or something? Are you able to compile other Python extension modules written in C?
If not you might try compiling pysendfile (https://code.google.com/p/pysendfile/) and see if it succeds (try pip install pysendfile).

Jay Loden

unread,
Nov 20, 2013, 10:50:46 AM11/20/13
to psu...@googlegroups.com, happyp...@gmail.com, louis...@gmail.com
That looks correct as far as location for the libproc.h file to me. Maybe this is permissions issue? Can you try building with 'sudo python setup.py install' instead of running it as an end user account, and see if that succeeds? 

-Jay

Ingrid

unread,
Nov 20, 2013, 12:18:28 PM11/20/13
to psu...@googlegroups.com, happyp...@gmail.com, louis...@gmail.com
Thank you both for your replies!  I do have XCode and gcc installed, and I did try sudo apt-get install python-dev, but as stated above, it couldn't find the package. 

Re: correct location:  In the path it returned, there is a double slash.  Is that normal?

Thank you so much for trying to help me!
Ingrid

Jay Loden

unread,
Nov 20, 2013, 12:39:49 PM11/20/13
to psu...@googlegroups.com, happyp...@gmail.com, louis...@gmail.com
Double slash is fine, that's just because you included the slash in the search path originally. 

Note I was talking about running 'sudo python setup.py install' for psutil, not the apt-get command. 

You already have the libproc.h and it's in one of the core system header directories, so it should be finding it. The only thing I can think of is the permissions since you ran the original command as your regular user instead of root. 

-Jay

Ingrid

unread,
Nov 20, 2013, 1:12:59 PM11/20/13
to psu...@googlegroups.com, happyp...@gmail.com, louis...@gmail.com
I did sudo python setup.py install, too.  That was one of the first things I tried...  :-(  Same error, unfortunately.

For what it's worth, here is the full spate of error messages I am getting:

ingridpc:psutil-1.1.3 ingrid$ sudo python setup.py install
Password:

running install
running bdist_egg
running egg_info
writing psutil.egg-info/PKG-INFO
writing top-level names to psutil.egg-info/top_level.txt
writing dependency_links to psutil.egg-info/dependency_links.txt
reading manifest file 'psutil.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'psutil.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.3-fat/egg
running install_lib
running build_py
running build_ext
building '_psutil_osx' extension
gcc-4.0 -fno-strict-aliasing -fno-common -dynamic -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch ppc -arch i386 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c psutil/_psutil_osx.c -o build/temp.macosx-10.3-fat-2.7/psutil/_psutil_osx.o
psutil/_psutil_osx.c:18:21: error: libproc.h: No such file or directory
psutil/_psutil_osx.c:18:21: error: psutil/_psutil_osx.c:19:27:libproc.h: No such file or directory
error: sys/proc_info.h: No such file or directory
psutil/_psutil_osx.c:19:27: error: sys/proc_info.h: No such file or directory
psutil/_psutil_osx.c:32:32: error: psutil/_psutil_osx.c:32:32: mach/shared_region.h: No such file or directory
error: mach/shared_region.h: No such file or directory

psutil/_psutil_osx.c: In function ‘get_process_cwd’:psutil/_psutil_osx.c: In function ‘get_process_cwd’:

psutil/_psutil_osx.c:139: error: storage size of ‘pathinfo’ isn’t knownpsutil/_psutil_osx.c:139: error: storage size of ‘pathinfo’ isn’t known

psutil/_psutil_osx.c:145: error: ‘PROC_PIDVNODEPATHINFO’ undeclared (first use in this function)
psutil/_psutil_osx.c:145: error: (Each undeclared identifier is reported only oncepsutil/_psutil_osx.c:145: error: ‘PROC_PIDVNODEPATHINFO’ undeclared (first use in this function)

psutil/_psutil_osx.c:145: error: for each function it appears in.)psutil/_psutil_osx.c:145: error: (Each undeclared identifier is reported only once

psutil/_psutil_osx.c:145: error: for each function it appears in.)
psutil/_psutil_osx.c:139: warning: unused variable ‘pathinfo’
psutil/_psutil_osx.c:139: warning: unused variable ‘pathinfo’
psutil/_psutil_osx.c: In function ‘get_process_exe’:
psutil/_psutil_osx.c:167: warning: implicit declaration of function ‘proc_pidpath’
psutil/_psutil_osx.c: In function ‘get_process_exe’:
psutil/_psutil_osx.c:167: warning: implicit declaration of function ‘proc_pidpath’
psutil/_psutil_osx.c: In function ‘get_process_memory_maps’:
psutil/_psutil_osx.c:337: warning: format ‘%016lx’ expects type ‘long unsigned int’, but argument 3 has type ‘vm_address_t’
psutil/_psutil_osx.c: In function ‘get_process_memory_maps’:psutil/_psutil_osx.c:337: warning: format ‘%016lx’ expects type ‘long unsigned int’, but argument 4 has type ‘vm_address_t’

psutil/_psutil_osx.c:337: warning: format ‘%016lx’ expects type ‘long unsigned int’, but argument 3 has type ‘vm_address_t’
psutil/_psutil_osx.c:337: warning: format ‘%016lx’ expects type ‘long unsigned int’, but argument 4 has type ‘vm_address_t’
psutil/_psutil_osx.c:346: warning: implicit declaration of function ‘proc_regionfilename’
psutil/_psutil_osx.c:346: warning: implicit declaration of function ‘proc_regionfilename’
psutil/_psutil_osx.c: In function ‘get_process_cpu_times’:
psutil/_psutil_osx.c:452: error: storage size of ‘pti’ isn’t known
psutil/_psutil_osx.c:456: error: ‘PROC_PIDTASKINFO’ undeclared (first use in this function)
psutil/_psutil_osx.c: In function ‘get_process_cpu_times’:
psutil/_psutil_osx.c:452: error: storage size of ‘pti’ isn’t known
psutil/_psutil_osx.c:452: warning: unused variable ‘pti’
psutil/_psutil_osx.c:456: error: ‘PROC_PIDTASKINFO’ undeclared (first use in this function)
psutil/_psutil_osx.c:452: warning: unused variable ‘pti’
psutil/_psutil_osx.c: In function ‘get_process_memory_info’:
psutil/_psutil_osx.c:491: error: storage size of ‘pti’ isn’t known
psutil/_psutil_osx.c:495: error: ‘PROC_PIDTASKINFO’ undeclared (first use in this function)
psutil/_psutil_osx.c: In function ‘get_process_memory_info’:
psutil/_psutil_osx.c:491: error: storage size of ‘pti’ isn’t known
psutil/_psutil_osx.c:491: warning: unused variable ‘pti’
psutil/_psutil_osx.c:495: error: ‘PROC_PIDTASKINFO’ undeclared (first use in this function)
psutil/_psutil_osx.c: In function ‘get_process_num_threads’:psutil/_psutil_osx.c:491: warning: unused variable ‘pti’

psutil/_psutil_osx.c:521: error: storage size of ‘pti’ isn’t known
psutil/_psutil_osx.c:525: error: ‘PROC_PIDTASKINFO’ undeclared (first use in this function)
psutil/_psutil_osx.c: In function ‘get_process_num_threads’:
psutil/_psutil_osx.c:521: error: storage size of ‘pti’ isn’t known
psutil/_psutil_osx.c:521: warning: unused variable ‘pti’
psutil/_psutil_osx.c:525: error: ‘PROC_PIDTASKINFO’ undeclared (first use in this function)
psutil/_psutil_osx.c: In function ‘get_process_num_ctx_switches’:
psutil/_psutil_osx.c:521: warning: unused variable ‘pti’
psutil/_psutil_osx.c:539: error: storage size of ‘pti’ isn’t known
psutil/_psutil_osx.c:543: error: ‘PROC_PIDTASKINFO’ undeclared (first use in this function)
psutil/_psutil_osx.c: In function ‘get_process_num_ctx_switches’:psutil/_psutil_osx.c:539: warning: unused variable ‘pti’

psutil/_psutil_osx.c:539: error: storage size of ‘pti’ isn’t known
psutil/_psutil_osx.c:543: error: ‘PROC_PIDTASKINFO’ undeclared (first use in this function)
psutil/_psutil_osx.c:539: warning: unused variable ‘pti’
psutil/_psutil_osx.c: In function ‘get_disk_partitions’:
psutil/_psutil_osx.c:762: warning: implicit declaration of function ‘getfsstat’
psutil/_psutil_osx.c:762: error: ‘MNT_NOWAIT’ undeclared (first use in this function)
psutil/_psutil_osx.c:769: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c: In function ‘get_disk_partitions’:
psutil/_psutil_osx.c:762: warning: implicit declaration of function ‘getfsstat’
psutil/_psutil_osx.c:762: error: ‘MNT_NOWAIT’ undeclared (first use in this function)psutil/_psutil_osx.c:786: error: invalid use of undefined type ‘struct statfs’

psutil/_psutil_osx.c:786: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:789: error: ‘MNT_RDONLY’ undeclared (first use in this function)
psutil/_psutil_osx.c:769: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:793: error: ‘MNT_SYNCHRONOUS’ undeclared (first use in this function)
psutil/_psutil_osx.c:795: error: ‘MNT_NOEXEC’ undeclared (first use in this function)
psutil/_psutil_osx.c:786: error: invalid use of undefined type ‘struct statfs’
psutil/_psutil_osx.c:797: error: ‘MNT_NOSUID’ undeclared (first use in this function)psutil/_psutil_osx.c:786: error: dereferencing pointer to incomplete type

psutil/_psutil_osx.c:789: error: ‘MNT_RDONLY’ undeclared (first use in this function)
psutil/_psutil_osx.c:799: error: ‘MNT_UNION’ undeclared (first use in this function)
psutil/_psutil_osx.c:801: error: ‘MNT_ASYNC’ undeclared (first use in this function)
psutil/_psutil_osx.c:793: error: ‘MNT_SYNCHRONOUS’ undeclared (first use in this function)
psutil/_psutil_osx.c:803: error: ‘MNT_EXPORTED’ undeclared (first use in this function)
psutil/_psutil_osx.c:795: error: ‘MNT_NOEXEC’ undeclared (first use in this function)
psutil/_psutil_osx.c:805: error: ‘MNT_QUARANTINE’ undeclared (first use in this function)
psutil/_psutil_osx.c:797: error: ‘Mpsutil/_psutil_osx.c:807: error: ‘MNT_LOCAL’ undeclared (first use in this function)
NT_NOSUID’ undeclared (first use in this function)
psutil/_psutil_osx.c:809: error: ‘MNT_QUOTA’ undeclared (first use in this function)
psutil/_psutil_osx.c:799: error: ‘MNT_UNION’ undeclared (first use in this function)
psutil/_psutil_osx.c:811: error: ‘MNT_ROOTFS’ undeclared (first use in this function)
psutil/_psutil_osx.c:801: error: ‘MNT_ASYNC’ undeclared (first use in this function)
psutil/_psutil_osx.c:813: error: ‘MNT_DOVOLFS’ undeclared (first use in this function)
psutil/_psutil_osx.c:803: error: ‘MNT_EXPORTED’ undeclared (first use in this function)
psutil/_psutil_osx.c:815: error: ‘MNT_DONTBROWSE’ undeclared (first use in this function)psutil/_psutil_osx.c:805: error: ‘MNT_QUARANTINE’ undeclared (first use in this function)

psutil/_psutil_osx.c:817: error: ‘MNT_IGNORE_OWNERSHIP’ undeclared (first use in this function)psutil/_psutil_osx.c:807: error: ‘MNT_LOCAL’ undeclared (first use in this function)

psutil/_psutil_osx.c:819: error: ‘MNT_AUTOMOUNTED’ undeclared (first use in this function)
psutil/_psutil_osx.c:809: error: ‘MNT_QUOTA’ undeclared (first use in this function)
psutil/_psutil_osx.c:821: error: ‘MNT_JOURNALED’ undeclared (first use in this function)psutil/_psutil_osx.c:811: error: ‘MNT_ROOTFS’ undeclared (first use in this function)

psutil/_psutil_osx.c:823: error: ‘MNT_NOUSERXATTR’ undeclared (first use in this function)
psutil/_psutil_osx.c:813: error: ‘MNT_DOVOLFS’ undeclared (first use in this function)
psutil/_psutil_osx.c:825: error: ‘MNT_DEFWRITE’ undeclared (first use in this function)
psutil/_psutil_osx.c:815: error: ‘MNT_DONTBROWSE’ undeclared (first use in this function)
psutil/_psutil_osx.c:827: error: ‘MNT_MULTILABEL’ undeclared (first use in this function)psutil/_psutil_osx.c:817: error: ‘MNT_IGNORE_OWNERSHIP’ undeclared (first use in this function)

psutil/_psutil_osx.c:829: error: ‘MNT_NOATIME’ undeclared (first use in this function)psutil/_psutil_osx.c:819: error: ‘MNT_AUTOMOUNTED’ undeclared (first use in this function)

psutil/_psutil_osx.c:831: error: ‘MNT_UPDATE’ undeclared (first use in this function)
psutil/_psutil_osx.c:821: error: ‘MNT_JOURNALED’ undeclared (first use in this function)
psutil/_psutil_osx.c:833: error: ‘MNT_RELOAD’ undeclared (first use in this function)
psutil/_psutil_osx.c:823: error: ‘MNT_NOUSERXATTR’ undeclared (first use in this function)
psutil/_psutil_osx.c:835: error: ‘MNT_FORCE’ undeclared (first use in this function)
psutil/_psutil_osx.c:825: error: ‘MNT_DEFWRITE’ undeclared (first use in this function)
psutil/_psutil_osx.c:837: error: ‘MNT_CMDFLAGS’ undeclared (first use in this function)
psutil/_psutil_osx.c:827: error: ‘MNT_MULTILABEL’ undeclared (first use in this function)
psutil/_psutil_osx.c:840: error: invalid use of undefined type ‘struct statfs’
psutil/_psutil_osx.c:829: error: ‘MNT_NOATIME’ undeclared (first use in this function)
psutil/_psutil_osx.c:840: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:841: error: invalid use of undefined type ‘struct statfs’psutil/_psutil_osx.c:831: error: ‘MNT_UPDATE’ undeclared (first use in this function)

psutil/_psutil_osx.c:841: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:833: error: ‘MNT_RELOAD’ undeclared (first use in this function)
psutil/_psutil_osx.c:842: error: invalid use of undefined type ‘struct statfs’
psutil/_psutil_osx.c:842: error: dereferencing pointer to incomplpsutil/_psutil_osx.c:835: error: ‘MNT_FORCE’ undeclared (first use in this function)
psutil/_psutil_osx.c:837: error: ‘MNT_CMDFLAGS’ undeclared (first use in this function)ete type

psutil/_psutil_osx.c:840: error: invalid use of undefined type ‘struct statfs’
psutil/_psutil_osx.c:840: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:841: error: invalid use of undefined type ‘struct statfs’
psutil/_psutil_osx.c:841: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:842: error: invalid use of undefined type ‘struct statfs’
psutil/_psutil_osx.c:842: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c: In function ‘get_process_open_files’:
psutil/_psutil_osx.c:1007: error: storage size of ‘vi’ isn’t known
psutil/_psutil_osx.c:1019: warning: implicit declaration of function ‘proc_pidinfo’
psutil/_psutil_osx.c: In function ‘get_process_open_files’:psutil/_psutil_osx.c:1019: error: ‘PROC_PIDLISTFDS’ undeclared (first use in this function)

psutil/_psutil_osx.c:1007: error: storage size of ‘vi’ isn’t known
psutil/_psutil_osx.c:1039: error: ‘PROC_PIDLISTFD_SIZE’ undeclared (first use in this function)psutil/_psutil_osx.c:1019: warning: implicit declaration of function ‘proc_pidinfo’

psutil/_psutil_osx.c:1019: error: ‘PROC_PIDLISTFDS’ undeclared (first use in this function)
psutil/_psutil_osx.c:1043: error: invalid use of undefined type ‘struct proc_fdinfo’
psutil/_psutil_osx.c:1043: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1045: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1045: error: ‘PROX_FDTYPE_VNODE’ undeclared (first use in this function)
psutil/_psutil_osx.c:1047: warning: implicit declaration of function ‘proc_pidfdinfo’psutil/_psutil_osx.c:1039: error: ‘PROC_PIDLISTFD_SIZE’ undeclared (first use in this function)

psutil/_psutil_osx.c:1048: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1049: error: ‘PROC_PIDFDVNODEPATHINFO’ undeclared (first use in this function)psutil/_psutil_osx.c:1043: error: invalid use of undefined type ‘struct proc_fdinfo’

psutil/_psutil_osx.c:1043: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1045: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1045: error: ‘PROX_FDTYPE_VNODE’ undeclared (first use in this function)
psutil/_psutil_osx.c:1047: warning: implicit declaration of function ‘proc_pidfdinfo’
psutil/_psutil_osx.c:1048: error: dereferencing pointer to incomplete typepsutil/_psutil_osx.c:1074: error: dereferencing pointer to incomplete type

psutil/_psutil_osx.c:1049: error: ‘PROC_PIDFDVNODEPATHINFO’ undeclared (first use in this function)
psutil/_psutil_osx.c:1074: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1007: warning: unused variable ‘vi’
psutil/_psutil_osx.c:1007: warning: unused variable ‘vi’
psutil/_psutil_osx.c: In function ‘get_process_connections’:
psutil/_psutil_osx.c:1126: error: storage size of ‘si’ isn’t known
psutil/_psutil_osx.c: In function ‘get_process_connections’:
psutil/_psutil_osx.c:1126: error: storage size of ‘si’ isn’t knownpsutil/_psutil_osx.c:1151: error: ‘PROC_PIDLISTFDS’ undeclared (first use in this function)

psutil/_psutil_osx.c:1168: error: ‘PROC_PIDLISTFD_SIZE’ undeclared (first use in this function)
psutil/_psutil_osx.c:1175: error: invalid use of undefined type ‘struct proc_fdinfo’
psutil/_psutil_osx.c:1175: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1151: error: ‘PROC_PIDLISTFDS’ undeclared (first use in this function)
psutil/_psutil_osx.c:1177: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1177: error: ‘PROX_FDTYPE_SOCKET’ undeclared (first use in this function)
psutil/_psutil_osx.c:1179: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1179: error: ‘PROC_PIDFDSOCKETINFO’ undeclared (first use in this function)
psutil/_psutil_osx.c:1168: error: ‘PROC_PIDLISTFD_SIZE’ undeclared (first use in this function)
psutil/_psutil_osx.c:1175: error: invalid use of undefined type ‘struct proc_fdinfo’
psutil/_psutil_osx.c:1175: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1177: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1177: error: ‘PROX_FDTYPE_SOCKET’ undeclared (first use in this function)
psutil/_psutil_osx.c:1179: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1211: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1179: error: ‘PROC_PIDFDSOCKETINFO’ undeclared (first use in this function)
psutil/_psutil_osx.c:1211: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1126: warning: unused variable ‘si’
psutil/_psutil_osx.c:1126: warning: unused variable ‘si’
psutil/_psutil_osx.c: In function ‘get_process_num_fds’:
psutil/_psutil_osx.c:1346: error: ‘PROC_PIDLISTFDS’ undeclared (first use in this function)
psutil/_psutil_osx.c:1362: error: ‘PROC_PIDLISTFD_SIZE’ undeclared (first use in this function)
psutil/_psutil_osx.c: In function ‘get_process_num_fds’:
psutil/_psutil_osx.c:1346: error: ‘PROC_PIDLISTFDS’ undeclared (first use in this function)
psutil/_psutil_osx.c:1362: error: ‘PROC_PIDLISTFD_SIZE’ undeclared (first use in this function)
psutil/_psutil_osx.c: In function ‘get_net_io_counters’:
psutil/_psutil_osx.c:1411: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1413: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1413: error: ‘RTM_IFINFO2’ undeclared (first use in this function)
psutil/_psutil_osx.c:1416: error: invalid use of undefined type ‘struct if_msghdr2’
psutil/_psutil_osx.c: In function ‘get_net_io_counters’:
psutil/_psutil_osx.c:1411: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1413: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1423: error: dereferencing pointer to incomplete typepsutil/_psutil_osx.c:1413: error: ‘RTM_IFINFO2’ undeclared (first use in this function)

psutil/_psutil_osx.c:1424: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1425: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1416: error: invalid use of undefined type ‘struct if_msghdr2’psutil/_psutil_osx.c:1426: error: dereferencing pointer to incomplete type

psutil/_psutil_osx.c:1427: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1428: error: dereferencing pointer to incomplete type

psutil/_psutil_osx.c:1429: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1423: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1424: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1425: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1426: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1427: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1428: error: dereferencing pointer to incomplete type

psutil/_psutil_osx.c:1429: error: dereferencing pointer to incomplete type
lipo: can't figure out the architecture type of: /var/tmp//ccK0siBg.out

error: command 'gcc-4.0' failed with exit status 1

ingridpc:psutil-1.1.3 ingrid$

Jay Loden

unread,
Nov 20, 2013, 1:39:24 PM11/20/13
to psu...@googlegroups.com, happyp...@gmail.com, Si Liu
I notice your build process is running gcc-4.0 which is different than on my stock system. Do you maybe have more than one copy of gcc installed, outside of Xcode? It looked like you have apt-get on your system (fink installed?) I wonder if you're accidentally invoking gcc from the wrong build system instead of invoking Xcode which is what's needed for the appropriate libs to be found. 

-Jay

Ingrid

unread,
Nov 20, 2013, 6:17:21 PM11/20/13
to psu...@googlegroups.com, happyp...@gmail.com, Si Liu
Thanks for your answer, Jay.  Yes, I have installed fink to be able to run apt-get.  Which version of gcc should I be running?

Jay Loden

unread,
Nov 20, 2013, 6:28:46 PM11/20/13
to psu...@googlegroups.com, happyp...@gmail.com, Si Liu
gcc comes as part of Xcode, you should be using that version to properly include the OS X libs. For example on my system:

[user@host ]$ which gcc
/usr/bin/gcc
[user@host]$ gcc --version
i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

I suspect in your system it's running a gcc-4.0 that's part of a fink-installed package instead. At a guess, you're using a different Python than the one that comes with OS X, and it's trying to compile with the version of gcc that the Python package was compiled with originally. Did you install python with fink also? 

I don't know exactly what to tell you on how to fix it but you would need to find a way to make sure the right gcc version is being called (either by adding an appropriate environment variable, or using the OS X default version of Python), or at the very least that the correct include locations are being passed to setuptools. 

Some of the suggestions/info here may help since it's effectively the same problem with a different lib: 


-Jay

Ingrid

unread,
Nov 21, 2013, 1:30:06 AM11/21/13
to psu...@googlegroups.com, happyp...@gmail.com, Si Liu
Hm.  Here's what I get on my computer:

ingrid$ which gcc
/usr/bin/gcc

ingrid$ gcc --version
i686-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5490)
Copyright (C) 2005 Free Software Foundation, Inc.

This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

That doesn't look that different from your output??

I am using a custom-installed python (2.7.6) from python.org, though, not the original Apple distribution.  (I did not install it with fink.  I only installed fink so I could try out the first suggestion in this thread.)

I am not sure the problem you linked is the same as the one I am facing (or maybe I don't understand the problem well enough?).  It looks like in their case, the right version of the compiler was missing/not in the path?

Unfortunately, I cannot use the OS X version of Python, since the ultimate goal is to make a standalone application of my program with py2app, and py2app will make the application bundle only semi-standalone when using the system version of Python (it won't include Python if it's part of the system).

Jay Loden

unread,
Nov 21, 2013, 9:21:17 AM11/21/13
to psu...@googlegroups.com, happyp...@gmail.com, Si Liu
Yes, but look at your output from running setup.py - it's not executing 'gcc'. It's executing 'gcc-4.0',  which is a different binary. 

Your problem is the custom version of python. Using python with setup.py will attempt to build extensions with the same environment that Python itself was built with. In this case, that means running a different gcc, which is not seeing the system libraries required to build psutil properly.

The workarounds suggested in the link I provided should probably work for your situation since the solution is the same; you need to force setup.py to use the Xcode gcc instead of gcc-4.0 

-Jay

Ingrid

unread,
Nov 22, 2013, 6:07:18 PM11/22/13
to psu...@googlegroups.com, happyp...@gmail.com, Si Liu
Sorry if I seem a little dense... but I am really confused.  OK, so Python is trying to use the same compiler version that it was compiled with itself.  First question:  How do I know which version that is?  Is that the gcc-4.0 version that it is trying to run?

Secondly, you said I should be running the XCode gcc.  How do I know which version that is?

So I did

ingrid$ which gcc
/usr/bin/gcc

and looked into /usr/bin.  It turned out that /usr/bin/gcc was a link to /usr/bin/gcc-4.0.  The other version I saw installed there was gcc-4.2.  So I changed the gcc link to point at gcc-4.2

ingrid$ ls -l /usr/bin/gcc*
lrwxr-xr-x  1 root  wheel       7 Nov 22 16:38 /usr/bin/gcc -> gcc-4.2
-rwxr-xr-x  1 root  wheel   93088 Sep 26  2008 /usr/bin/gcc-4.0
-rwxr-xr-x  1 root  wheel  105680 Oct  1  2008 /usr/bin/gcc-4.2

, set the environment variables CC and ARCHFLAGS as suggested in the linked article, and ran setup.py again.  Unfortunately, I now get a new list of error messages:

ingridpc:psutil-1.1.3 ingrid$ export CC=gcc-4.2
ingridpc:psutil-1.1.3 ingrid$ export ARCHFLAGS='-arch i386 -arch x86_64'
ingridpc:psutil-1.1.3 ingrid$ python setup.py install
running install
running bdist_egg
running egg_info
writing psutil.egg-info/PKG-INFO
writing top-level names to psutil.egg-info/top_level.txt
writing dependency_links to psutil.egg-info/dependency_links.txt
reading manifest file 'psutil.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'psutil.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.3-fat/egg
running install_lib
running build_py
running build_ext
building '_psutil_osx' extension
gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c psutil/_psutil_osx.c -o build/temp.macosx-10.3-fat-2.7/psutil/_psutil_osx.o
In file included from /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/unicodeobject.h:4,
                 from /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:85,
                 from psutil/_psutil_osx.c:9:
/Developer/SDKs/MacOSX10.4u.sdk/usr/include/stdarg.h:4:25: error: stdarg.h: No such file or directory

psutil/_psutil_osx.c:18:21: error: libproc.h: No such file or directory
psutil/_psutil_osx.c:19:27: error: sys/proc_info.h: No such file or directory
psutil/_psutil_osx.c:32:32: error: mach/shared_region.h: No such file or directory
In file included from /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:16,
                 from psutil/_psutil_osx.c:36:
/Developer/SDKs/MacOSX10.4u.sdk/usr/include/float.h:8:24: error: float.h: No such file or directory
psutil/_psutil_osx.c: In function ‘get_process_cwd’:

psutil/_psutil_osx.c:139: error: storage size of ‘pathinfo’ isn’t known
psutil/_psutil_osx.c:145: error: ‘PROC_PIDVNODEPATHINFO’ undeclared (first use in this function)
psutil/_psutil_osx.c:145: error: (Each undeclared identifier is reported only once
psutil/_psutil_osx.c:145: error: for each function it appears in.)
psutil/_psutil_osx.c:139: warning: unused variable ‘pathinfo’
psutil/_psutil_osx.c: In function ‘get_process_exe’:
psutil/_psutil_osx.c:167: warning: implicit declaration of function ‘proc_pidpath’
psutil/_psutil_osx.c: In function ‘get_process_memory_maps’:
psutil/_psutil_osx.c:337: warning: format ‘%016lx’ expects type ‘long unsigned int’, but argument 3 has type ‘vm_address_t’
psutil/_psutil_osx.c:337: warning: format ‘%016lx’ expects type ‘long unsigned int’, but argument 4 has type ‘vm_address_t’
psutil/_psutil_osx.c:346: warning: implicit declaration of function ‘proc_regionfilename’
psutil/_psutil_osx.c: In function ‘get_process_cpu_times’:
psutil/_psutil_osx.c:452: error: storage size of ‘pti’ isn’t known
psutil/_psutil_osx.c:456: error: ‘PROC_PIDTASKINFO’ undeclared (first use in this function)
psutil/_psutil_osx.c:452: warning: unused variable ‘pti’
psutil/_psutil_osx.c: In function ‘get_process_memory_info’:
psutil/_psutil_osx.c:491: error: storage size of ‘pti’ isn’t known
psutil/_psutil_osx.c:495: error: ‘PROC_PIDTASKINFO’ undeclared (first use in this function)
psutil/_psutil_osx.c:491: warning: unused variable ‘pti’
psutil/_psutil_osx.c: In function ‘get_process_num_threads’:
psutil/_psutil_osx.c:521: error: storage size of ‘pti’ isn’t known
psutil/_psutil_osx.c:525: error: ‘PROC_PIDTASKINFO’ undeclared (first use in this function)
psutil/_psutil_osx.c:521: warning: unused variable ‘pti’
psutil/_psutil_osx.c: In function ‘get_process_num_ctx_switches’:

psutil/_psutil_osx.c:539: error: storage size of ‘pti’ isn’t known
psutil/_psutil_osx.c:543: error: ‘PROC_PIDTASKINFO’ undeclared (first use in this function)
psutil/_psutil_osx.c:539: warning: unused variable ‘pti’
psutil/_psutil_osx.c: In function ‘get_disk_partitions’:
psutil/_psutil_osx.c:762: warning: implicit declaration of function ‘getfsstat’
psutil/_psutil_osx.c:762: error: ‘MNT_NOWAIT’ undeclared (first use in this function)
psutil/_psutil_osx.c:769: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:786: error: invalid use of undefined type ‘struct statfs’
psutil/_psutil_osx.c:786: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:789: error: ‘MNT_RDONLY’ undeclared (first use in this function)
psutil/_psutil_osx.c:793: error: ‘MNT_SYNCHRONOUS’ undeclared (first use in this function)
psutil/_psutil_osx.c:795: error: ‘MNT_NOEXEC’ undeclared (first use in this function)
psutil/_psutil_osx.c:797: error: ‘MNT_NOSUID’ undeclared (first use in this function)

psutil/_psutil_osx.c:799: error: ‘MNT_UNION’ undeclared (first use in this function)
psutil/_psutil_osx.c:801: error: ‘MNT_ASYNC’ undeclared (first use in this function)
psutil/_psutil_osx.c:803: error: ‘MNT_EXPORTED’ undeclared (first use in this function)
psutil/_psutil_osx.c:805: error: ‘MNT_QUARANTINE’ undeclared (first use in this function)
psutil/_psutil_osx.c:807: error: ‘MNT_LOCAL’ undeclared (first use in this function)
psutil/_psutil_osx.c:809: error: ‘MNT_QUOTA’ undeclared (first use in this function)
psutil/_psutil_osx.c:811: error: ‘MNT_ROOTFS’ undeclared (first use in this function)
psutil/_psutil_osx.c:813: error: ‘MNT_DOVOLFS’ undeclared (first use in this function)
psutil/_psutil_osx.c:815: error: ‘MNT_DONTBROWSE’ undeclared (first use in this function)
psutil/_psutil_osx.c:817: error: ‘MNT_IGNORE_OWNERSHIP’ undeclared (first use in this function)
psutil/_psutil_osx.c:819: error: ‘MNT_AUTOMOUNTED’ undeclared (first use in this function)
psutil/_psutil_osx.c:821: error: ‘MNT_JOURNALED’ undeclared (first use in this function)
psutil/_psutil_osx.c:823: error: ‘MNT_NOUSERXATTR’ undeclared (first use in this function)
psutil/_psutil_osx.c:825: error: ‘MNT_DEFWRITE’ undeclared (first use in this function)
psutil/_psutil_osx.c:827: error: ‘MNT_MULTILABEL’ undeclared (first use in this function)
psutil/_psutil_osx.c:829: error: ‘MNT_NOATIME’ undeclared (first use in this function)
psutil/_psutil_osx.c:831: error: ‘MNT_UPDATE’ undeclared (first use in this function)
psutil/_psutil_osx.c:833: error: ‘MNT_RELOAD’ undeclared (first use in this function)
psutil/_psutil_osx.c:835: error: ‘MNT_FORCE’ undeclared (first use in this function)
psutil/_psutil_osx.c:837: error: ‘MNT_CMDFLAGS’ undeclared (first use in this function)

psutil/_psutil_osx.c:840: error: invalid use of undefined type ‘struct statfs’
psutil/_psutil_osx.c:840: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:841: error: invalid use of undefined type ‘struct statfs’
psutil/_psutil_osx.c:841: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:842: error: invalid use of undefined type ‘struct statfs’
psutil/_psutil_osx.c:842: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c: In function ‘get_process_open_files’:
psutil/_psutil_osx.c:1007: error: storage size of ‘vi’ isn’t known
psutil/_psutil_osx.c:1019: warning: implicit declaration of function ‘proc_pidinfo’
psutil/_psutil_osx.c:1019: error: ‘PROC_PIDLISTFDS’ undeclared (first use in this function)
psutil/_psutil_osx.c:1039: error: ‘PROC_PIDLISTFD_SIZE’ undeclared (first use in this function)
psutil/_psutil_osx.c:1043: error: invalid use of undefined type ‘struct proc_fdinfo’
psutil/_psutil_osx.c:1043: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1045: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1045: error: ‘PROX_FDTYPE_VNODE’ undeclared (first use in this function)
psutil/_psutil_osx.c:1047: warning: implicit declaration of function ‘proc_pidfdinfo’
psutil/_psutil_osx.c:1048: error: dereferencing pointer to incomplete type

psutil/_psutil_osx.c:1049: error: ‘PROC_PIDFDVNODEPATHINFO’ undeclared (first use in this function)
psutil/_psutil_osx.c:1074: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1007: warning: unused variable ‘vi’
psutil/_psutil_osx.c: In function ‘get_process_connections’:
psutil/_psutil_osx.c:1126: error: storage size of ‘si’ isn’t known
psutil/_psutil_osx.c:1151: error: ‘PROC_PIDLISTFDS’ undeclared (first use in this function)
psutil/_psutil_osx.c:1168: error: ‘PROC_PIDLISTFD_SIZE’ undeclared (first use in this function)
psutil/_psutil_osx.c:1175: error: invalid use of undefined type ‘struct proc_fdinfo’
psutil/_psutil_osx.c:1175: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1177: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1177: error: ‘PROX_FDTYPE_SOCKET’ undeclared (first use in this function)
psutil/_psutil_osx.c:1179: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1179: error: ‘PROC_PIDFDSOCKETINFO’ undeclared (first use in this function)
psutil/_psutil_osx.c:1211: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1126: warning: unused variable ‘si’
psutil/_psutil_osx.c: In function ‘get_process_num_fds’:
psutil/_psutil_osx.c:1346: error: ‘PROC_PIDLISTFDS’ undeclared (first use in this function)
psutil/_psutil_osx.c:1362: error: ‘PROC_PIDLISTFD_SIZE’ undeclared (first use in this function)
psutil/_psutil_osx.c: In function ‘get_net_io_counters’:
psutil/_psutil_osx.c:1411: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1413: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1413: error: ‘RTM_IFINFO2’ undeclared (first use in this function)
psutil/_psutil_osx.c:1416: error: invalid use of undefined type ‘struct if_msghdr2’
psutil/_psutil_osx.c:1423: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1424: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1425: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1426: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1427: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1428: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1429: error: dereferencing pointer to incomplete type
In file included from /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/unicodeobject.h:4,
                 from /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:85,
                 from psutil/_psutil_osx.c:9:
/Developer/SDKs/MacOSX10.4u.sdk/usr/include/stdarg.h:4:25: error: stdarg.h: No such file or directory

psutil/_psutil_osx.c:18:21: error: libproc.h: No such file or directory
psutil/_psutil_osx.c:19:27: error: sys/proc_info.h: No such file or directory
psutil/_psutil_osx.c:32:32: error: mach/shared_region.h: No such file or directory
In file included from /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:16,
                 from psutil/_psutil_osx.c:36:
/Developer/SDKs/MacOSX10.4u.sdk/usr/include/float.h:8:24: error: float.h: No such file or directory
psutil/_psutil_osx.c: In function ‘get_process_cwd’:

psutil/_psutil_osx.c:139: error: storage size of ‘pathinfo’ isn’t known
psutil/_psutil_osx.c:145: error: ‘PROC_PIDVNODEPATHINFO’ undeclared (first use in this function)
psutil/_psutil_osx.c:145: error: (Each undeclared identifier is reported only once
psutil/_psutil_osx.c:145: error: for each function it appears in.)
psutil/_psutil_osx.c:139: warning: unused variable ‘pathinfo’
psutil/_psutil_osx.c: In function ‘get_process_exe’:
psutil/_psutil_osx.c:167: warning: implicit declaration of function ‘proc_pidpath’
psutil/_psutil_osx.c: In function ‘get_process_memory_maps’:
psutil/_psutil_osx.c:346: warning: implicit declaration of function ‘proc_regionfilename’
psutil/_psutil_osx.c: In function ‘get_process_cpu_times’:
psutil/_psutil_osx.c:452: error: storage size of ‘pti’ isn’t known
psutil/_psutil_osx.c:456: error: ‘PROC_PIDTASKINFO’ undeclared (first use in this function)
psutil/_psutil_osx.c:452: warning: unused variable ‘pti’
psutil/_psutil_osx.c: In function ‘get_process_memory_info’:
psutil/_psutil_osx.c:491: error: storage size of ‘pti’ isn’t known
psutil/_psutil_osx.c:495: error: ‘PROC_PIDTASKINFO’ undeclared (first use in this function)
psutil/_psutil_osx.c:491: warning: unused variable ‘pti’
psutil/_psutil_osx.c: In function ‘get_process_num_threads’:
psutil/_psutil_osx.c:521: error: storage size of ‘pti’ isn’t known
psutil/_psutil_osx.c:525: error: ‘PROC_PIDTASKINFO’ undeclared (first use in this function)
psutil/_psutil_osx.c:521: warning: unused variable ‘pti’
psutil/_psutil_osx.c: In function ‘get_process_num_ctx_switches’:

psutil/_psutil_osx.c:539: error: storage size of ‘pti’ isn’t known
psutil/_psutil_osx.c:543: error: ‘PROC_PIDTASKINFO’ undeclared (first use in this function)
psutil/_psutil_osx.c:539: warning: unused variable ‘pti’
psutil/_psutil_osx.c: In function ‘get_disk_partitions’:
psutil/_psutil_osx.c:762: warning: implicit declaration of function ‘getfsstat’
psutil/_psutil_osx.c:762: error: ‘MNT_NOWAIT’ undeclared (first use in this function)
psutil/_psutil_osx.c:769: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:786: error: invalid use of undefined type ‘struct statfs’
psutil/_psutil_osx.c:786: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:789: error: ‘MNT_RDONLY’ undeclared (first use in this function)
psutil/_psutil_osx.c:793: error: ‘MNT_SYNCHRONOUS’ undeclared (first use in this function)
psutil/_psutil_osx.c:795: error: ‘MNT_NOEXEC’ undeclared (first use in this function)
psutil/_psutil_osx.c:797: error: ‘MNT_NOSUID’ undeclared (first use in this function)

psutil/_psutil_osx.c:799: error: ‘MNT_UNION’ undeclared (first use in this function)
psutil/_psutil_osx.c:801: error: ‘MNT_ASYNC’ undeclared (first use in this function)
psutil/_psutil_osx.c:803: error: ‘MNT_EXPORTED’ undeclared (first use in this function)
psutil/_psutil_osx.c:805: error: ‘MNT_QUARANTINE’ undeclared (first use in this function)
psutil/_psutil_osx.c:807: error: ‘MNT_LOCAL’ undeclared (first use in this function)
psutil/_psutil_osx.c:809: error: ‘MNT_QUOTA’ undeclared (first use in this function)
psutil/_psutil_osx.c:811: error: ‘MNT_ROOTFS’ undeclared (first use in this function)
psutil/_psutil_osx.c:813: error: ‘MNT_DOVOLFS’ undeclared (first use in this function)
psutil/_psutil_osx.c:815: error: ‘MNT_DONTBROWSE’ undeclared (first use in this function)
psutil/_psutil_osx.c:817: error: ‘MNT_IGNORE_OWNERSHIP’ undeclared (first use in this function)
psutil/_psutil_osx.c:819: error: ‘MNT_AUTOMOUNTED’ undeclared (first use in this function)
psutil/_psutil_osx.c:821: error: ‘MNT_JOURNALED’ undeclared (first use in this function)
psutil/_psutil_osx.c:823: error: ‘MNT_NOUSERXATTR’ undeclared (first use in this function)
psutil/_psutil_osx.c:825: error: ‘MNT_DEFWRITE’ undeclared (first use in this function)
psutil/_psutil_osx.c:827: error: ‘MNT_MULTILABEL’ undeclared (first use in this function)
psutil/_psutil_osx.c:829: error: ‘MNT_NOATIME’ undeclared (first use in this function)
psutil/_psutil_osx.c:831: error: ‘MNT_UPDATE’ undeclared (first use in this function)
psutil/_psutil_osx.c:833: error: ‘MNT_RELOAD’ undeclared (first use in this function)
psutil/_psutil_osx.c:835: error: ‘MNT_FORCE’ undeclared (first use in this function)
psutil/_psutil_osx.c:837: error: ‘MNT_CMDFLAGS’ undeclared (first use in this function)

psutil/_psutil_osx.c:840: error: invalid use of undefined type ‘struct statfs’
psutil/_psutil_osx.c:840: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:841: error: invalid use of undefined type ‘struct statfs’
psutil/_psutil_osx.c:841: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:842: error: invalid use of undefined type ‘struct statfs’
psutil/_psutil_osx.c:842: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c: In function ‘get_process_open_files’:
psutil/_psutil_osx.c:1007: error: storage size of ‘vi’ isn’t known
psutil/_psutil_osx.c:1019: warning: implicit declaration of function ‘proc_pidinfo’
psutil/_psutil_osx.c:1019: error: ‘PROC_PIDLISTFDS’ undeclared (first use in this function)
psutil/_psutil_osx.c:1039: error: ‘PROC_PIDLISTFD_SIZE’ undeclared (first use in this function)
psutil/_psutil_osx.c:1043: error: invalid use of undefined type ‘struct proc_fdinfo’
psutil/_psutil_osx.c:1043: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1045: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1045: error: ‘PROX_FDTYPE_VNODE’ undeclared (first use in this function)
psutil/_psutil_osx.c:1047: warning: implicit declaration of function ‘proc_pidfdinfo’
psutil/_psutil_osx.c:1048: error: dereferencing pointer to incomplete type

psutil/_psutil_osx.c:1049: error: ‘PROC_PIDFDVNODEPATHINFO’ undeclared (first use in this function)
psutil/_psutil_osx.c:1074: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1007: warning: unused variable ‘vi’
psutil/_psutil_osx.c: In function ‘get_process_connections’:
psutil/_psutil_osx.c:1126: error: storage size of ‘si’ isn’t known
psutil/_psutil_osx.c:1151: error: ‘PROC_PIDLISTFDS’ undeclared (first use in this function)
psutil/_psutil_osx.c:1168: error: ‘PROC_PIDLISTFD_SIZE’ undeclared (first use in this function)
psutil/_psutil_osx.c:1175: error: invalid use of undefined type ‘struct proc_fdinfo’
psutil/_psutil_osx.c:1175: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1177: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1177: error: ‘PROX_FDTYPE_SOCKET’ undeclared (first use in this function)
psutil/_psutil_osx.c:1179: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1179: error: ‘PROC_PIDFDSOCKETINFO’ undeclared (first use in this function)
psutil/_psutil_osx.c:1211: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1126: warning: unused variable ‘si’
psutil/_psutil_osx.c: In function ‘get_process_num_fds’:
psutil/_psutil_osx.c:1346: error: ‘PROC_PIDLISTFDS’ undeclared (first use in this function)
psutil/_psutil_osx.c:1362: error: ‘PROC_PIDLISTFD_SIZE’ undeclared (first use in this function)
psutil/_psutil_osx.c: In function ‘get_net_io_counters’:
psutil/_psutil_osx.c:1411: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1413: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1413: error: ‘RTM_IFINFO2’ undeclared (first use in this function)
psutil/_psutil_osx.c:1416: error: invalid use of undefined type ‘struct if_msghdr2’
psutil/_psutil_osx.c:1423: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1424: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1425: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1426: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1427: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1428: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1429: error: dereferencing pointer to incomplete type
lipo: can't figure out the architecture type of: /var/folders/NR/NRerLp3lH00IqJcwaTwU1U+++TM/-Tmp-//ccxJnDsi.out
error: command 'gcc-4.2' failed with exit status 1


Ingrid

unread,
Nov 22, 2013, 6:12:12 PM11/22/13
to psu...@googlegroups.com, happyp...@gmail.com, Si Liu
Forgot to add in my last post:  I REALLY appreciate your help.  Thank you!  :-)


On Thursday, November 21, 2013 6:21:17 AM UTC-8, Jay wrote:

Jay Loden

unread,
Nov 22, 2013, 9:00:00 PM11/22/13
to psu...@googlegroups.com, happyp...@gmail.com, Si Liu
Ok, I'll back up a bit here. 

1) Python knows how it was compiled. However you build Python, it remembers what it was built with. 

2) When you try to compile a library from source, it tries to build using the same build environment (compiler, etc.) that Python was built with, since it assumes/hopes you will have the same setup for both. 

3) You are running the installed version from python.org instead of the default python that ships with OS X, so it's trying to compile psutil using whatever build setup the python.org folks were using instead of what actually exists on your system.

So that's the gist of the problem. I'm not sure what the solution is since I don't have this problem so it's hard for me to suggest options, but most likely you will need to tweak some environment variables for the build process in order to build under Python.org's 2.7.6. You may also need to install some missing XCode libs based on the link below. 

You can try the steps here and see if this helps: 


(1: install XCode 10.4 support, 2: export CC=/usr/bin/gcc-4.0 and export CXX=/usr/bin/g++-4.0 before trying to build with python setup.py build/install)  

You may also need to try adding export ARCHFLAGS="-arch i386 -arch x86_64" as well, since I see other sources mentioning that as required. 

Hope some of that helps, 

-Jay

Ingrid

unread,
Nov 23, 2013, 4:00:19 AM11/23/13
to psu...@googlegroups.com, happyp...@gmail.com, Si Liu
I am still confused...  :-(


1) Python knows how it was compiled. However you build Python, it remembers what it was built with. 

OK, I got that.
 
2) When you try to compile a library from source, it tries to build using the same build environment (compiler, etc.) that Python was built with, since it assumes/hopes you will have the same setup for both. 

How do I know/can I find out what that "same build environment" is that it is looking for?  More specifically,
  1. How do I find out which compiler it is looking for?
  2. What is the "etc." part?


3) You are running the installed version from python.org instead of the default python that ships with OS X, so it's trying to compile psutil using whatever build setup the python.org folks were using instead of what actually exists on your system.
But...  both gcc-4.0 and gcc-4.2 actually do exist on my system?

You can try the steps here and see if this helps: 


(1: install XCode 10.4 support,
I think I already have that installed?

ingrid$ ls -l /Developer/SDKs/
total 0
drwxr-xr-x  7 root  wheel  238 Sep 21  2008 MacOSX10.4u.sdk
drwxr-xr-x  7 root  wheel  238 Oct 17  2008 MacOSX10.5.sdk

 
2: export CC=/usr/bin/gcc-4.0 and export CXX=/usr/bin/g++-4.0 before trying to build with python setup.py build/install)  

You may also need to try adding export ARCHFLAGS="-arch i386 -arch x86_64" as well, since I see other sources mentioning that as required. 
I did all that, but it seems I end up right were I was at the beginning?

ingridpc:psutil-1.1.3 ingrid$ export CC=/usr/bin/gcc-4.0
ingridpc:psutil-1.1.3 ingrid$ export CXX=/usr/bin/g++-4.0

ingridpc:psutil-1.1.3 ingrid$ export ARCHFLAGS='-arch i386 -arch x86_64'
ingridpc:psutil-1.1.3 ingrid$ python setup.py build
running build

running build_py
running build_ext
building '_psutil_osx' extension
/usr/bin/gcc-4.0 -fno-strict-aliasing -fno-common -dynamic -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c psutil/_psutil_osx.c -o build/temp.macosx-10.3-fat-2.7/psutil/_psutil_osx.o
psutil/_psutil_osx.c:18:21:psutil/_psutil_osx.c:18:21:  error: libproc.h: No such file or directoryerror:
libproc.h: No such file or directory
psutil/_psutil_osx.c:19:27: error: sys/proc_info.h: No such file or directory
psutil/_psutil_osx.c:19:27: error: sys/proc_info.h: No such file or directory
psutil/_psutil_osx.c:32:32:psutil/_psutil_osx.c:32:32: error:  mach/shared_region.h: No such file or directory

error: mach/shared_region.h: No such file or directory
psutil/_psutil_osx.c: In function ‘get_process_cwd’:
psutil/_psutil_osx.c:139: error: storage size of ‘pathinfo’ isn’t known
psutil/_psutil_osx.c: In function ‘get_process_cwd’:
psutil/_psutil_osx.c:139: error: storage size of ‘pathinfo’ isn’t known
psutil/_psutil_osx.c:145: error: ‘PROC_PIDVNODEPATHINFO’ undeclared (first use in this function)
psutil/_psutil_osx.c:145: error: (Each undeclared identifier is reported only once
psutil/_psutil_osx.c:145: error: ‘PROC_PIDVNODEPATHINFO’ undeclared (first use in this function)
psutil/_psutil_osx.c:145: error: for each function it appears in.)
psutil/_psutil_osx.c:145: error: (Each undeclared identifier is reported only once
psutil/_psutil_osx.c:145: error: for each function it appears in.)
psutil/_psutil_osx.c:139: warning: unused variable ‘pathinfo’
psutil/_psutil_osx.c:139: warning: unused variable ‘pathinfo’
psutil/_psutil_osx.c: In function ‘get_process_exe’:
psutil/_psutil_osx.c:167: warning: implicit declaration of function ‘proc_pidpath’
psutil/_psutil_osx.c: In function ‘get_process_exe’:
psutil/_psutil_osx.c:167: warning: implicit declaration of function ‘proc_pidpath’
psutil/_psutil_osx.c: In function ‘get_process_memory_maps’:
psutil/_psutil_osx.c:337: warning: format ‘%016lx’ expects type ‘long unsigned int’, but argument 3 has type ‘vm_address_t’
psutil/_psutil_osx.c:337: warning: format ‘%016lx’ expects type ‘long unsigned int’, but argument 4 has type ‘vm_address_t’
psutil/_psutil_osx.c: In function ‘get_process_memory_maps’:
psutil/_psutil_osx.c:346: warning: implicit declaration of function ‘proc_regionfilename’
psutil/_psutil_osx.c:346: warning: implicit declaration of function ‘proc_regionfilename’
psutil/_psutil_osx.c: In function ‘get_process_cpu_times’:psutil/_psutil_osx.c: In function ‘get_process_cpu_times’:

psutil/_psutil_osx.c:452: error: storage size of ‘pti’ isn’t knownpsutil/_psutil_osx.c:452: error: storage size of ‘pti’ isn’t known


psutil/_psutil_osx.c:456: error: ‘PROC_PIDTASKINFO’ undeclared (first use in this function)
psutil/_psutil_osx.c:456: error: ‘PROC_PIDTASKINFO’ undeclared (first use in this function)
psutil/_psutil_osx.c:452: warning: unused variable ‘pti’psutil/_psutil_osx.c:452: warning: unused variable ‘pti’

psutil/_psutil_osx.c: In function ‘get_process_memory_info’:psutil/_psutil_osx.c: In function ‘get_process_memory_info’:

psutil/_psutil_osx.c:491: error: storage size of ‘pti’ isn’t knownpsutil/_psutil_osx.c:491: error: storage size of ‘pti’ isn’t known


psutil/_psutil_osx.c:495: error: ‘PROC_PIDTASKINFO’ undeclared (first use in this function)
psutil/_psutil_osx.c:495: error: ‘PROC_PIDTASKINFO’ undeclared (first use in this function)
psutil/_psutil_osx.c:491: warning: unused variable ‘pti’
psutil/_psutil_osx.c:491: warning: unused variable ‘pti’
psutil/_psutil_osx.c: In function ‘get_process_num_threads’:
psutil/_psutil_osx.c: In function ‘get_process_num_threads’:psutil/_psutil_osx.c:521: error: storage size of ‘pti’ isn’t known

psutil/_psutil_osx.c:521: error: storage size of ‘pti’ isn’t known
psutil/_psutil_osx.c:525: error: ‘PROC_PIDTASKINFO’ undeclared (first use in this function)
psutil/_psutil_osx.c:525: error: ‘PROC_PIDTASKINFO’ undeclared (first use in this function)
psutil/_psutil_osx.c:521: warning: unused variable ‘pti’
psutil/_psutil_osx.c:521: warning: unused variable ‘pti’
psutil/_psutil_osx.c: In function ‘get_process_num_ctx_switches’:
psutil/_psutil_osx.c: In function ‘get_process_num_ctx_switches’:psutil/_psutil_osx.c:539: error: storage size of ‘pti’ isn’t known

psutil/_psutil_osx.c:539: error: storage size of ‘pti’ isn’t known
psutil/_psutil_osx.c:543: error: ‘PROC_PIDTASKINFO’ undeclared (first use in this function)
psutil/_psutil_osx.c:543: error: ‘PROC_PIDTASKINFO’ undeclared (first use in this function)
psutil/_psutil_osx.c:539: warning: unused variable ‘pti’
psutil/_psutil_osx.c:539: warning: unused variable ‘pti’
psutil/_psutil_osx.c: In function ‘get_disk_partitions’:psutil/_psutil_osx.c: In function ‘get_disk_partitions’:

psutil/_psutil_osx.c:762: warning: implicit declaration of function ‘getfsstat’psutil/_psutil_osx.c:762: warning: implicit declaration of function ‘getfsstat’

psutil/_psutil_osx.c:762: error: ‘MNT_NOWAIT’ undeclared (first use in this function)psutil/_psutil_osx.c:762: error: ‘MNT_NOWAIT’ undeclared (first use in this function)


psutil/_psutil_osx.c:769: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:769: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:786: error: invalid use of undefined type ‘struct statfs’
psutil/_psutil_osx.c:786: error: invalid use of undefined type ‘struct statfs’
psutil/_psutil_osx.c:786: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:786: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:789: error: ‘MNT_RDONLY’ undeclared (first use in this function)
psutil/_psutil_osx.c:789: error: ‘MNT_RDONLY’ undeclared (first use in this function)
psutil/_psutil_osx.c:793: error: ‘MNT_SYNCHRONOUS’ undeclared (first use in this function)
psutil/_psutil_osx.c:793: error: ‘MNT_SYNCHRONOUS’ undeclared (first use in this function)
psutil/_psutil_osx.c:795: error: ‘MNT_NOEXEC’ undeclared (first use in this function)
psutil/_psutil_osx.c:795: error: ‘MNT_NOEXEC’ undeclared (first use in this function)
psutil/_psutil_osx.c:797: error: ‘MNT_NOSUID’ undeclared (first use in this function)
psutil/_psutil_osx.c:797: error: ‘MNT_NOSUID’ undeclared (first use in this function)
psutil/_psutil_osx.c:799: error: ‘MNT_UNION’ undeclared (first use in this function)psutil/_psutil_osx.c:799: error: ‘MNT_UNION’ undeclared (first use in this function)

psutil/_psutil_osx.c:801: error: ‘MNT_ASYNC’ undeclared (first use in this function)psutil/_psutil_osx.c:801: error: ‘MNT_ASYNC’ undeclared (first use in this function)


psutil/_psutil_osx.c:803: error: ‘MNT_EXPORTED’ undeclared (first use in this function)psutil/_psutil_os
psutil/_psutil_osx.c:805: error: ‘MNT_QUARANTINE’ undeclared (first use in this function)
x.c:803: error: ‘MNT_EXPORTED’ undeclared (first use in this function)
psutil/_psutil_osx.c:807: error: ‘MNT_LOCAL’ undeclared (first use in this function)
psutil/_psutil_osx.c:809: error: ‘MNT_QUOTA’ undeclared (first use in this function)psutil/_psutil_osx.c:805: error: ‘MNT_QUARANTINE’ undeclared (first use in this function)

psutil/_psutil_osx.c:811: error: ‘MNT_ROOTFS’ undeclared (first use in this function)psutil/_psutil_osx.c:807: error: ‘MNT_LOCAL’ undeclared (first use in this function)

psutil/_psutil_osx.c:809: error: ‘MNT_QUOTA’ undeclared (first use in this function)psutil/_psutil_osx.c:813: error: ‘MNT_DOVOLFS’ undeclared (first use in this function)

psutil/_psutil_osx.c:811: error: ‘MNT_ROOTFS’ undeclared (first use in this function)psutil/_psutil_osx.c:815: error: ‘MNT_DONTBROWSE’ undeclared (first use in this function)

psutil/_psutil_osx.c:813: error: ‘MNT_DOVOLFS’ undeclared (first use in this function)psutil/_psutil_osx.c:817: error: ‘MNT_IGNORE_OWNERSHIP’ undeclared (first use in this function)


psutil/_psutil_osx.c:819: error: ‘MNT_AUTOMOUNTED’ undeclared (first use in this function)
psutil/_psutil_osx.c:815: error: ‘MNT_DONTBROWSE’ undeclared (first use in this function)
psutil/_psutil_osx.c:821: error: ‘MNT_JOURNALED’ undeclared (first use in this function)
psutil/_psutil_osx.c:817: error: ‘MNT_IGNORE_OWNERSHIP’ undeclared (first use in this function)
psutil/_psutil_osx.c:823: error: ‘MNT_NOUSERXATTR’ undeclared (first use in this function)psutil/_psutil_osx.c:819: error: ‘MNT_AUTOMOUNTED’ undeclared (first use in this function)

psutil/_psutil_osx.c:825: error: ‘MNT_DEFWRITE’ undeclared (first use in this function)psutil/_psutil_osx.c:821: error: ‘MNT_JOURNALED’ undeclared (first use in this function)


psutil/_psutil_osx.c:823: error: ‘MNT_NOUSERXATTR’ undeclared (first use in this function)
psutil/_psutil_osx.c:827: error: ‘MNT_MULTILABEL’ undeclared (first use in this function)
psutil/_psutil_osx.c:829: error: ‘MNT_NOATIME’ undeclared (first use in this function)psutil/_psutil_osx.c:825: error: ‘MNT_DEFWRITE’ undeclared (first use in this function)


psutil/_psutil_osx.c:831: error: ‘MNT_UPDATE’ undeclared (first use in this function)
psutil/_psutil_osx.c:827: error: ‘MNT_MULTILABEL’ undeclared (first use in this function)
psutil/_psutil_osx.c:833: error: ‘MNT_RELOAD’ undeclared (first use in this function)
psutil/_psutil_osx.c:829: error: ‘MNT_NOATIME’ undeclared (first use in this function)
psutil/_psutil_osx.c:835: error: ‘MNT_FORCE’ undeclared (first use in this function)
psutil/_psutil_osx.c:831: error: ‘MNT_UPDATE’ undeclared (first use in this function)
psutil/_psutil_osx.c:837: error: ‘MNT_CMDFLAGS’ undeclared (first use in this function)
psutil/_psutil_osx.c:833: error: ‘MNT_RELOAD’ undeclared (first use in this function)
psutil/_psutil_osx.c:840: error: invalid use of undefined type ‘struct statfs’psutil/_psutil_osx.c:835: error: ‘MNT_FORCE’ undeclared (first use in this function)


psutil/_psutil_osx.c:840: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:837: error: ‘MNT_CMDFLAGS’ undeclared (first use in this function)psutil/_psutil_osx.c:841: error: invalid use of undefined type ‘struct statfs’


psutil/_psutil_osx.c:841: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:840: error: invalid use of undefined type ‘struct statfs’psutil/_psutil_osx.c:842: error: invalid use of undefined type ‘struct statfs’

psutil/_psutil_osx.c:840: error: dereferencing pointer to incomplete typepsutil/_psutil_osx.c:842: error: dereferencing pointer to incomplete type


psutil/_psutil_osx.c:841: error: invalid use of undefined type ‘struct statfs’
psutil/_psutil_osx.c:841: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:842: error: invalid use of undefined type ‘struct statfs’
psutil/_psutil_osx.c:842: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c: In function ‘get_process_open_files’:
psutil/_psutil_osx.c: In function ‘get_process_open_files’:psutil/_psutil_osx.c:1007: error: storage size of ‘vi’ isn’t known

psutil/_psutil_osx.c:1007: error: storage size of ‘vi’ isn’t known
psutil/_psutil_osx.c:1019: warning: implicit declaration of function ‘proc_pidinfo’
psutil/_psutil_osx.c:1019: error: ‘PROC_PIDLISTFDS’ undeclared (first use in this function)
psutil/_psutil_osx.c:1019: warning: implicit declaration of function ‘proc_pidinfo’
psutil/_psutil_osx.c:1019: error: ‘PROC_PIDLISTFDS’ undeclared (first use in this function)
psutil/_psutil_osx.c:1039: error: ‘PROC_PIDLISTFD_SIZE’ undeclared (first use in this function)
psutil/_psutil_osx.c:1039: error: ‘PROC_PIDLISTFD_SIZE’ undeclared (first use in this function)
psutil/_psutil_osx.c:1043: error: invalid use of undefined type ‘struct proc_fdinfo’
psutil/_psutil_osx.c:1043: error: invalid use of undefined type ‘struct proc_fdinfo’
psutil/_psutil_osx.c:1043: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1043: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1045: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1045: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1045: error: ‘PROX_FDTYPE_VNODE’ undeclared (first use in this function)psutil/_psutil_osx.c:1045: error: ‘PROX_FDTYPE_VNODE’ undeclared (first use in this function)

psutil/_psutil_osx.c:1047: warning: implicit declaration of function ‘proc_pidfdinfo’psutil/_psutil_osx.c:1047: warning: implicit declaration of function ‘proc_pidfdinfo’

psutil/_psutil_osx.c:1048: error: dereferencing pointer to incomplete typepsutil/_psutil_osx.c:1048: error: dereferencing pointer to incomplete type

psutil/_psutil_osx.c:1049: error: ‘PROC_PIDFDVNODEPATHINFO’ undeclared (first use in this function)psutil/_psutil_osx.c:1049: error: ‘PROC_PIDFDVNODEPATHINFO’ undeclared (first use in this function)

psutil/_psutil_osx.c:1074: error: dereferencing pointer to incomplete typepsutil/_psutil_osx.c:1074: error: dereferencing pointer to incomplete type


psutil/_psutil_osx.c:1007: warning: unused variable ‘vi’
psutil/_psutil_osx.c:1007: warning: unused variable ‘vi’
psutil/_psutil_osx.c: In function ‘get_process_connections’:
psutil/_psutil_osx.c: In function ‘get_process_connections’:psutil/_psutil_osx.c:1126: error: storage size of ‘si’ isn’t known

psutil/_psutil_osx.c:1126: error: storage size of ‘si’ isn’t known
psutil/_psutil_osx.c:1151: error: ‘PROC_PIDLISTFDS’ undeclared (first use in this function)
psutil/_psutil_osx.c:1151: error: ‘PROC_PIDLISTFDS’ undeclared (first use in this function)
psutil/_psutil_osx.c:1168: error: ‘PROC_PIDLISTFD_SIZE’ undeclared (first use in this function)psutil/_psutil_osx.c:1168: error: ‘PROC_PIDLISTFD_SIZE’ undeclared (first use in this function)

psutil/_psutil_osx.c:1175: error: invalid use of undefined type ‘struct proc_fdinfo’psutil/_psutil_osx.c:1175: error: invalid use of undefined type ‘struct proc_fdinfo’

psutil/_psutil_osx.c:1175: error: dereferencing pointer to incomplete typepsutil/_psutil_osx.c:1175: error: dereferencing pointer to incomplete type


psutil/_psutil_osx.c:1177: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1177: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1177: error: ‘PROX_FDTYPE_SOCKET’ undeclared (first use in this function)
psutil/_psutil_osx.c:1177: error: ‘PROX_FDTYPE_SOCKET’ undeclared (first use in this function)
psutil/_psutil_osx.c:1179: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1179: error: ‘PROC_PIDFDSOCKETINFO’ undeclared (first use in this function)psutil/_psutil_osx.c:1179: error: dereferencing pointer to incomplete type


psutil/_psutil_osx.c:1179: error: ‘PROC_PIDFDSOCKETINFO’ undeclared (first use in this function)
psutil/_psutil_osx.c:1211: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1211: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1126: warning: unused variable ‘si’
psutil/_psutil_osx.c:1126: warning: unused variable ‘si’
psutil/_psutil_osx.c: In function ‘get_process_num_fds’:
psutil/_psutil_osx.c:1346: error: ‘PROC_PIDLISTFDS’ undeclared (first use in this function)
psutil/_psutil_osx.c: In function ‘get_process_num_fds’:
psutil/_psutil_osx.c:1346: error: ‘PROC_PIDLISTFDS’ undeclared (first use in this function)
psutil/_psutil_osx.c:1362: error: ‘PROC_PIDLISTFD_SIZE’ undeclared (first use in this function)
psutil/_psutil_osx.c:1362: error: ‘PROC_PIDLISTFD_SIZE’ undeclared (first use in this function)
psutil/_psutil_osx.c: In function ‘get_net_io_counters’:
psutil/_psutil_osx.c:1411: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1413: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1413: error: ‘RTM_IFINFO2’ undeclared (first use in this function)psutil/_psutil_osx.c: In function ‘get_net_io_counters’:


psutil/_psutil_osx.c:1411: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1413: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1413: error: ‘RTM_IFINFO2’ undeclared (first use in this function)
psutil/_psutil_osx.c:1416: error: invalid use of undefined type ‘struct if_msghdr2’
psutil/_psutil_osx.c:1416: error: invalid use of undefined type ‘struct if_msghdr2’
psutil/_psutil_osx.c:1423: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1424: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1425: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1423: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1426: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1424: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1427: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1425: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1428: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1426: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1429: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1427: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1428: error: dereferencing pointer to incomplete type
psutil/_psutil_osx.c:1429: error: dereferencing pointer to incomplete type
lipo: can't figure out the architecture type of: /var/folders/NR/NRerLp3lH00IqJcwaTwU1U+++TM/-Tmp-//cchAvJ5b.out
error: command '/usr/bin/gcc-4.0' failed with exit status 1

 

Ingrid

unread,
Nov 23, 2013, 4:41:52 AM11/23/13
to psu...@googlegroups.com, happyp...@gmail.com, Si Liu
Never mind, I figured it out.  This is what was needed:

ingrid$ export CPATH=/usr/include

Since the files that the compiler was complaining about not being able to find


psutil/_psutil_osx.c:18:21:psutil/_psutil_osx.c:18:21:  error: libproc.h: No such file or directoryerror:
libproc.h: No such file or directory
psutil/_psutil_osx.c:19:27: error: sys/proc_info.h: No such file or directory
psutil/_psutil_osx.c:19:27: error: sys/proc_info.h: No such file or directory
psutil/_psutil_osx.c:32:32:psutil/_psutil_osx.c:32:32: error:  mach/shared_region.h: No such file or directory
error: mach/shared_region.h: No such file or directory
did exist on my system, I had to tell it explicitly where to look for them.   Which it turns out you can do by setting the CPATH environment variable. 

Again, a huge thank you to everyone who responded to this thread - especially to Jay, who was incredibly patient with all my questions!  Thank you!!!

Ingrid

Giampaolo Rodola'

unread,
Nov 23, 2013, 5:28:18 AM11/23/13
to psu...@googlegroups.com, happyp...@gmail.com, Si Liu
Glad to see you guys figured it all out.


--

Jay Loden

unread,
Nov 23, 2013, 12:54:44 PM11/23/13
to psu...@googlegroups.com, happyp...@gmail.com, Si Liu
Agreed, glad to hear you were able to figure it out - and now we know if it happens to someone else on OS X w/Python.org's build :) 
Reply all
Reply to author
Forward
0 new messages