Closed GoogleCodeExporter closed 9 years ago
What's "abb build"?
What happens if you run "pip install psutil"?
Original comment by g.rodola
on 13 Mar 2014 at 3:55
abb - it's just a wrapper around of rpmbuild command
take a look on a spec file
https://abf.io/openmandriva/python-psutil/blob/master/python-psutil.spec
I add this line to build python3-psutil
CFLAGS="%{optflags} -lpython3.3m" %{__python3} setup.py build
and now it's built fine
But if i do it via pip i got an error message
[fedya@filzbach python-pip]$ /usr/bin/python3-pip install psutil
Downloading/unpacking psutil
Downloading psutil-2.0.0.tar.gz (207kB): 207kB downloaded
Running setup.py egg_info for package psutil
warning: no previously-included files matching '*' found under directory 'docs/_build'
Installing collected packages: psutil
Running setup.py install for psutil
warning: build_py: byte-compiling is disabled, skipping.
building '_psutil_linux' extension
x86_64-mandriva-linux-gnu-gcc -pthread -Wno-unused-result -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -Wa,--compress-debug-sections -gdwarf-4 -fvar-tracking-assignments -frecord-gcc-switches -Wstrict-aliasing=2 -pipe -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -fPIC -g -O2 -Wa,--compress-debug-sections -gdwarf-4 -fvar-tracking-assignments -frecord-gcc-switches -Wstrict-aliasing=2 -pipe -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -fPIC -I/usr/include/ncursesw -fPIC -I/usr/include/python3.3m -c psutil/_psutil_linux.c -o build/temp.linux-x86_64-3.3/psutil/_psutil_linux.o
psutil/_psutil_linux.c: In function 'psutil_proc_cpu_affinity_get':
psutil/_psutil_linux.c:265:5: warning: dereferencing type-punned pointer might break strict-aliasing rules [-Wstrict-aliasing]
if (sched_getaffinity(pid, len, (cpu_set_t *)&mask) < 0) {
^
psutil/_psutil_linux.c: In function 'psutil_users':
psutil/_psutil_linux.c:351:13: warning: dereferencing type-punned pointer might break strict-aliasing rules [-Wstrict-aliasing]
user_proc = Py_True;
^
psutil/_psutil_linux.c:353:13: warning: dereferencing type-punned pointer might break strict-aliasing rules [-Wstrict-aliasing]
user_proc = Py_False;
^
x86_64-mandriva-linux-gnu-gcc -pthread -shared -Wl,--no-undefined build/temp.linux-x86_64-3.3/psutil/_psutil_linux.o -o build/lib.linux-x86_64-3.3/_psutil_linux.cpython-33m.so
psutil/_psutil_linux.c:440: error: undefined reference to 'PyModule_GetState'
psutil/_psutil_linux.c:440: error: undefined reference to 'PyModule_GetState'
psutil/_psutil_linux.c:440: error: undefined reference to 'PyModule_GetState'
psutil/_psutil_linux.c:434: error: undefined reference to 'PyModule_GetState'
psutil/_psutil_linux.c:130: error: undefined reference to 'PyArg_ParseTuple'
psutil/_psutil_linux.c:159: error: undefined reference to 'PyLong_AsLong'
psutil/_psutil_linux.c:162: error: undefined reference to 'PyLong_AsLong'
psutil/_psutil_linux.c:170: error: undefined reference to '_Py_NoneStruct'
psutil/_psutil_linux.c:160: error: undefined reference to 'PyErr_Occurred'
psutil/_psutil_linux.c:146: error: undefined reference to 'Py_BuildValue'
psutil/_psutil_linux.c:163: error: undefined reference to 'PyErr_Occurred'
psutil/_psutil_linux.c:169: error: undefined reference to 'PyExc_OSError'
psutil/_psutil_linux.c:169: error: undefined reference to 'PyErr_SetFromErrno'
psutil/_psutil_linux.c:339: error: undefined reference to 'PyList_New'
psutil/_psutil_linux.c:353: error: undefined reference to '_Py_FalseStruct'
psutil/_psutil_linux.c:354: error: undefined reference to 'Py_BuildValue'
psutil/_psutil_linux.c:364: error: undefined reference to 'PyList_Append'
psutil/_psutil_linux.c:351: error: undefined reference to '_Py_TrueStruct'
psutil/_psutil_linux.c:186: error: undefined reference to 'PyList_New'
psutil/_psutil_linux.c:193: error: undefined reference to 'PyEval_SaveThread'
psutil/_psutil_linux.c:195: error: undefined reference to 'PyEval_RestoreThread'
psutil/_psutil_linux.c:206: error: undefined reference to 'Py_BuildValue'
psutil/_psutil_linux.c:213: error: undefined reference to 'PyList_Append'
psutil/_psutil_linux.c:197: error: undefined reference to 'PyExc_OSError'
psutil/_psutil_linux.c:197: error: undefined reference to 'PyErr_SetFromErrnoWithFilename'
psutil/_psutil_linux.c:285: error: undefined reference to 'PyArg_ParseTuple'
psutil/_psutil_linux.c:289: error: undefined reference to 'PySequence_Check'
psutil/_psutil_linux.c:297: error: undefined reference to 'PySequence_Fast'
psutil/_psutil_linux.c:306: error: undefined reference to 'PyLong_AsLong'
psutil/_psutil_linux.c:306: error: undefined reference to 'PyLong_AsLong'
psutil/_psutil_linux.c:310: error: undefined reference to 'PyErr_Occurred'
psutil/_psutil_linux.c:293: error: undefined reference to 'PyExc_TypeError'
psutil/_psutil_linux.c:293: error: undefined reference to 'PyErr_Format'
psutil/_psutil_linux.c:323: error: undefined reference to '_Py_NoneStruct'
psutil/_psutil_linux.c:318: error: undefined reference to 'PyExc_OSError'
psutil/_psutil_linux.c:318: error: undefined reference to 'PyErr_SetFromErrno'
psutil/_psutil_linux.c:241: error: undefined reference to 'Py_BuildValue'
psutil/_psutil_linux.c:237: error: undefined reference to 'PyExc_OSError'
psutil/_psutil_linux.c:237: error: undefined reference to 'PyErr_SetFromErrno'
psutil/_psutil_linux.c:262: error: undefined reference to 'PyArg_ParseTuple'
psutil/_psutil_linux.c:266: error: undefined reference to 'PyErr_SetFromErrno'
psutil/_psutil_linux.c:100: error: undefined reference to 'PyArg_ParseTuple'
psutil/_psutil_linux.c:108: error: undefined reference to '_Py_NoneStruct'
psutil/_psutil_linux.c:468: error: undefined reference to 'PyModule_Create2'
psutil/_psutil_linux.c:475: error: undefined reference to 'PyModule_AddIntConstant'
psutil/_psutil_linux.c:476: error: undefined reference to 'PyModule_AddIntConstant'
psutil/_psutil_linux.c:477: error: undefined reference to 'PyModule_AddIntConstant'
psutil/_psutil_linux.c:478: error: undefined reference to 'PyModule_AddIntConstant'
collect2: error: ld returned 1 exit status
error: command 'x86_64-mandriva-linux-gnu-gcc' failed with exit status 1
Complete output from command /usr/bin/python3 -c "import setuptools;__file__='/tmp/pip_build_fedya/psutil/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-d4g5pm-record/install-record.txt --single-version-externally-managed:
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.3
creating build/lib.linux-x86_64-3.3/psutil
copying psutil/_compat.py -> build/lib.linux-x86_64-3.3/psutil
copying psutil/_psposix.py -> build/lib.linux-x86_64-3.3/psutil
copying psutil/__init__.py -> build/lib.linux-x86_64-3.3/psutil
copying psutil/_pssunos.py -> build/lib.linux-x86_64-3.3/psutil
copying psutil/_pslinux.py -> build/lib.linux-x86_64-3.3/psutil
copying psutil/_psbsd.py -> build/lib.linux-x86_64-3.3/psutil
copying psutil/_pswindows.py -> build/lib.linux-x86_64-3.3/psutil
copying psutil/_psosx.py -> build/lib.linux-x86_64-3.3/psutil
copying psutil/_common.py -> build/lib.linux-x86_64-3.3/psutil
warning: build_py: byte-compiling is disabled, skipping.
running build_ext
building '_psutil_linux' extension
creating build/temp.linux-x86_64-3.3
creating build/temp.linux-x86_64-3.3/psutil
x86_64-mandriva-linux-gnu-gcc -pthread -Wno-unused-result
-DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -Wa,--compress-debug-sections
-gdwarf-4 -fvar-tracking-assignments -frecord-gcc-switches -Wstrict-aliasing=2
-pipe -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2
-fstack-protector --param=ssp-buffer-size=4 -fPIC -g -O2
-Wa,--compress-debug-sections -gdwarf-4 -fvar-tracking-assignments
-frecord-gcc-switches -Wstrict-aliasing=2 -pipe -Wformat
-Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector
--param=ssp-buffer-size=4 -fPIC -I/usr/include/ncursesw -fPIC
-I/usr/include/python3.3m -c psutil/_psutil_linux.c -o
build/temp.linux-x86_64-3.3/psutil/_psutil_linux.o
psutil/_psutil_linux.c: In function 'psutil_proc_cpu_affinity_get':
psutil/_psutil_linux.c:265:5: warning: dereferencing type-punned pointer might
break strict-aliasing rules [-Wstrict-aliasing]
if (sched_getaffinity(pid, len, (cpu_set_t *)&mask) < 0) {
^
psutil/_psutil_linux.c: In function 'psutil_users':
psutil/_psutil_linux.c:351:13: warning: dereferencing type-punned pointer might
break strict-aliasing rules [-Wstrict-aliasing]
user_proc = Py_True;
^
psutil/_psutil_linux.c:353:13: warning: dereferencing type-punned pointer might
break strict-aliasing rules [-Wstrict-aliasing]
user_proc = Py_False;
^
x86_64-mandriva-linux-gnu-gcc -pthread -shared -Wl,--no-undefined
build/temp.linux-x86_64-3.3/psutil/_psutil_linux.o -o
build/lib.linux-x86_64-3.3/_psutil_linux.cpython-33m.so
psutil/_psutil_linux.c:440: error: undefined reference to 'PyModule_GetState'
psutil/_psutil_linux.c:440: error: undefined reference to 'PyModule_GetState'
psutil/_psutil_linux.c:440: error: undefined reference to 'PyModule_GetState'
psutil/_psutil_linux.c:434: error: undefined reference to 'PyModule_GetState'
psutil/_psutil_linux.c:130: error: undefined reference to 'PyArg_ParseTuple'
psutil/_psutil_linux.c:159: error: undefined reference to 'PyLong_AsLong'
psutil/_psutil_linux.c:162: error: undefined reference to 'PyLong_AsLong'
psutil/_psutil_linux.c:170: error: undefined reference to '_Py_NoneStruct'
psutil/_psutil_linux.c:160: error: undefined reference to 'PyErr_Occurred'
psutil/_psutil_linux.c:146: error: undefined reference to 'Py_BuildValue'
psutil/_psutil_linux.c:163: error: undefined reference to 'PyErr_Occurred'
psutil/_psutil_linux.c:169: error: undefined reference to 'PyExc_OSError'
psutil/_psutil_linux.c:169: error: undefined reference to 'PyErr_SetFromErrno'
psutil/_psutil_linux.c:339: error: undefined reference to 'PyList_New'
psutil/_psutil_linux.c:353: error: undefined reference to '_Py_FalseStruct'
psutil/_psutil_linux.c:354: error: undefined reference to 'Py_BuildValue'
psutil/_psutil_linux.c:364: error: undefined reference to 'PyList_Append'
psutil/_psutil_linux.c:351: error: undefined reference to '_Py_TrueStruct'
psutil/_psutil_linux.c:186: error: undefined reference to 'PyList_New'
psutil/_psutil_linux.c:193: error: undefined reference to 'PyEval_SaveThread'
psutil/_psutil_linux.c:195: error: undefined reference to 'PyEval_RestoreThread'
psutil/_psutil_linux.c:206: error: undefined reference to 'Py_BuildValue'
psutil/_psutil_linux.c:213: error: undefined reference to 'PyList_Append'
psutil/_psutil_linux.c:197: error: undefined reference to 'PyExc_OSError'
psutil/_psutil_linux.c:197: error: undefined reference to
'PyErr_SetFromErrnoWithFilename'
psutil/_psutil_linux.c:285: error: undefined reference to 'PyArg_ParseTuple'
psutil/_psutil_linux.c:289: error: undefined reference to 'PySequence_Check'
psutil/_psutil_linux.c:297: error: undefined reference to 'PySequence_Fast'
psutil/_psutil_linux.c:306: error: undefined reference to 'PyLong_AsLong'
psutil/_psutil_linux.c:306: error: undefined reference to 'PyLong_AsLong'
psutil/_psutil_linux.c:310: error: undefined reference to 'PyErr_Occurred'
psutil/_psutil_linux.c:293: error: undefined reference to 'PyExc_TypeError'
psutil/_psutil_linux.c:293: error: undefined reference to 'PyErr_Format'
psutil/_psutil_linux.c:323: error: undefined reference to '_Py_NoneStruct'
psutil/_psutil_linux.c:318: error: undefined reference to 'PyExc_OSError'
psutil/_psutil_linux.c:318: error: undefined reference to 'PyErr_SetFromErrno'
psutil/_psutil_linux.c:241: error: undefined reference to 'Py_BuildValue'
psutil/_psutil_linux.c:237: error: undefined reference to 'PyExc_OSError'
psutil/_psutil_linux.c:237: error: undefined reference to 'PyErr_SetFromErrno'
psutil/_psutil_linux.c:262: error: undefined reference to 'PyArg_ParseTuple'
psutil/_psutil_linux.c:266: error: undefined reference to 'PyErr_SetFromErrno'
psutil/_psutil_linux.c:100: error: undefined reference to 'PyArg_ParseTuple'
psutil/_psutil_linux.c:108: error: undefined reference to '_Py_NoneStruct'
psutil/_psutil_linux.c:468: error: undefined reference to 'PyModule_Create2'
psutil/_psutil_linux.c:475: error: undefined reference to
'PyModule_AddIntConstant'
psutil/_psutil_linux.c:476: error: undefined reference to
'PyModule_AddIntConstant'
psutil/_psutil_linux.c:477: error: undefined reference to
'PyModule_AddIntConstant'
psutil/_psutil_linux.c:478: error: undefined reference to
'PyModule_AddIntConstant'
collect2: error: ld returned 1 exit status
error: command 'x86_64-mandriva-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Cleaning up...
Command /usr/bin/python3 -c "import
setuptools;__file__='/tmp/pip_build_fedya/psutil/setup.py';exec(compile(open(__f
ile__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record
/tmp/pip-d4g5pm-record/install-record.txt --single-version-externally-managed
failed with error code 1 in /tmp/pip_build_fedya/psutil
Storing complete log in /home/fedya/.pip/pip.log
Original comment by nobodyd...@gmail.com
on 13 Mar 2014 at 4:19
You need python header files. On red-hat like systems it should be:
$ sudo yum install gcc python-devel
Original comment by g.rodola
on 13 Mar 2014 at 4:21
>You need python header files
Installed
python3 - lib64python3-devel-3.3.4-2-omv2014.1.x86_64
python2 - lib64python-devel-2.7.5-5-omv2014.0.x86_64
Both of python devel headers installed.
Btw -lpython3.3m provides by pkgconfig file from python-devel package ;)
Of course it's installed.
Original comment by nobodyd...@gmail.com
on 13 Mar 2014 at 4:24
Well, those errors state they aren't installed. =)
Original comment by g.rodola
on 13 Mar 2014 at 4:26
Nope!
Above i show you a perfect example
if i will add to CFLAGS needed lib -lpython3.3m it's built fine.
https://abf.io/openmandriva/python-psutil/blob/master/python-psutil.spec#L60
Looks like need some fix in Makefile
Original comment by nobodyd...@gmail.com
on 13 Mar 2014 at 4:31
> if i will add to CFLAGS needed lib -lpython3.3m it's built fine.
> https://abf.io/openmandriva/python-psutil/blob/master/python-psutil.spec#L60
I don't know about third-party packaged version of psutil, but if python header
files are installed you should be able to "pip install psutil".
Not sure what else to suggest, sorry.
Original comment by g.rodola
on 13 Mar 2014 at 4:34
>I don't know about third-party packaged version of psutil
If's 100% official version of psutil
downloaded from https://pypi.python.org/packages/source/p/psutil/
without any patches or other things.
is a culrpit that returns an error
gcc -pthread -shared -Wl,--no-undefined
build/temp.linux-x86_64-3.3/psutil/_psutil_linux.o -o
build/lib.linux-x86_64-3.3/_psutil_linux.cpython-33m.so
....
psutil/_psutil_linux.c:440: error: undefined reference to 'PyModule_GetState'
....
Modified string:
gcc -lpython3.3m -pthread -shared -Wl,--no-undefined
build/temp.linux-x86_64-3.3/psutil/_psutil_linux.o -o
build/lib.linux-x86_64-3.3/_psutil_linux.cpython-33m.so
built fine.
Original comment by nobodyd...@gmail.com
on 13 Mar 2014 at 4:47
Sorry but I just can't reproduce the issue.
Again all those "undefined reference to 'Py*" errors means you don't have
Python headers installed.
giampaolo@UX32VD:~/svn/psutil$ python3.3 -V
Python 3.3.2+
giampaolo@UX32VD:~/svn/psutil$ make build
rm -f `find . -type f -name \*.py[co]`
rm -f `find . -type f -name \*.so`
rm -f `find . -type f -name .\*~`
rm -f `find . -type f -name \*.orig`
rm -f `find . -type f -name \*.bak`
rm -f `find . -type f -name \*.rej`
rm -rf `find . -type d -name __pycache__`
rm -rf *.egg-info
rm -rf *\estfile*
rm -rf build
rm -rf dist
rm -rf docs/_build
python setup.py build
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/psutil
copying psutil/__init__.py -> build/lib.linux-x86_64-2.7/psutil
copying psutil/_compat.py -> build/lib.linux-x86_64-2.7/psutil
copying psutil/_common.py -> build/lib.linux-x86_64-2.7/psutil
copying psutil/_psosx.py -> build/lib.linux-x86_64-2.7/psutil
copying psutil/_pssunos.py -> build/lib.linux-x86_64-2.7/psutil
copying psutil/_psbsd.py -> build/lib.linux-x86_64-2.7/psutil
copying psutil/_psposix.py -> build/lib.linux-x86_64-2.7/psutil
copying psutil/_pslinux.py -> build/lib.linux-x86_64-2.7/psutil
copying psutil/_pswindows.py -> build/lib.linux-x86_64-2.7/psutil
running build_ext
building '_psutil_linux' extension
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/psutil
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2
-Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c
psutil/_psutil_linux.c -o build/temp.linux-x86_64-2.7/psutil/_psutil_linux.o
x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions
-Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv
-O2 -Wall -Wstrict-prototypes -D_FORTIFY_SOURCE=2 -g -fstack-protector
--param=ssp-buffer-size=4 -Wformat -Werror=format-security
build/temp.linux-x86_64-2.7/psutil/_psutil_linux.o -o
build/lib.linux-x86_64-2.7/_psutil_linux.so
building '_psutil_posix' extension
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2
-Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c
psutil/_psutil_posix.c -o build/temp.linux-x86_64-2.7/psutil/_psutil_posix.o
x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions
-Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv
-O2 -Wall -Wstrict-prototypes -D_FORTIFY_SOURCE=2 -g -fstack-protector
--param=ssp-buffer-size=4 -Wformat -Werror=format-security
build/temp.linux-x86_64-2.7/psutil/_psutil_posix.o -o
build/lib.linux-x86_64-2.7/_psutil_posix.so
giampaolo@UX32VD:~/svn/psutil$
Original comment by g.rodola
on 15 Mar 2014 at 11:50
> Modified string:
> gcc -lpython3.3m -pthread -shared -Wl,--no-undefined
build/temp.linux-x86_64-> 3.3/psutil/_psutil_linux.o -o
build/lib.linux-x86_64-3.3/_psutil_linux.cpython-33m.so
> built fine.
What string?
If you think there's something wrong with psutil code which should be fixed
please provide a patch 'cause I'm having an hard time understanding what's
wrong here. =)
Original comment by g.rodola
on 15 Mar 2014 at 11:53
Original comment by g.rodola
on 31 Dec 2014 at 5:22
Original issue reported on code.google.com by
nobodyd...@gmail.com
on 13 Mar 2014 at 3:46