After a lot of trial and error to install PyPy on CentOS, it was enough to drop it from the epel repository, so I'll leave a note. You can drop the source and compile it, but be prepared for the challenging type because it consumes a lot of memory and time.
Since the text was long and full of logs, only the necessary commands are listed. Just download the rpm package from the epel repository.
# yum --enablerepo=epel,rpmforge,remi search pypy
# yum --enablerepo=epel,rpmforge,remi info pypy
# yum --enablerepo=epel install pypy
# yum --enablerepo=epel install pypy-devel
I tried the following two methods to download from the PyPy page.
So I decided to look for the rpm package in the repository.
Check the version of CentOS for the time being.
# cat /etc/redhat-release
CentOS release 6.5 (Final)
I did a yum search with the --enablerepo option, specifying to search from the epel, rpmforge, and remi repositories. If you have not added the repository in the first place, please add it referring to the following article.
# yum --enablerepo=epel,rpmforge,remi search pypy
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
* base: ftp.iij.ad.jp
* epel: ftp.jaist.ac.jp
* extras: ftp.iij.ad.jp
* remi: remi.kazukioishi.net
* rpmforge: ftp.kddilabs.jp
* updates: ftp.iij.ad.jp
=================================================================== N/S Matched: pypy ===================================================================
pypy-devel.i686 : Development tools for working with PyPy
pypy-devel.x86_64 : Development tools for working with PyPy
pypy-libs.x86_64 : Run-time libraries used by PyPy implementations of Python
pypy.x86_64 : Python implementation with a Just-In-Time compiler
Name and summary matches only, use "search all" for everything.
Yum search doesn't know which repository has PyPy, so use yum info to identify it. Also check the version.
# yum --enablerepo=epel,rpmforge,remi info pypy
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
* base: ftp.iij.ad.jp
* epel: ftp.jaist.ac.jp
* extras: ftp.iij.ad.jp
* remi: remi.kazukioishi.net
* rpmforge: ftp.kddilabs.jp
* updates: ftp.iij.ad.jp
Available Packages
Name : pypy
Arch : x86_64
Version : 2.0.2
Release : 1.el6
Size : 7.3 M
Repo : epel
Summary : Python implementation with a Just-In-Time compiler
URL : http://pypy.org/
License : MIT and Python and UCD
Description : PyPy's implementation of Python, featuring a Just-In-Time compiler on some CPU
: architectures, and various optimized implementations of the standard types
: (strings, dictionaries, etc)
:
:
: This build of PyPy has JIT-compilation enabled.
According to the information so far, pypy is in the epel repository, so specify epel for --enablerepo and install it.
# yum --enablerepo=epel install pypy
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
* base: ftp.iij.ad.jp
* epel: ftp.jaist.ac.jp
* extras: ftp.iij.ad.jp
* updates: ftp.iij.ad.jp
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package pypy.x86_64 0:2.0.2-1.el6 will be installed
--> Processing Dependency: pypy-libs = 2.0.2-1.el6 for package: pypy-2.0.2-1.el6.x86_64
--> Running transaction check
---> Package pypy-libs.x86_64 0:2.0.2-1.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=========================================================================================================================================================
Package Arch Version Repository Size
=========================================================================================================================================================
Installing:
pypy x86_64 2.0.2-1.el6 epel 7.3 M
Installing for dependencies:
pypy-libs x86_64 2.0.2-1.el6 epel 5.0 M
Transaction Summary
=========================================================================================================================================================
Install 2 Package(s)
Total download size: 12 M
Installed size: 70 M
Is this ok [y/N]: y
Downloading Packages:
(1/2): pypy-2.0.2-1.el6.x86_64.rpm | 7.3 MB 00:01
(2/2): pypy-libs-2.0.2-1.el6.x86_64.rpm | 5.0 MB 00:00
---------------------------------------------------------------------------------------------------------------------------------------------------------
Total 4.6 MB/s | 12 MB 00:02
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
Installing : pypy-libs-2.0.2-1.el6.x86_64 1/2
Installing : pypy-2.0.2-1.el6.x86_64 2/2
Verifying : pypy-2.0.2-1.el6.x86_64 1/2
Verifying : pypy-libs-2.0.2-1.el6.x86_64 2/2
Installed:
pypy.x86_64 0:2.0.2-1.el6
Dependency Installed:
pypy-libs.x86_64 0:2.0.2-1.el6
Complete!
Let's put in devel for the time being.
# yum --enablerepo=epel install pypy-devel
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
* base: ftp.iij.ad.jp
* epel: ftp.jaist.ac.jp
* extras: ftp.iij.ad.jp
* remi: remi.kazukioishi.net
* rpmforge: ftp.kddilabs.jp
* updates: ftp.iij.ad.jp
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package pypy-devel.x86_64 0:2.0.2-1.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=========================================================================================================================================================
Package Arch Version Repository Size
=========================================================================================================================================================
Installing:
pypy-devel x86_64 2.0.2-1.el6 epel 35 k
Transaction Summary
=========================================================================================================================================================
Install 1 Package(s)
Total download size: 35 k
Installed size: 88 k
Is this ok [y/N]: y
Downloading Packages:
pypy-devel-2.0.2-1.el6.x86_64.rpm | 35 kB 00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : pypy-devel-2.0.2-1.el6.x86_64 1/1
Verifying : pypy-devel-2.0.2-1.el6.x86_64 1/1
Installed:
pypy-devel.x86_64 0:2.0.2-1.el6
Complete!
Hello World
Run the classic Hello World.
$ pypy
Python 2.7.3 (f66246c46ca30b26a5c73e4cc95dd6235c966b8f, Jul 30 2013, 09:27:06)
[PyPy 2.0.2 with GCC 4.4.7 20120313 (Red Hat 4.4.7-3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>> print("Hello World")
Hello World
It was displayed.
Compare the execution time with the function used in Comparison of execution time of CPython and PyPy.
CPython
>>> rangelist = range(1,10000000)
>>> print reduce(lambda x, y: x + y, [testfunc1(rangelist) for temp in range(10)])/10
0:00:01.717502
>>> print reduce(lambda x, y: x + y, [testfunc2(rangelist) for temp in range(10)])/10
0:00:01.183652
>>> print reduce(lambda x, y: x + y, [testfunc3(rangelist) for temp in range(10)])/10
0:00:00.734407
PyPy
>>> rangelist = range(1,10000000)
>>> print reduce(lambda x, y: x + y, [testfunc1(rangelist) for temp in range(10)])/10
0:00:01.017655
>>> print reduce(lambda x, y: x + y, [testfunc2(rangelist) for temp in range(10)])/10
0:00:00.983054
>>> print reduce(lambda x, y: x + y, [testfunc3(rangelist) for temp in range(10)])/10
0:00:00.250842
Execution time in PyPy is much shorter than in CPython.
Recommended Posts