Compile and install M2Crypto-0.20.2

Source: Internet
Author: User

The latest version requires RSA symmetric key encryption, so M2Crypto is required. Poor team found that compilation is not easy at all. The following is a summary of my experiences.

Server Environment
$ lsb_release -aLSB Version::core-3.0-ia32:core-3.0-noarch:graphics-3.0-ia32:graphics-3.0-noarchDistributor ID:RedHatEnterpriseASDescription:Red Hat Enterprise Linux AS release 4 (Nahant Update 4)Release:4Codename:NahantUpdate4

Download m2crypto-0.4102.tar.gz
(It must be 0.20.2, or "undefined symbol: RSA" will appear.VerifyPKCS1_PSS "error)

M2Crypto Installation failed. Please troubleshoot as follows

Dependent environment:

0.20.2:Python 2.3 or newerm2urllib2 requires Python 2.4 or newerOpenSSL 0.9.7 or newerSome optional new features will require OpenSSL 0.9.8 or newerSWIG 1.3.28 or newer required for buildingSWIG 1.3.30 or newer may be required with Python 2.5 or newer and Python 2.4 with Py_ssize_t patches$ swig -version

If the version of swig is earlier than 1.3.29, install the new version of swig-2.0.0 first.

$ Tar zxvf swig-2.0.0.tar.gz $ cd swig-2.0.0 $. /configure -- prefix = $ HOME/local/swig $ make & make install # Set $ HOME/local/swig/bin to the environment variable PATH and replace the original swig $ source ~ /. Bash_profile

Decompress compile M2Crypto-0.20.2

$ tar zxvf M2Crypto-0.20.2.tar.gz$ cd M2Crypto-0.20.2/$ ~/local/python/bin/python setup.py build

If error 1 is displayed: (the following problems may occur in earlier OpenSSL 0.9.7 versions)

“This openssl-devel package does not work your architecture?”

Then, modify the setup. py file and set # '-DI386'(Or directly download the modified setup. py file to replace the original one)

If error message 2 appears:

"/Usr/include/openssl/opensslconf. h: 13: Error: Unable to find 'opensslconf-i386.h' "# copy 'opensslconf-i386.h' to the current directory $ cp/usr/include/openssl/opensslconf-i386.h./

Recompile and install

$ ~/local/python/bin/python setup.py build$ ~/local/python/bin/python setup.py install

^_^ Succeeded!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.