Sto provando ad installare il pacchetto Python M2Crypto in un virtualenv su una macchina x86_64 RHEL 6.1. Questo processo invoca sorso, che non riesce con il seguente errore:M2Crypto non si installa in venv, o swig non definisce __x86_64__ che rompe la compilazione con OpenSSL
$ virtualenv -q --no-site-packages venv
$ pip install -E venv M2Crypto==0.20.2
Downloading/unpacking M2Crypto==0.20.2
Downloading M2Crypto-0.20.2.tar.gz (412Kb): 412Kb downloaded
Running setup.py egg_info for package M2Crypto
Installing collected packages: M2Crypto
Running setup.py install for M2Crypto
building 'M2Crypto.__m2crypto' extension
swigging SWIG/_m2crypto.i to SWIG/_m2crypto_wrap.c
swig -python -I/usr/include/python2.6 -I/usr/include -includeall -o SWIG/_m2crypto_wrap.c SWIG/_m2crypto.i
/usr/include/openssl/opensslconf.h:31: Error: CPP #error ""This openssl-devel package does not work your architecture?"". Use the -cpperraswarn option to continue swig processing.
error: command 'swig' failed with exit status 1
Complete output from command /home/lorin/venv/bin/python -c "import setuptools;__file__='/home/lorin/venv/build/M2Crypto/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-BFiNtU-record/install-record.txt --install-headers /home/lorin/venv/include/site/python2.6:
Ho OpenSSL 1.0.0 installato tramite pacchetti RPM da RedHat.
La parte del /usr/include/openssl/opensslconf.h che causa l'errore si presenta in questo modo:
#if defined(__i386__)
#include "opensslconf-i386.h"
#elif defined(__ia64__)
#include "opensslconf-ia64.h"
#elif defined(__powerpc64__)
#include "opensslconf-ppc64.h"
#elif defined(__powerpc__)
#include "opensslconf-ppc.h"
#elif defined(__s390x__)
#include "opensslconf-s390x.h"
#elif defined(__s390__)
#include "opensslconf-s390.h"
#elif defined(__sparc__) && defined(__arch64__)
#include "opensslconf-sparc64.h"
#elif defined(__sparc__)
#include "opensslconf-sparc.h"
#elif defined(__x86_64__)
#include "opensslconf-x86_64.h"
#else
#error "This openssl-devel package does not work your architecture?"
#endif
gcc ha la variabile definita destra:
$ echo | gcc -E -dM - | grep x86_64
#define __x86_64 1
#define __x86_64__ 1
Ma apparenty sorso doesn 't, dal momento che questa è la linea che è mancata:
swig -python -I/usr/include/python2.6 -I/usr/include -includeall -o \
SWIG/_m2crypto_wrap.c SWIG/_m2crypto.i
c'è un modo per risolvere questo problema modificando som nella mia configurazione di sistema? M2Crypto viene installato in una virtualenv come parte di uno script più grande che non controllo, quindi evitare di andare in giro con i file M2Crypto sarebbe una buona cosa.
C'è [ 'fedora_setup.sh'] (http://svn.osafoundation.org/m2crypto/trunk/fedora_setup.sh) ma richiede gingillarsi con la File M2Crypto. – jfs
@ J.F.Sebastian: non è familiare, puoi fornire maggiori dettagli in una risposta completa? –