Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't Install RcppAlgos in Ubuntu #10

Closed
cxwcxw2001 opened this issue Aug 27, 2019 · 5 comments
Closed

Can't Install RcppAlgos in Ubuntu #10

cxwcxw2001 opened this issue Aug 27, 2019 · 5 comments
Assignees

Comments

@cxwcxw2001
Copy link

@cxwcxw2001 cxwcxw2001 commented Aug 27, 2019

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!

@jwood000 jwood000 self-assigned this Aug 28, 2019
@jwood000
Copy link
Owner

@jwood000 jwood000 commented Sep 12, 2019

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

@cxwcxw2001
Copy link
Author

@cxwcxw2001 cxwcxw2001 commented Sep 19, 2019

Sounds good, thanks for looking into this Joseph!

@skanskan
Copy link

@skanskan skanskan commented Nov 1, 2019

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
> 
@jwood000
Copy link
Owner

@jwood000 jwood000 commented Jan 31, 2020

@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

@jwood000
Copy link
Owner

@jwood000 jwood000 commented Jan 31, 2020

@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.

@jwood000 jwood000 closed this Jan 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.