Setup R Language Integration (RHEL and CentOS)

Moderator: NorbertKrupa

Post Reply
User avatar
JimKnicely
Site Admin
Site Admin
Posts: 1825
Joined: Sat Jan 21, 2012 4:58 am
Contact:

Setup R Language Integration (RHEL and CentOS)

Post by JimKnicely » Wed Jan 09, 2013 1:31 pm

My example will be for Vertica 6.1!

#1 Download the vertica-R-lang-6.1.0-0.x86_64.RHEL5.rpm (or the relevant version for your DB and OS versions)
#2 Copy the RPM to each node of your cluster
#3 As the root user, Install the RPM on each node:
  • rpm -ivh vertica-R-lang-6.1.0-0.x86_64.RHEL5.rpm
You may get some dependencies errors:

Code: Select all

[root@verticatest01 vertica6.1.0]# rpm -ivh vertica-R-lang-6.1.0-0.x86_64.RHEL5.rpm
error: Failed dependencies:
        /usr/lib64/libgfortran.so.1 is needed by vertica-R-lang-6.1.0-0.x86_64
If you get that one, you'll have to install libgfortran:
  • For RHEL 6 and CentOS 6, install the compat-libgfortran-41 RPM: yum install compat-libgfortran-41
    For RHEL 5 and CentOS 5, install the libgfortran RPM: yum install libgfortran
I'm running CentOS 5...

Code: Select all

[root@verticatest01 vertica6.1.0]# yum install libgfortran
Loaded plugins: fastestmirror
Determining fastest mirrors
 * base: mirrors.finalasp.com
 * extras: mirrors.finalasp.com
 * updates: mirror.team-cymru.org
addons                                                                                                     | 1.9 kB     00:00
base                                                                                                       | 1.1 kB     00:00
extras                                                                                                     | 2.1 kB     00:00
extras/primary_db                                                                                          | 207 kB     00:00
updates                                                                                                    | 1.9 kB     00:00
updates/primary_db                                                                                         | 1.0 MB     00:00
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package libgfortran.i386 0:4.1.2-52.el5_8.1 set to be updated
---> Package libgfortran.x86_64 0:4.1.2-52.el5_8.1 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

==================================================================================================================================
 Package                        Arch                      Version                                Repository                  Size
==================================================================================================================================
Installing:
 libgfortran                    i386                      4.1.2-52.el5_8.1                       updates                    232 k
 libgfortran                    x86_64                    4.1.2-52.el5_8.1                       updates                    244 k

Transaction Summary
==================================================================================================================================
Install       2 Package(s)
Upgrade       0 Package(s)

Total download size: 477 k
Is this ok [y/N]: y
Downloading Packages:
(1/2): libgfortran-4.1.2-52.el5_8.1.i386.rpm                                                               | 232 kB     00:00
(2/2): libgfortran-4.1.2-52.el5_8.1.x86_64.rpm                                                             | 244 kB     00:00
----------------------------------------------------------------------------------------------------------------------------------
Total                                                                                             877 kB/s | 477 kB     00:00
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : libgfortran                                                                                                1/2
  Installing     : libgfortran                                                                                                2/2

Installed:
  libgfortran.i386 0:4.1.2-52.el5_8.1                            libgfortran.x86_64 0:4.1.2-52.el5_8.1

Complete!
Here's another dependency error you might see:

Code: Select all

[root@verticatest01 ~]# rpm -ivh vertica-R-lang-6.1.0-0.x86_64.RHEL5.rpm
error: Failed dependencies:
        /usr/lib64/libgomp.so.1 is needed by vertica-R-lang-6.1.0-0.x86_64
If you do, simply install libgomp:

Code: Select all

[root@verticatst01 ~]# yum install libgomp
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.nexcess.net
 * extras: centos-mirror.jchost.net
 * updates: mirror.ubiquityservers.com
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package libgomp.i386 0:4.4.6-3.el5.1 set to be updated
---> Package libgomp.x86_64 0:4.4.6-3.el5.1 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

==================================================================================================================================
 Package                       Arch                         Version                              Repository                  Size
==================================================================================================================================
Installing:
 libgomp                       i386                         4.4.6-3.el5.1                        base                        72 k
 libgomp                       x86_64                       4.4.6-3.el5.1                        base                        69 k

Transaction Summary
==================================================================================================================================
Install       2 Package(s)
Upgrade       0 Package(s)

Total download size: 142 k
Is this ok [y/N]: y
Downloading Packages:
(1/2): libgomp-4.4.6-3.el5.1.x86_64.rpm                                                                    |  69 kB     00:00
(2/2): libgomp-4.4.6-3.el5.1.i386.rpm                                                                      |  72 kB     00:00
----------------------------------------------------------------------------------------------------------------------------------
Total                                                                                             431 kB/s | 142 kB     00:00
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : libgomp                                                                                                    1/2
  Installing     : libgomp                                                                                                    2/2

Installed:
  libgomp.i386 0:4.4.6-3.el5.1                                   libgomp.x86_64 0:4.4.6-3.el5.1

Complete!
Once all the dependencies are met, you can install the vertica-R-lang-x.rpm:

Code: Select all

[root@verticatest01 ~]# rpm -ivh vertica-R-lang-6.1.0-0.x86_64.RHEL5.rpm
Preparing...                ########################################### [100%]
   1:vertica-R-lang         ########################################### [100%]

The Vertica R language package has been successfully installed on host verticatest01
Remember you have to do this on all of your nodes!

Now your ready to create your first R library. For instance...

Code: Select all

dbadmin=> select version();
              version
------------------------------------
 Vertica Analytic Database v6.1.0-0
(1 row)

dbadmin=> create library kmeansGeoLib as '/usr/home/dbadmin/kmeans.R' language 'R';
CREATE LIBRARY
Jim Knicely

Image

Note: I work for Vertica. My views, opinions, and thoughts expressed here do not represent those of my employer.

mmuthu4322
Newbie
Newbie
Posts: 1
Joined: Fri Apr 10, 2015 2:49 pm

Re: Setup R Language Integration (RHEL and CentOS)

Post by mmuthu4322 » Fri Apr 10, 2015 2:55 pm

Hi Jim,
Thank you for this article, My Vertica version is this

Vertica Analytic Database 7.0.1-0

So I should use 'vertica-R-lang-7.0.1-0.x86_64.RHEL5.rpm' right, As usual I have no way to download this version of the software. (NOT so good practice by Vertica though)

Anyways to get the software apart from Vertica site? Do you know how we can raise support cases for vertica?
Kindly advise.

Regards,
Mahendran M

Post Reply

Return to “R Language Integration”