david-cortes / isotree

(Python, R, C/C++) Isolation Forest and variations such as SCiForest and EIF, with some additions (outlier detection + similarity + NA imputation)
https://isotree.readthedocs.io
BSD 2-Clause "Simplified" License
192 stars 38 forks source link

Installing isotree compatibility issues #7

Closed tararae7 closed 4 years ago

tararae7 commented 4 years ago

Hi David,

We are having issues installing isotree on our R Server. I could install it fine locally on my laptop but when i requested to have it installed on our R Studio Server we are receiving incompatibility issues. I am being told its a possible C++ issue. Are you familiar with any sort of incompatibilities like this when trying to install the package?

david-cortes commented 4 years ago

There shouldn't be any such incompatibility. You can check in the CRAN results that it builds and runs without problems in a variety of environments and compilers. It does however have a dependency on Rcpp, which is also installable from CRAN. Cannot tell anything without the full error log.

tararae7 commented 4 years ago

Is there a specific R version you have to be on for installation to work? I have installed Rcpp so I think that is not the issue. If we use the devtools::install_github("david-cortes/isotree") method of installation RTools is required right?

Here is part of the error: (does that help or do you need it all?)

error: use of deleted function ‘std::basic_stringstream& std::basic_stringstream::operator=(const std::basic_stringstream&)’ ss = std::stringstream(serialized);

david-cortes commented 4 years ago

Is there a specific R version you have to be on for installation to work? I have installed Rcpp so I think that is not the issue. If we use the devtools::install_github("david-cortes/isotree") method of installation RTools is required right?

Here is part of the error: (does that help or do you need it all?)

error: use of deleted function ‘std::basic_stringstream& std::basic_stringstream::operator=(const std::basic_stringstream&)’ ss = std::stringstream(serialized);

You have an old and buggy compiler (probably GCC 4). You need to update the compiler to something more recent. It complains about some C++ functionality (constructing a stringstream from a string, https://en.cppreference.com/w/cpp/io/basic_stringstream/basic_stringstream variant (3)) which has been part of the C++ standards since long ago.

If that's not possible, you might just want to comment out the lines that give errors (if within an if-else, you have to comment out also that part).

david-cortes commented 4 years ago

For reference: https://stackoverflow.com/questions/50926506/deleted-function-std-basic-stringstream-in-linux-with-g

tararae7 commented 4 years ago

Sorry i didn't understand you suggestion about commenting out the lines that give errors. How would i do that? That error occurs when i am simply trying to install the isotree package.

david-cortes commented 4 years ago

I meant that you could download the code, comment out the lines in the source code, and then install your modified version.

But in any case, just noticed that CRAN also tests with an old compiler in the old R-release for windows and is giving the same error, which they'll probably ask me to fix too, so I've now made some small changes.

Please try installing it in your RServer version from GitHub with

devtools::install_github("david-cortes/isotree")

or

remotes::install_github("david-cortes/isotree")
tararae7 commented 4 years ago

Thanks for your help David. We were able to upgrade our GCC just like you mentioned and it is now working. Do you still want me to test out the new installs?

david-cortes commented 4 years ago

No, that's fine, I tested it myself with a GCC4 install and it worked. Also uploaded a new version to CRAN which compiles with GCC4.