compil_pyml

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Prochaine révision
Révision précédente
compil_pyml [2008/03/07 17:14] – créée gerardcompil_pyml [2017/08/25 09:56] (Version actuelle) – modification externe 127.0.0.1
Ligne 1: Ligne 1:
-PyML -0.6.15 ne compile pas sous Solaris 10 avec la comande classique:+====== PyML ====== 
 +  * [[http://pyml.sourceforge.net|site]] 
 + 
 +===== Installation avec python 2.4 ===== 
 + 
 +<code> 
 +> cd src/PyML-0.6.15 
 +> python setup.py build 
 + 
 +</code> 
 + 
 +lorsqu'on a cette erreur: 
 +<code> 
 +> python setup.py build                                                         running build 
 +running build_py 
 +running build_ext 
 +building 'PyML/ext/_libsvm' extension 
 +C compiler: /usr/lib/python2.4/pycc -DNDEBUG 
 + 
 +compile options: '-I/usr/include/python2.4 -c' 
 +pycc: PyML/ext/libsvm.cpp 
 +cc: No input file specified, no output generated 
 +cc: No input file specified, no output generated 
 +error: Command "/usr/lib/python2.4/pycc -DNDEBUG -I/usr/include/python2.4 -c PyML/ext/libsvm.cpp -o build/temp.solaris-2.10-i86pc-2.4/PyML/ext/libsvm.o" failed with exit status 1 
 + 
 +</code> 
 +c'est parce qu'il utilise pycc au lieu de pyCC! 
 +<code> 
 +> /usr/lib/python2.4/pyCC -DNDEBUG -I/usr/include/python2.4 -c PyML/ext/libsvm_wrap.cpp -o build/temp.solaris-2.10-i86pc-2.4/PyML/ext/libsvm_wrap.o 
 + 
 +</code> 
 +il faut aller voir dans les distutils de pynum pour comprendre ce qui se passe?! 
 + 
 +===== Installation avec python 2.5 ===== 
 + 
 +<code> 
 +> cd src/PyML-0.6.15 
 +> /opt/csw/bin/python setup.py build 
 + 
 +</code> 
 + 
 +lorsqu'on a cette erreur: 
 +<code> 
 +> python setup.py build                                                         running build 
 +running build_py 
 +running build_ext 
 +building 'PyML/ext/_libsvm' extension 
 +C compiler: /usr/lib/python2.4/pycc -DNDEBUG 
 + 
 +compile options: '-I/usr/include/python2.4 -c' 
 +pycc: PyML/ext/libsvm.cpp 
 +cc: No input file specified, no output generated 
 +cc: No input file specified, no output generated 
 +error: Command "/usr/lib/python2.4/pycc -DNDEBUG -I/usr/include/python2.4 -c PyML/ext/libsvm.cpp -o build/temp.solaris-2.10-i86pc-2.4/PyML/ext/libsvm.o" failed with exit status 1 
 + 
 +</code> 
 +c'est parce qu'il utilise pycc au lieu de pyCC! 
 +<code> 
 +> /usr/lib/python2.4/pyCC -DNDEBUG -I/usr/include/python2.4 -c PyML/ext/libsvm_wrap.cpp -o build/temp.solaris-2.10-i86pc-2.4/PyML/ext/libsvm_wrap.o 
 + 
 +</code> 
 +il faut aller voir dans les distutils de pynum pour comprendre ce qui se passe?! 
 + 
 + 
 +PyML -0.6.15 ne compile pas sous Solaris 10 avec la commande classique:
 <code> <code>
 python setup build python setup build
Ligne 31: Ligne 95:
 </code> </code>
 peut etre lié à ce [[http://opensolaris.org/jive/thread.jspa?threadID=8179&tstart=135|probleme]] peut etre lié à ce [[http://opensolaris.org/jive/thread.jspa?threadID=8179&tstart=135|probleme]]
 +
 +
 +
 +====== hack dans le script setup.py ======
 +trouvé par N. Ollinger, permet d'avancer dans la compilation, mais maintenant, c'est un flag à l'édition de liens qui manque. De plus, il a fallu modifier un fichier à cause de hash_map
 +<code>
 +> python setup.py build --debug
 +running build
 +running build_py
 +running build_ext
 +building 'PyML/ext/_mylibsvm' extension
 +C compiler: /usr/lib/python2.4/pyCC
 +
 +compile options: '-g -I/usr/include/python2.4 -c'
 +pyCC: PyML/ext/mylibsvm_wrap.cpp
 +"PyML/ext/SparseDataSet.h", line 14: Error: Could not open include file<hash_map>.
 +"PyML/ext/SparseDataSet.h", line 27: Error: hash_map is not a member of std.
 +"PyML/ext/SparseDataSet.h", line 44: Error: A class template name was expected instead of hash_map.
 +3 Error(s) detected.
 +"PyML/ext/SparseDataSet.h", line 14: Error: Could not open include file<hash_map>.
 +"PyML/ext/SparseDataSet.h", line 27: Error: hash_map is not a member of std.
 +"PyML/ext/SparseDataSet.h", line 44: Error: A class template name was expected instead of hash_map.
 +3 Error(s) detected.
 +error: Command "/usr/lib/python2.4/pyCC -g -I/usr/include/python2.4 -c PyML/ext/mylibsvm_wrap.cpp -o build/temp.solaris-2.10-i86pc-2.4/PyML/ext/mylibsvm_wrap.o" failed with exit status 3
 +</code>
 +Pour hash_map, il faut linker avec "-library=stlport4", mais impossible de lui faire rajouter cet argument!?
 +
 +Si on le fait manuellement, on arrive a compiler et installer pyml:
 +<code>
 +> cp -rp PyML-0.6.15/setup.py PyML-0.6.15/setup.py.ori
 +> cd PyML-0.6.15/PyML/ext/
 +> cp -rp SMO.h SMO.h.ori
 +> cp -rp Gist.h Gist.h.ori
 +> cp -rp KernelCache.h KernelCache.h.ori
 +> cp -rp SparseDataSet.h SparseDataSet.h.ori
 +> cp -rp PyML/ext/FeatureVector.cpp PyML/ext/FeatureVector.cpp.ori              
 +
 +> cp PyML-0.6.15.old/setup.py PyML-0.6.15/
 +> cp PyML-0.6.15.old/PyML/ext/SMO.h PyML-0.6.15/PyML/ext/
 +> cp PyML-0.6.15.old/PyML/ext/Gist.h PyML-0.6.15/PyML/ext/
 +> cp PyML-0.6.15.old/PyML/ext/KernelCache.h PyML-0.6.15/PyML/ext/
 +> cp PyML-0.6.15.old/PyML/ext/SparseDataSet.h PyML-0.6.15/PyML/ext/
 +
 +</code>
 +pour tester:
 +<code>
 +> cd data/
 +> pwd
 +/local/apps/src/PyML-0.6.15
 +> python
 +Python 2.4.4 (#1, Jan  9 2007, 23:31:33) [C] on sunos5
 +Type "help", "copyright", "credits" or "license" for more information.
 +>>> from PyML import *
 +Traceback (most recent call last):
 +  File "<stdin>", line 1, in ?
 +  File "/local/apps/lib/lib/python2.4/site-packages/PyML/datafunc.py", line 2, in ?
 +    import arrayWrap
 +  File "/local/apps/lib/lib/python2.4/site-packages/PyML/arrayWrap.py", line 2, in ?
 +    from ext import csparsedataset
 +  File "/local/apps/lib/lib/python2.4/site-packages/PyML/ext/csparsedataset.py", line 7, in ?
 +    import _csparsedataset
 +ImportError: ld.so.1: python2.4: fatal: relocation error: file /local/apps/lib/lib/python2.4/site-packages/PyML/ext/_csparsedataset.so: symbol __1cDstd2l6Frn0ANbasic_ostream4Ccn0ALchar_traits4Cc____pkc_2_: referenced symbol not found
 +
 +</code>
 +s'agit il d'un problème de compatibilité entre [[http://forum.java.sun.com/thread.jspa?threadID=5101615&messageID=9347937|librairies?]]. On vérifie que les [[http://developers.sun.com/sunstudio/downloads/patches/ss12_patches.jsp|patches]] sont tous appliqués sur nemo, et on se reporte à la [[http://developers.sun.com/sunstudio/documentation/ss12/mr/READMEs/c++_faq.html|faq]] de sun studio.
 +\\
 +Il faudrait vérifier que la compilation du .so est correcte:
 +<code>
 + CC -G -features=extensions -compat=5 -library=iostream build/temp.solaris-2.10-i86pc-2.4/PyML/ext/SparseDataSet_wrap.o build/temp.solaris-2.10-i86pc-2.4/PyML/ext/SparseDataSet.o build/temp.solaris-2.10-i86pc-2.4/PyML/ext/DataSet.o build/temp.solaris-2.10-i86pc-2.4/PyML/ext/SparseFeatureVector.o build/temp.solaris-2.10-i86pc-2.4/PyML/ext/Kernel.o -o build/lib.solaris-2.10-i86pc-2.4/PyML/ext/_csparsedataset.so
 +</code>
 +mais aussi que les objets ont bien été compilés avec stlport4?
 +
 +====== références ======
 +  * http://forum.java.sun.com/thread.jspa?threadID=5097023&messageID=9382032
 +  * http://www.python.org/doc/2.4.4/inst/tweak-flags.html
 +  *
 +
  • compil_pyml.1204906442.txt.gz
  • Dernière modification : 2017/08/25 09:55
  • (modification externe)