luigimarmo / psutil

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

Support Solaris 10 #422

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Currently psutil won't compile on Solaris 10:

[psutil@nitrogen/ttypts/1(~/psutil)%] python setup.py build 
/opt/csw/lib/python/distutils/dist.py:266: UserWarning: Unknown distribution 
option: 'test_suite'
  warnings.warn(msg)
running build
running build_py
running build_ext
building '_psutil_sunos' extension
/opt/SUNWspro/bin/cc -xO3 -m32 -xarch=sparc -OPT:Olimit=0 -xO3 -m32 
-xarch=sparc -DNDEBUG -O -xcode=pic32 -I/opt/csw/include/python2.6 -c 
psutil/_psutil_sunos.c -o 
build/temp.solaris-2.10-sun4u-2.6/psutil/_psutil_sunos.o
unable to execute /opt/SUNWspro/bin/cc: No such file or directory
error: command '/opt/SUNWspro/bin/cc' failed with exit status 1

According to http://en.wikipedia.org/wiki/Solaris_(operating_system) Solaris 11 
appeared in late 2010 so I suppose there's a lot of Solaris 10 installations 
out there. Definitively looks like a platform we want to support.

Original issue reported on code.google.com by g.rodola on 25 Aug 2013 at 3:17

GoogleCodeExporter commented 8 years ago
this error just means you don't have the Sun compiler installed. you can build 
the shared object files with gcc. I had to do it manually because python (and 
therefore pycc) is expecting to use the sun C compiler and therefore uses 
options like -KPIC which don't work.

here are the gcc commands i used to build the shared libraries:

gcc -I/usr/include/python2.6 -c psutil/_psutil_sunos.c -o 
build/temp.solaris-2.10-i86pc-2.6/psutil/_psutil_sunos.o

gcc -L. -L/usr/sfw/lib -R/usr/sfw/lib -G 
build/temp.solaris-2.10-i86pc-2.6/psutil/_psutil_sunos.o -L/usr/lib -lkstat 
-lnsl -lpython2.6 -o build/lib.solaris-2.10-i86pc-2.6/_psutil_sunos.so

gcc  -I/usr/include/python2.6 -c psutil/_psutil_posix.c -o 
build/temp.solaris-2.10-i86pc-2.6/psutil/_psutil_posix.o

gcc -L. -L/usr/sfw/lib -R/usr/sfw/lib -G 
build/temp.solaris-2.10-i86pc-2.6/psutil/_psutil_posix.o -L/usr/lib -lpython2.6 
-o build/lib.solaris-2.10-i86pc-2.6/_psutil_posix.so

Original comment by manch...@gmail.com on 10 Sep 2013 at 6:22