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

xset crashes on MAC OS 14.3 R 4.3.3 , BiocManager 1.30.22 and xcms 4.0.2 #730

Open
AndreasReinecke opened this issue Mar 11, 2024 · 6 comments

Comments

@AndreasReinecke
Copy link

Hi,
when running the following command line on a MAC M1 / MOC OS 14.3 with R 4.3.3 , BiocManager 1.30.22 and xcms 4.0.2 I get the error messages below:
I'd be grateful for any hint.
Best
andreas

xset <- xcmsSet(files=files, mzdiff=0.2, fwhm=5, step=0.1, snthresh=5)
objc[2495]: +[NSCharacterSet initialize] may have been in progress in another thread when fork() was called.
objc[2495]: +[NSCharacterSet initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in the fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug.
....
Error in reducer$value.cache[[as.character(idx)]] <- values :
wrong args for environment subassignment
In addition: Warning message:
In parallel::mccollect(wait = FALSE, timeout = 1) :
2 parallel jobs did not deliver results

@sneumann
Copy link
Owner

Hi, xcmsSet is quite deprecated, without any recent developments and in case we find issues with it, we are rather going to remove it than to fix it. So we encourage you to look at the newer classes and functions in the vignette.

Back to your issue, this looks like something with parallelisation, so first check would be to disable that:
xset <- xcmsSet(files=files, mzdiff=0.2, fwhm=5, step=0.1, snthresh=5, BPPARAM=SerialParam())

If that fixes things, you need to check your BiocParallel installation.

Yours, Steffen

@AndreasReinecke
Copy link
Author

Thanks Steffen! ..., BPPARAM=SerialParam() ) helped. But instead I get "invalid class “xcmsPeaks” object: superclass "mMatrix" not defined in the environment of the object's class".
The BiocParallel installation is 1.36.0.
I admit that I am - although quite experienced with GC-MS - new to processing the data with R. Sorry for bothering.
Best wishes
andreas

@sneumann
Copy link
Owner

Hi, great, that identifies the parallelisation as underlying cause. If you need a speedup because you run large studies on the laptop, you'll need to troubleshoot the BiocParallel stuff.

Please search the issues here about the Matrix issue, iirc you need a newer Matrix package.

Yours,
Steffen

@jorainer
Copy link
Collaborator

Note: the Matrix error/issue seems to get fixed by a re-installation of the Matrix and xcms packages from source:

BiocManager::install(c("Matrix", "xcms"), type = "source", force = TRUE)

at least that fixed this error in issue #733

@AndreasReinecke
Copy link
Author

Hi, thanks for the hint!
Unfortunately it didn't resolve my issue.
When executing the forced installation the error message further down was displayed. Could this be related to R-Studio using a 'User Library' and a 'System Library'?
In the meantime I used exactly the same script on a Windows PC with most the most recent R-Version installed and it worked fine. The issue therefore seems to be MAC specific.
Best wishes

  • installing source package ‘Matrix’ ...
    ** package ‘Matrix’ successfully unpacked and MD5 sums checked
    ** using staged installation
    ** libs
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    Warning in system(paste(MAKE, p1(paste("-f", shQuote(makefiles))), "compilers"), :
    running command 'make -f 'Makevars' -f '/Library/Frameworks/R.framework/Resources/etc/Makeconf' -f '/Library/Frameworks/R.framework/Resources/share/make/shlib.mk' compilers' had status 1
    sh: --version: command not found
    Warning in system2("xcrun", "--show-sdk-path", TRUE, TRUE) :
    running command ''xcrun' --show-sdk-path 2>&1' had status 1
    using SDK: ‘NA’
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    ERROR: compilation failed for package ‘Matrix’
  • removing ‘/Users/Andreas/Library/R/arm64/4.3/library/Matrix’
  • installing source package ‘xcms’ ...
    ** using staged installation
    ** libs
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    Warning in system(paste(MAKE, p1(paste("-f", shQuote(makefiles))), "compilers"), :
    running command 'make -f 'Makevars' -f '/Library/Frameworks/R.framework/Resources/etc/Makeconf' -f '/Library/Frameworks/R.framework/Resources/share/make/shlib.mk' compilers' had status 1
    sh: --version: command not found
    Error in if (nzchar(cxx)) { : argument is of length zero
  • removing ‘/Users/Andreas/Library/R/arm64/4.3/library/xcms’
  • restoring previous ‘/Users/Andreas/Library/R/arm64/4.3/library/xcms’

@jorainer
Copy link
Collaborator

the error you get here is because you have no compiler installed on your macOS - you would need to install the "command line tools" from apple. Maybe you can find some information on the official R page https://cloud.r-project.org/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants