luigimarmo / psutil

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

can't compuilt psutils with python3 #486

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
[fedya@filzbach python-psutil]$ abb build
assume project name from git url: python-psutil
try to restore files from abf storage
parsing file '.abf.yml'
found entry: file=psutil-0.4.1.tar.gz ... ok
found entry: file=psutil-2.0.0.tar.gz ... ok
try to build python-psutil
Fetching(Source0): 
https://pypi.python.org/packages/source/p/psutil/psutil-1.2.1.tar.gz
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.98015
+ umask 022
+ cd /home/fedya/chromium-browser-stable/python-psutil/BUILD
+ '[' 1 -eq 1 ']'
+ '[' 1 -eq 1 ']'
+ '[' 1 -eq 1 ']'
+ cd /home/fedya/chromium-browser-stable/python-psutil/BUILD
+ rm -rf psutil-1.2.1
+ /bin/gzip -dc 
/home/fedya/chromium-browser-stable/python-psutil/psutil-1.2.1.tar.gz
+ /bin/tar -xf -
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd psutil-1.2.1
+ for file in 'psutil/*.py'
+ sed -i.orig -e 1d psutil/__init__.py
+ touch -r psutil/__init__.py.orig psutil/__init__.py
+ rm psutil/__init__.py.orig
+ for file in 'psutil/*.py'
+ sed -i.orig -e 1d psutil/_common.py
+ touch -r psutil/_common.py.orig psutil/_common.py
+ rm psutil/_common.py.orig
+ for file in 'psutil/*.py'
+ sed -i.orig -e 1d psutil/_compat.py
+ touch -r psutil/_compat.py.orig psutil/_compat.py
+ rm psutil/_compat.py.orig
+ for file in 'psutil/*.py'
+ sed -i.orig -e 1d psutil/_error.py
+ touch -r psutil/_error.py.orig psutil/_error.py
+ rm psutil/_error.py.orig
+ for file in 'psutil/*.py'
+ sed -i.orig -e 1d psutil/_psbsd.py
+ touch -r psutil/_psbsd.py.orig psutil/_psbsd.py
+ rm psutil/_psbsd.py.orig
+ for file in 'psutil/*.py'
+ sed -i.orig -e 1d psutil/_pslinux.py
+ touch -r psutil/_pslinux.py.orig psutil/_pslinux.py
+ rm psutil/_pslinux.py.orig
+ for file in 'psutil/*.py'
+ sed -i.orig -e 1d psutil/_psmswindows.py
+ touch -r psutil/_psmswindows.py.orig psutil/_psmswindows.py
+ rm psutil/_psmswindows.py.orig
+ for file in 'psutil/*.py'
+ sed -i.orig -e 1d psutil/_psosx.py
+ touch -r psutil/_psosx.py.orig psutil/_psosx.py
+ rm psutil/_psosx.py.orig
+ for file in 'psutil/*.py'
+ sed -i.orig -e 1d psutil/_psposix.py
+ touch -r psutil/_psposix.py.orig psutil/_psposix.py
+ rm psutil/_psposix.py.orig
+ for file in 'psutil/*.py'
+ sed -i.orig -e 1d psutil/_pssunos.py
+ touch -r psutil/_pssunos.py.orig psutil/_pssunos.py
+ rm psutil/_pssunos.py.orig
+ for file in 'psutil/*.py'
+ sed -i.orig -e 1d psutil/error.py
+ touch -r psutil/error.py.orig psutil/error.py
+ rm psutil/error.py.orig
+ cp -a . 
/home/fedya/chromium-browser-stable/python-psutil/BUILD/python3-python-psutil-1.
2.1-1
+ exit 0
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.98015
+ umask 022
+ cd /home/fedya/chromium-browser-stable/python-psutil/BUILD
+ cd psutil-1.2.1
+ '[' 1 -eq 1 ']'
+ '[' 1 -eq 1 ']'
+ CFLAGS='-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'
+ /usr/bin/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/_compat.py -> build/lib.linux-x86_64-2.7/psutil
copying psutil/_error.py -> build/lib.linux-x86_64-2.7/psutil
copying psutil/_psposix.py -> build/lib.linux-x86_64-2.7/psutil
copying psutil/_psmswindows.py -> build/lib.linux-x86_64-2.7/psutil
copying psutil/__init__.py -> build/lib.linux-x86_64-2.7/psutil
copying psutil/error.py -> build/lib.linux-x86_64-2.7/psutil
copying psutil/_pssunos.py -> build/lib.linux-x86_64-2.7/psutil
copying psutil/_pslinux.py -> build/lib.linux-x86_64-2.7/psutil
copying psutil/_psbsd.py -> build/lib.linux-x86_64-2.7/psutil
copying psutil/_psosx.py -> build/lib.linux-x86_64-2.7/psutil
copying psutil/_common.py -> build/lib.linux-x86_64-2.7/psutil
warning: build_py: byte-compiling is disabled, skipping.

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-mandriva-linux-gnu-gcc -pthread -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 -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 -fno-PIE -fPIC -I/usr/include/python2.7 -c 
psutil/_psutil_linux.c -o build/temp.linux-x86_64-2.7/psutil/_psutil_linux.o
psutil/_psutil_linux.c: In function 'get_process_cpu_affinity':
psutil/_psutil_linux.c:264: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 'set_process_cpu_affinity':
psutil/_psutil_linux.c:284:5: warning: dereferencing type-punned pointer might 
break strict-aliasing rules [-Wstrict-aliasing]
     if (sched_setaffinity(pid, len, (cpu_set_t *)&mask)) {
     ^
psutil/_psutil_linux.c: In function 'get_system_users':
psutil/_psutil_linux.c:311:13: warning: dereferencing type-punned pointer will 
break strict-aliasing rules [-Wstrict-aliasing]
             user_proc = Py_True;
             ^
psutil/_psutil_linux.c:313:13: warning: dereferencing type-punned pointer will 
break strict-aliasing rules [-Wstrict-aliasing]
             user_proc = Py_False;
             ^
x86_64-mandriva-linux-gnu-gcc -pthread -shared -Wl,--no-undefined -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 
build/temp.linux-x86_64-2.7/psutil/_psutil_linux.o -L/usr/lib64 -lpython2.7 -o 
build/lib.linux-x86_64-2.7/_psutil_linux.so
building '_psutil_posix' extension
x86_64-mandriva-linux-gnu-gcc -pthread -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 -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 -fno-PIE -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-mandriva-linux-gnu-gcc -pthread -shared -Wl,--no-undefined -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 
build/temp.linux-x86_64-2.7/psutil/_psutil_posix.o -L/usr/lib64 -lpython2.7 -o 
build/lib.linux-x86_64-2.7/_psutil_posix.so
+ pushd 
/home/fedya/chromium-browser-stable/python-psutil/BUILD/python3-python-psutil-1.
2.1-1
~/chromium-browser-stable/python-psutil/BUILD/python3-python-psutil-1.2.1-1 
~/chromium-browser-stable/python-psutil/BUILD/psutil-1.2.1
+ CFLAGS='-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'
+ /usr/bin/python3 setup.py build
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/_error.py -> build/lib.linux-x86_64-3.3/psutil
copying psutil/_psposix.py -> build/lib.linux-x86_64-3.3/psutil
copying psutil/_psmswindows.py -> build/lib.linux-x86_64-3.3/psutil
copying psutil/__init__.py -> build/lib.linux-x86_64-3.3/psutil
copying psutil/error.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/_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 -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 -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 'get_process_cpu_affinity':
psutil/_psutil_linux.c:264: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 'set_process_cpu_affinity':
psutil/_psutil_linux.c:284:5: warning: dereferencing type-punned pointer might 
break strict-aliasing rules [-Wstrict-aliasing]
     if (sched_setaffinity(pid, len, (cpu_set_t *)&mask)) {
     ^
psutil/_psutil_linux.c: In function 'get_system_users':
psutil/_psutil_linux.c:311:13: warning: dereferencing type-punned pointer might 
break strict-aliasing rules [-Wstrict-aliasing]
             user_proc = Py_True;
             ^
psutil/_psutil_linux.c:313: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 -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 
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:395: error: undefined reference to 'PyModule_GetState'
psutil/_psutil_linux.c:395: error: undefined reference to 'PyModule_GetState'
psutil/_psutil_linux.c:395: error: undefined reference to 'PyModule_GetState'
psutil/_psutil_linux.c:389: error: undefined reference to 'PyModule_GetState'
psutil/_psutil_linux.c:298: error: undefined reference to 'PyList_New'
psutil/_psutil_linux.c:313: error: undefined reference to '_Py_FalseStruct'
psutil/_psutil_linux.c:314: error: undefined reference to 'Py_BuildValue'
psutil/_psutil_linux.c:323: error: undefined reference to 'PyList_Append'
psutil/_psutil_linux.c:311: error: undefined reference to '_Py_TrueStruct'
psutil/_psutil_linux.c:187: error: undefined reference to 'PyList_New'
psutil/_psutil_linux.c:194: error: undefined reference to 'PyEval_SaveThread'
psutil/_psutil_linux.c:196: error: undefined reference to 'PyEval_RestoreThread'
psutil/_psutil_linux.c:207: error: undefined reference to 'Py_BuildValue'
psutil/_psutil_linux.c:213: error: undefined reference to 'PyList_Append'
psutil/_psutil_linux.c:198: error: undefined reference to 'PyExc_OSError'
psutil/_psutil_linux.c:198: error: undefined reference to 
'PyErr_SetFromErrnoWithFilename'
psutil/_psutil_linux.c:131: error: undefined reference to 'PyArg_ParseTuple'
psutil/_psutil_linux.c:160: error: undefined reference to 'PyLong_AsLong'
psutil/_psutil_linux.c:163: error: undefined reference to 'PyLong_AsLong'
psutil/_psutil_linux.c:171: error: undefined reference to '_Py_NoneStruct'
psutil/_psutil_linux.c:161: error: undefined reference to 'PyErr_Occurred'
psutil/_psutil_linux.c:146: error: undefined reference to 'Py_BuildValue'
psutil/_psutil_linux.c:164: error: undefined reference to 'PyErr_Occurred'
psutil/_psutil_linux.c:170: error: undefined reference to 'PyExc_OSError'
psutil/_psutil_linux.c:170: error: undefined reference to 'PyErr_SetFromErrno'
psutil/_psutil_linux.c:261: error: undefined reference to 'PyArg_ParseTuple'
psutil/_psutil_linux.c:267: error: undefined reference to 'Py_BuildValue'
psutil/_psutil_linux.c:265: error: undefined reference to 'PyExc_OSError'
psutil/_psutil_linux.c:265: error: undefined reference to 'PyErr_SetFromErrno'
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:281: error: undefined reference to 'PyArg_ParseTuple'
psutil/_psutil_linux.c:287: error: undefined reference to '_Py_NoneStruct'
psutil/_psutil_linux.c:285: error: undefined reference to 'PyErr_SetFromErrno'
psutil/_psutil_linux.c:101: error: undefined reference to 'PyArg_ParseTuple'
psutil/_psutil_linux.c:109: error: undefined reference to '_Py_NoneStruct'
psutil/_psutil_linux.c:424: error: undefined reference to 'PyModule_Create2'
psutil/_psutil_linux.c:431: error: undefined reference to 
'PyModule_AddIntConstant'
psutil/_psutil_linux.c:432: error: undefined reference to 
'PyModule_AddIntConstant'
psutil/_psutil_linux.c:433: error: undefined reference to 
'PyModule_AddIntConstant'
psutil/_psutil_linux.c:434: 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
error: Bad exit status from /var/tmp/rpm-tmp.98015 (%build)

RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.98015 (%build)
build log is saved in python-psutil.-bb.20140313-154518.12314.filzbach.buildlog

Original issue reported on code.google.com by nobodyd...@gmail.com on 13 Mar 2014 at 3:46

GoogleCodeExporter commented 8 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

GoogleCodeExporter commented 8 years ago
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

GoogleCodeExporter commented 8 years ago
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

GoogleCodeExporter commented 8 years ago
>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

GoogleCodeExporter commented 8 years ago
Well, those errors state they aren't installed. =)

Original comment by g.rodola on 13 Mar 2014 at 4:26

GoogleCodeExporter commented 8 years ago
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

GoogleCodeExporter commented 8 years ago
> 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

GoogleCodeExporter commented 8 years ago
>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

GoogleCodeExporter commented 8 years ago
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

GoogleCodeExporter commented 8 years ago
> 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

GoogleCodeExporter commented 8 years ago

Original comment by g.rodola on 31 Dec 2014 at 5:22