来自:http://bugcharmer.blogspot.com/2012/07/building-pycrypto-on-amazon-ec2.html Step 1 - Install gcc/make
That was easy. Step 2 - Install the GNU MP Arithmetic Library
Still not too bad. Step 3 - Install MPIR
Everything worked up through here. Intermission There are two problems you’ll run into if you try to build PyCrypto at this point: errors from missing header files and, once you resolve those, runtime errors complaining about an undefined symbol for rpl_malloc. Let’s fix that. Step 4 - Install the Python development headers
Easy fix. Step 5 - Download PyCrypto
Step 6 - Edit the configure script
Find the this section of the script (I added line numbers):
Keep line 3867, but comment out the rest. Save and exit. or
The problem is that when you try to build PyCrypto, autotools thinks that we’re using rpl_malloc instead of malloc. I’m not sure how to fix this problem the right way, but this hack will get rid of the check and just have it use malloc. If someone knows the right way to fix this, please say something in the comments and I’ll update this post. 否则会有如下错误:
Step 7 - Build PyCrypto
Step 8 - Test PyCrypto
If this works, you should be good to go. If it fails, you did something wrong. You can either rm -r pycrypto-2.6 and re-extract the archive or just rm -r the build folder then grep for anything that says “rpl_malloc” and comment it out. Also edit config.status and change ‘D[“HAVE_MALLOC”]=” 0”’ to say ‘=” 1”’. This is what I did the first time, but when I decided to write this up I started over to try to get it right from the start. Have fun. (责任编辑:IT) |