jwood000/RcppAlgos

Can't Install RcppAlgos in Ubuntu

cxwcxw2001 opened this issue · 5 comments

I got stuck in this error when installing the package

g++  -std=c++14  -I/opt/microsoft/ropen/3.5.2/lib64/R/include -DNDEBUG -I../inst/include/ -DU_STATIC_IMPLEMENTATION -I"/opt/microsoft/ropen/3.5.2/lib64/R/library/Rcpp/include" -I"/home/schen/R/x86_64-pc-linux-gnu-library/3.5/RcppThread/include"     -Wno-unused-variable -Wno-unused-function -fPIC -c importExportMPZ.cpp -o importExportMPZ.o
-L/opt/microsoft/ropen/3.5.2/lib64/R/lib -o RcppAlgos.so CombPermUtils.o Combinatorics.o CountGmp.o DivNumSieve.o NthResult.o PollardRho.o Primes.o RcppExports.o SampCombPerm.o importExportMPZ.o -lgmp -L/opt/microsoft/ropen/3.5.2/lib64/R/lib -lR
/opt/microsoft/ropen/3.5.2/lib64/R/share/make/shlib.mk:6: recipe for target 'RcppAlgos.so' failed
Error in i.p(...) : 
  (converted from warning) installation of package ‘/tmp/RtmpU81uWD/file2734a21c3bf/RcppAlgos_2.3.4.tar.gz’ had non-zero exit status

This is the shlib.mk file:

## ${R_HOME}/share/make/shlib.mk

all: $(SHLIB)

$(SHLIB): $(OBJECTS)
	@if test  "z$(OBJECTS)" != "z"; then \
	  echo $(SHLIB_LINK) -o $@ $(OBJECTS) $(ALL_LIBS); \
	  $(SHLIB_LINK) -o $@ $(OBJECTS) $(ALL_LIBS); \
	fi

.PHONY: all shlib-clean

shlib-clean:
	@rm -Rf .libs _libs
	@rm -f $(OBJECTS) symbols.rds


## FIXME: why not Rscript?
symbols.rds: $(OBJECTS)
	@$(ECHO) "tools:::.shlib_objects_symbol_tables()" | \
	  $(R_HOME)/bin/R --vanilla --slave --args $(OBJECTS)

And this is my MakeVars file:

CXX11 = g++
CXX11FLAGS = -O2 -g $(LTO)
CXX1XPICFLAGS = -fpic
CXX11STD = -std=c++11
CXX14 = g++ 
CXX14STD = -std=c++14 
CXX14FLAGS = -Wno-unused-variable -Wno-unused-function -fPIC

Please advise. Thanks!

Hi @cxwcxw2001 (Scott),

I've been trying things to no avail for a while and I think the best option is to remove the requirement for C++14. I'm only using it for std::make_unique. I have found the actual implementation used in the C++14 standard, and I'm implementing this right now into this package. So far, everything is working perfectly with C++11.

I'll commit the fix when everything is ready, then you can simply download the dev version. I'm also planning on submitting 2.3.5 to CRAN in the next couple of weeks, so you will be able to get it from there.

Regards,
Joseph

Sounds good, thanks for looking into this Joseph!

I'm also having problems on Windows

compilation terminated.
make: *** [C:/PROGRA~1/MICROS~1/ROPEN~1/R-35~1.3/etc/x64/Makeconf:215: CombPermUtils.o] Error 1
ERROR: compilation failed for package 'RcppAlgos'
* removing 'C:/Users/joe/Documents/R/win-library/3.5/RcppAlgos'
In R CMD INSTALL
Error: Failed to install 'RcppAlgos' from GitHub:
  (converted from warning) installation of package ‘c:/temp/Rtmpag3JB7/file2708b434607/RcppAlgos_2.3.5.tar.gz’ had non-zero exit status
> 

@skanskan ,

That looks like the error you get when gmp is not installed on the system. Since you are Windows, you can look at installing gmp via cygwin (instructions here: https://cs.nyu.edu/~exact/core/gmp/index.html), or you can simply download the already built binaries from CRAN. We just released 2.3.6 and the binaries should be built within a couple of days.

Hope this helps

@cxwcxw2001 ,

Version 2.3.6 is on CRAN now. Also, now that there is no dependency on C++14 you should easily be able to download the dev version. I have done this on several Linux platforms and had no problems.

Let me know if you run into any issues and I will reopen this issue.

Thanks again for reporting.