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 doesn’t build on FreeBSD 11 #1045

Closed
interkosmos opened this issue May 2, 2017 · 11 comments
Closed

psutil doesn’t build on FreeBSD 11 #1045

interkosmos opened this issue May 2, 2017 · 11 comments
Labels

Comments

@interkosmos
Copy link

interkosmos commented May 2, 2017

Trying pypy3 -m pip install psutil:

    [...]
    running build_ext
    building 'psutil._psutil_bsd' extension
    creating build/temp.freebsd-11.0-RELEASE-p8-amd64-3.5
    creating build/temp.freebsd-11.0-RELEASE-p8-amd64-3.5/psutil
    creating build/temp.freebsd-11.0-RELEASE-p8-amd64-3.5/psutil/arch
    creating build/temp.freebsd-11.0-RELEASE-p8-amd64-3.5/psutil/arch/bsd
    gcc -pthread -DNDEBUG -O2 -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_BSD=1 -DPSUTIL_VERSION=522 -DPSUTIL_FREEBSD=1 -I/usr/local/pypy3-5.7/include -c psutil/_psutil_bsd.c -o build/temp.freebsd-11.0-RELEASE-p8-amd64-3.5/psutil/_psutil_bsd.o
    psutil/_psutil_bsd.c: In function 'psutil_proc_oneshot_info':
    psutil/_psutil_bsd.c:289:9: internal compiler error: Illegal instruction
             PSUTIL_TV2DOUBLE(kp.ki_start),   // (double) create time
             ^
    no stack trace because unwind library not available
    Please submit a full bug report,
    with preprocessed source if appropriate.
    See <http://gcc.gnu.org/bugs.html> for instructions.
    error: command 'gcc' failed with exit status 1  

I used GCC 4.9 as well as 5.4.

@interkosmos
Copy link
Author

interkosmos commented May 2, 2017

I have tried it again with GCC 4.6 – and now it compiles. But importing psutil leads to the following error:

File "/usr/home/<me>/virtual-pypy/site-packages/psutil/__init__.py", line 139, in <module>
    from . import _psbsd as _psplatform
File "/usr/home/<me>/virtual-pypy/site-packages/psutil/_psbsd.py", line 16, in <module>
    from . import _psutil_bsd as cext
ImportError: /usr/home/<me>/virtual-pypy/site-packages/psutil/_psutil_bsd.pypy3-57-amd64-freebsd11.so: Undefined symbol "PyModule_GetState"

@giampaolo
Copy link
Owner

Wow that's fu**ed up. A compiler not providing a stack trace?

@interkosmos
Copy link
Author

See next error above.

@giampaolo
Copy link
Owner

That means you need to install Python headers. Perhaps pkg install python-dev?

@interkosmos
Copy link
Author

It seems that there are no Python headers for PyPy 5.7 available for FreeBSD. At least, they are not installed to /usr/local/include/.

@interkosmos
Copy link
Author

The header files are stored in /usr/local/pypy3-5.7/include. So, yeah, I have them.

@giampaolo
Copy link
Owner

Mmm that says pypy though, not python.

@interkosmos
Copy link
Author

interkosmos commented May 2, 2017

Yes, as I have written in the original post. On Python 3.6 for FreeBSD 11, psutils just works without any problems. These errors only encounter with PyPy 5.7.

@giampaolo
Copy link
Owner

Ah sorry, I didn't notice you were using pypy. Then this is a duplicate of #853. psutil does not work on pypy3 because pypy3 does not implement PyModule_GetState.

@interkosmos
Copy link
Author

Ok, thank you very much for this notice.

@giampaolo
Copy link
Owner

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

No branches or pull requests

2 participants