lbartnik / subprocess

Other
49 stars 10 forks source link

RedHat Installation Issue #41

Closed bedantaguru closed 7 years ago

bedantaguru commented 7 years ago

Firstly let me thank you for this wonderful package. I have been looking for this for so many years.

Issue: I have access to several systems at my workplace. I'll list here 3 major of them one of which I'm facing issues.

  1. CentOS 6 (x64 bit) Server with limited Internet access [uses proxy for internet]
  2. Windows 10 (x64 bit) machine with Internet access
  3. Redhat 6.5 (x64 bit) Server no Internet access [only LAN is visible] in data center

All of them have R 3.3.2 (2016-10-31) -- "Sincere Pumpkin Patch"

Now I was able to install in machines 1 and 2 without any issue. However when I tried installing [after pushing the latest CRAN copy] in 3. It gave me following errors. I'm not sure what is the reason for the same. Kindly help.

I ran this command [root@master1 Temp]# R CMD INSTALL subprocess_0.8.0.tar.gz Console Log :

* installing to library ‘/usr/lib64/R/library’                                                                                                                                                                     
* installing *source* package ‘subprocess’ ...                                                                                                                                                                     
** package ‘subprocess’ successfully unpacked and MD5 sums checked                                                                                                                                                 
** libs                                                                                                                                                                                                            
g++ -m64 -std=c++0x -I/usr/include/R -DNDEBUG  -I/usr/local/include    -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c rapi.cc -o
 rapi.o                                                                                                                                                                                                            
In file included from rapi.h:11,                                                                                                                                                                                   
                 from rapi.cc:8:                                                                                                                                                                                   
config-os.h:59: error: ‘constexpr’ does not name a type                                                                                                                                                            
In file included from rapi.cc:9:                                                                                                                                                                                   
subprocess.h:27: error: expected constructor, destructor, or type conversion before ‘int’                                                                                                                          
subprocess.h:39: error: expected constructor, destructor, or type conversion before ‘int’                                                                                                                          
subprocess.h:41: error: expected constructor, destructor, or type conversion before ‘int’                                                                                                                          
subprocess.h:89: error: ‘constexpr’ does not name a type                                                                                                                                                           
subprocess.h:96: error: ‘buffer_size’ was not declared in this scope                                                                                                                                               
subprocess.h: In constructor ‘subprocess::pipe_writer::pipe_writer()’:                                                                                                                                             
subprocess.h:108: error: ‘buffer_size’ was not declared in this scope                                                                                                                                              
rapi.cc: In function ‘typename std::result_of<_Functor(_ArgTypes ...)>::type try_run(F, Args ...)’:                                                                                                                
rapi.cc:59: error: ‘BUFFER_SIZE’ was not declared in this scope                                                                                                                                                    
rapi.cc:68: error: ‘try_buffer’ was not declared in this scope                                                                                                                                                     
rapi.cc:73: error: ‘try_buffer’ was not declared in this scope                                                                                                                                                     
rapi.cc: In function ‘void C_child_process_finalizer(SEXPREC*)’:                                                                                                                                                   
rapi.cc:184: error: expected primary-expression before ‘[’ token                                                                                                                                                   
rapi.cc:184: error: unable to deduce ‘auto’ from ‘<expression error>’                                                                                                                                              
rapi.cc:184: error: expected ‘,’ or ‘;’ before ‘{’ token                                                                                                                                                           
rapi.cc:184: warning: unused variable ‘try_terminate’                                                                                                                                                              
rapi.cc:521: error: expected ‘}’ at end of input                                                                                                                                                                   
rapi.cc: At global scope:                                                                                                                                                                                          
rapi.cc:32: warning: ‘int is_nonempty_string(SEXPREC*)’ declared ‘static’ but never defined                                                                                                                        
rapi.cc:33: warning: ‘int is_single_string_or_NULL(SEXPREC*)’ declared ‘static’ but never defined                                                                                                                  
rapi.cc:34: warning: ‘int is_single_integer(SEXPREC*)’ declared ‘static’ but never defined                                                                                                                         
rapi.cc:38: warning: ‘char** to_C_array(SEXPREC*)’ declared ‘static’ but never defined                                                                                                                             
rapi.cc:40: warning: ‘void free_C_array(char**)’ declared ‘static’ but never defined                                                                                                                               
rapi.cc:42: warning: ‘SEXPREC* allocate_single_bool(bool)’ declared ‘static’ but never defined                                                                                                                     
rapi.cc:44: warning: ‘SEXPREC* allocate_TRUE()’ defined but not used                                                                                                                                               
rapi.cc:83: warning: ‘subprocess::process_handle_t* extract_process_handle(SEXPREC*)’ defined but not used                                                                                                         
make: *** [rapi.o] Error 1                                                                                                                                                                                         
ERROR: compilation failed for package ‘subprocess’                                                                                                                                                                 
* removing ‘/usr/lib64/R/library/subprocess’
bedantaguru commented 7 years ago

I think I'm able to figure out the issue

In machine 3.

[root@master1 Temp]# gcc --version
gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-16)
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

and in machine 1

[repouser@master1 Repo]$ gcc --version
gcc (GCC) 4.8.2 20140120 (Red Hat 4.8.2-15)
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

So I guess it's related to C++11. I'm following this blog. Hope it will resolve the issue.

bedantaguru commented 7 years ago

Yeah it did solve the issue... Follow above blog to install C++11 and install latest R problem will be solved. Closing the issue.

lbartnik commented 7 years ago

Hi @bedantaguru ! I'm happy to hear you've this tool useful! I'm also happy I didn't have to do anything to resolve your problem :-) Power users are the best users!

bedantaguru commented 7 years ago

You are welcome.. Just FYI I'm using it for calling Sqoop from R in RedHat OS. I'm quite satisfied with it's performance. Just one thing that I'm currently looking for is something like log redirection to a file. Right now it can read from PIPE_STDOUT and PIPE_STDERR. But the problem is it reads only incremental outputs. Like if Map Reduce is completed 10% and I called process_read and after that I called again process_read later, then in such situations I'll not get earlier outputs from either PIPES. There is similar feature in Python too. I'm not sure whether I'm missing something, so I'll do a little more research and then if required I'll create an issue for the same.

lbartnik commented 7 years ago

Hey, I'm not sure what exactly do you mean by "incremental read". I think all data sent to the output by the child process should be accessible for the parent to read. And each byte can be read only once. How else would you like to work with this tool?