error installing on R 3.2

143 views
Skip to first unread message

Ryan Hafen

unread,
Apr 17, 2015, 2:38:39 PM4/17/15
to rh...@googlegroups.com
I’m not sure exactly what has changed in R 3.2, but I am having trouble installing RHIPE with the following error message.  This is on Ubuntu Precise on a system where RHIPE installed correctly with earlier versions of R.  I wonder if it can be addressed in a way that is compatible with 3.2 and earlier versions.

...
 -g  -DUSEAUTOSHORT -DHAVE_UINTPTR_T    `/usr/lib/R/bin/R CMD config --cppflags` `pkg-config --cflags protobuf` -c main.cc -o main.o
g++  rexp.pb.o message.o fileio.o signal.o display.o reducer.o mapreduce.o main.o -o ../inst/bin/RhipeMapReduce -I.  -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -DUSEAUTOSHORT -DHAVE_UINTPTR_T    `/usr/lib/R/bin/R CMD config --cppflags` `pkg-config --cflags protobuf` -fpic `/usr/lib/R/bin/R CMD config --ldflags` `pkg-config --libs protobuf`  `/usr/lib/R/bin/R CMD config --cppflags` `/usr/lib/R/bin/R CMD config --ldflags`
fileio.o: In function `nlz(long)':
/tmp/RtmpEukVLx/R.INSTALLcdd68277e91/Rhipe/src/fileio.cc:28: multiple definition of `R_running_as_main_program'
message.o:/tmp/RtmpEukVLx/R.INSTALLcdd68277e91/Rhipe/src/message.cc:9: first defined here
signal.o: In function `sig_chld(int)':
/tmp/RtmpEukVLx/R.INSTALLcdd68277e91/Rhipe/src/signal.cc:52: multiple definition of `R_running_as_main_program'
message.o:/tmp/RtmpEukVLx/R.INSTALLcdd68277e91/Rhipe/src/message.cc:9: first defined here
display.o: In function `Re_WriteConsoleEx(char const*, int, int)':
/tmp/RtmpEukVLx/R.INSTALLcdd68277e91/Rhipe/src/display.cc:47: multiple definition of `R_running_as_main_program'
message.o:/tmp/RtmpEukVLx/R.INSTALLcdd68277e91/Rhipe/src/message.cc:9: first defined here
reducer.o: In function `reducer_run()':
/tmp/RtmpEukVLx/R.INSTALLcdd68277e91/Rhipe/src/reducer.cc:15: multiple definition of `R_running_as_main_program'
message.o:/tmp/RtmpEukVLx/R.INSTALLcdd68277e91/Rhipe/src/message.cc:9: first defined here
mapreduce.o: In function `shallowCopyVector(SEXPREC*, SEXPREC*, int)':
/tmp/RtmpEukVLx/R.INSTALLcdd68277e91/Rhipe/src/mapreduce.cc:75: multiple definition of `R_running_as_main_program'
message.o:/tmp/RtmpEukVLx/R.INSTALLcdd68277e91/Rhipe/src/message.cc:9: first defined here
main.o: In function `setup_stream(Streams*)':
/tmp/RtmpEukVLx/R.INSTALLcdd68277e91/Rhipe/src/main.cc:21: multiple definition of `R_running_as_main_program'
message.o:/tmp/RtmpEukVLx/R.INSTALLcdd68277e91/Rhipe/src/message.cc:9: first defined here
collect2: ld returned 1 exit status
make: *** [app] Error 1
ERROR: compilation failed for package 'Rhipe'
* removing '/usr/local/lib/R/site-library/Rhipe'

Saptarshi Guha

unread,
Apr 17, 2015, 3:08:03 PM4/17/15
to rh...@googlegroups.com

On Fri, Apr 17, 2015 at 11:38 AM, Ryan Hafen <rha...@gmail.com> wrote:
/usr/lib/R/bin/R CMD config --cppflags


​What is this vlaue?
/usr/lib/R/bin/R CMD config --cppflags
?

Ryan

unread,
Apr 17, 2015, 9:10:03 PM4/17/15
to rh...@googlegroups.com, saptars...@gmail.com
It is :

~$ /usr/lib/R/bin/R CMD config --cppflags

-I/usr/share/R/include

Saptarshi Guha

unread,
Apr 18, 2015, 2:40:57 AM4/18/15
to Ryan, rh...@googlegroups.com
lastly, is this 32 bit ubuntu or 64?

Saptarshi Guha

unread,
Apr 18, 2015, 5:16:51 AM4/18/15
to Ryan, rh...@googlegroups.com
Hello,

Created a 64 bit Ubuntu vm and confirmed the bug.

Steps to fix

1. In main.cc, remove the extern before the R_running_as_main ...
2. Remove the include "RInterfaces.h" from ream.h and move it to main.cc

Removing the extern might make it backwards incompatible with R < 3.2.
That can be easily fixed with some conditional includes. That said, can you check if it works with say R 3.0?

I have attached a patch file.
Please confirm it works ...
Cheers
Saptarshi

fixR.patch

Saptarshi Guha

unread,
Apr 18, 2015, 5:42:59 AM4/18/15
to Ryan, rh...@googlegroups.com
Correction, remove the extern int R_main... line completely.
Corrected patch attached. Apply to git master.

Regards
Saptarshi

fixR.patch

Ryan Hafen

unread,
Apr 18, 2015, 11:16:28 AM4/18/15
to saptars...@gmail.com, rh...@googlegroups.com
Thanks!  Will apply and test later today.

Ryan


<fixR.patch>

Ryan Hafen

unread,
Apr 18, 2015, 8:19:21 PM4/18/15
to saptars...@gmail.com, rh...@googlegroups.com
I have made changes and tested on 3.2 and 3.1.2.  To keep things backward compatible, I left the extern int R_main… line in main.cc.  With that it still works in both cases.

I’ve put this at master on github.com/hafen/RHIPE.  Will do some more testing before merging with tesseradata repo.

Ryan



<fixR.patch>

Saptarshi Guha

unread,
Apr 19, 2015, 2:00:54 AM4/19/15
to Ryan Hafen, rh...@googlegroups.com
Hi,

So this is my C ignorance speaking, rather than keeping extern int R_main .. in the c file (when the it is already defined in Rinterfaces.h in newer releases of R) i suggest you do this

#if R_VERSION < R_Version(3,0,0)
extern int R_main ..
#endif

This way the declaration is only present for older R.

Regards
Saptarshi



Ryan Hafen

unread,
Apr 19, 2015, 3:44:43 AM4/19/15
to saptars...@gmail.com, rh...@googlegroups.com
Good call.  I have made a change to this effect.  But after looking at R source for different versions, the line of delineation is 3.2, so that’s where the check boundary is.

Ryan

varun gautam

unread,
Jul 5, 2015, 9:20:50 PM7/5/15
to rh...@googlegroups.com
Hello 
I am also using R 3.2.1 on ubuntu (Amazon EC2 free-tier). I am having the same trouble installing RHIPE. I am very new to Hadoop. Please let me know fromwhere should I download the latest version of RHIPE to install compatible with R 3.2.1

Regards
Varun
Reply all
Reply to author
Forward
0 new messages