Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

psutil fails to build on os x #780

Closed
johnyf opened this issue Feb 28, 2016 · 2 comments
Closed

psutil fails to build on os x #780

johnyf opened this issue Feb 28, 2016 · 2 comments

Comments

@johnyf
Copy link

johnyf commented Feb 28, 2016

I get the following error, with both 3f57ee8 and psutil == 4.0.0:

building 'psutil._psutil_osx' extension
gcc -fno-strict-aliasing -I/opt/local/include -g -O0 -Wall -Wstrict-prototypes -DPSUTIL_VERSION=400 -I/Users/john/python/include/python2.7 -c psutil/_psutil_osx.c -o build/temp.macosx-10.4-x86_64-2.7-pydebug/psutil/_psutil_osx.o
psutil/_psutil_osx.c: In function 'psutil_proc_memory_uss':
psutil/_psutil_osx.c:603:5: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
     for (mach_vm_address_t addr = MACH_VM_MIN_ADDRESS; ; addr += size) {
     ^
psutil/_psutil_osx.c:603:5: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code
error: command 'gcc' failed with exit status 1

I'm using Macport's gcc:

which -a gcc
/opt/local/bin/gcc
/usr/bin/gcc

psutil:gcc --version
gcc (MacPorts gcc49 4.9.3_0) 4.9.3
Copyright (C) 2015 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.

with Python built from source (not a perfect built, I have to admit -- there are some modules missing):

python --version
Python 2.7.10+

In the same virtualenv, I do not get this error with psutil == 3.4.2.

@giampaolo
Copy link
Owner

OK I should have fixed it. Can you confirm now it works with latest GIT version?

@johnyf
Copy link
Author

johnyf commented Feb 29, 2016

6ae5f36 compiles successfully, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants