Git Product home page Git Product logo

Comments (7)

PaulKeydel avatar PaulKeydel commented on July 1, 2024 1

Guys, I could figure out what the problem is. I normally use VS code for writing R scripts, but if I want to install/update packages I usually do this in the R console (this tiny GUI that comes with R for Mac). It seems this caused all my problems. When I use the standard terminal and start R, RcppParallel::defaultNumThreads() works absolutely fine and I also could install Quanteda from source without problems.
So, this is kind of weird, but using the R console can't be recommended...

Thanks a lot for your efforts!

from quanteda.

koheiw avatar koheiw commented on July 1, 2024

Did you update Rcpp and RcppParallel?

from quanteda.

PaulKeydel avatar PaulKeydel commented on July 1, 2024

Did you update Rcpp and RcppParallel?

Yes. All packages are up to date.

from quanteda.

kbenoit avatar kbenoit commented on July 1, 2024

I use the same platform (macOS, M1 Max) and it installs fine. Could you include the output of sessionInfo()?

from quanteda.

PaulKeydel avatar PaulKeydel commented on July 1, 2024

I use the same platform (macOS, M1 Max) and it installs fine. Could you include the output of sessionInfo()?

That is my setting:

> sessionInfo()
R version 4.3.1 (2023-06-16)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Sonoma 14.1.1

Matrix products: default
BLAS:   /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRblas.0.dylib 
LAPACK: /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRlapack.dylib;  LAPACK version 3.11.0

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

time zone: Europe/Berlin
tzcode source: internal

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] compiler_4.3.1

from quanteda.

PaulKeydel avatar PaulKeydel commented on July 1, 2024

After a few hours of further investigation I could collect some more details, that might be interesting. First, when I use CRAN to install Quanteda, the segfault issue during loading Quanteda is directly linked to the RcppParallel package. The RcppParallel::defaultNumThreads() method itself produces the segfault, even though I set the number of threads before. Here is what I tested:

> library("RcppParallel")
> setThreadOptions(numThreads=4)
> defaultNumThreads()

 *** caught segfault ***
address 0x245, cause 'invalid permissions'

RcppParallel is up to date and I also tried to reinstall it from source. However, the issue with defaultNumThreads() couldn't be fixed by reinstalling.

Second, if I try to install different versions of Quanteda from source, I always get the 'non-zero exit code' message. Although I can install Quanteda 3.3.1 from CRAN without problems, building the same version of Quanteda from source

> require(devtools)
> Sys.setenv("R_REMOTES_NO_ERRORS_FROM_WARNINGS" = "true")
> remotes::install_github("quanteda/quanteda", ref="v3_3")

fails with non-zero exit code.

Is it possible, that RcppParallel is somehow the reason for both problems?

from quanteda.

kbenoit avatar kbenoit commented on July 1, 2024

That's strange! Might have to do with different environment variables. There are also sometimes differences on where packages get installed, and I remember an issue where some were in system directories and some in user directories - and I even had two versions (one in each place) depending on how I'd installed them. I changed this by fixing my .libPaths() setting to a single installation folder. And by checking them using View(installed.packages()).

from quanteda.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.