theislab / destiny

R package for single cell and other data analysis using diffusion maps
https://theislab.github.io/destiny/
GNU General Public License v3.0
69 stars 12 forks source link

Bioc install failure on Mac OSX Catalina #44

Open MikeDMorgan opened 3 years ago

MikeDMorgan commented 3 years ago

Hi @flying-sheep I am currently attempting to install destiny from Bioconductor in R 4.0.3 (Bioc 3.12). The destiny package is only available in source form (I see destiny is failing on the Bioconductor page). Attempts to install are met with the following compilation error:

> BiocManager::install("destiny")
Bioconductor version 3.12 (BiocManager 1.30.10), R 4.0.3 (2020-10-10)
Installing package(s) 'destiny'
Package which is only available in source form, and may need compilation of C/C++/Fortran: ‘destiny’
Do you want to attempt to install these from sources? (Yes/no/cancel) Yes
installing the source package ‘destiny’

trying URL 'https://bioconductor.org/packages/3.12/bioc/src/contrib/destiny_3.4.0.tar.gz'
Content type 'application/x-gzip' length 8955233 bytes (8.5 MB)
==================================================
downloaded 8.5 MB

* installing *source* package ‘destiny’ ...
** using staged installation
** libs
/usr/local/clang4/bin/clang++  -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG  -I'/Users/morgan02/Library/R/4.0/library/Rcpp/include' -I'/Users/morgan02/Library/R/4.0/library/RcppEigen/include' -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/grDevices/include' -I/usr/local/include  -ggdb -fPIC  XXFLAGS -c RcppExports.cpp -o RcppExports.o
clang-4.0: error: no such file or directory: 'XXFLAGS'
make: *** [RcppExports.o] Error 1
ERROR: compilation failed for package ‘destiny’
* removing ‘/Users/morgan02/Library/R/4.0/library/destiny’

The downloaded source packages are in
    ‘/private/var/folders/lf/cjtf6ppx32b28hyzg6dgfnw1h6d7q3/T/RtmpqUYM7L/downloaded_packages’
Warning message:
In install.packages(...) :
  installation of package ‘destiny’ had non-zero exit status

I have tried to set XXFLAGS in my R Makevars file, according to guidance for compiling R on Mac OSX Catalina:

# The following statements are required to use the clang4 binary
CC=/usr/local/clang4/bin/clang -isysroot  /Library/Developer/CommandLineTools/SDKs/MacOSX10.16.sdk
CXX=/usr/local/clang4/bin/clang++
CXX1X=/usr/local/clang4/bin/clang++ 
CXX98=/usr/local/clang4/bin/clang++
CXX11=/usr/local/clang4/bin/clang++ 
CXX14=/usr/local/clang4/bin/clang++
CXX17=/usr/local/clang4/bin/clang++
LDFLAGS=-L/usr/local/clang4/lib -isysroot  /Library/Developer/CommandLineTools/SDKs/MacOSX10.16.sdk
CFLAGS = -g -O2 -Wall -pedantic -Wconversion -Wno-sign-conversion
CXXFLAGS = -g -O2 -Wall -pedantic -Wconversion -Wno-sign-conversion
CXX11FLAGS = $CXXFLAGS
CXX14FLAGS = $CXXFLAGS
CXX17FLAGS = $CXXFLAGS
XXFLAGS = $CXXFLAGS
# End clang4 inclusion statements

My sessionInfo:

> sessionInfo()
R version 4.0.3 (2020-10-10)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Catalina 10.15.7

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib

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

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

loaded via a namespace (and not attached):
[1] BiocManager_1.30.10 compiler_4.0.3      tools_4.0.3  

Do you know if there is an adjustment to Makevars that might fix this, or is destiny now fundamentally incompatible with Mac OSX??

flying-sheep commented 3 years ago

Uugh, the build there is failing because they changed their TeX environment again.

About your error: The relevant part of the clang++ command line is -ggdb -fPIC XXFLAGS

It contains the -ggdb from my Makevars file: https://github.com/theislab/destiny/blob/28307e9d5dd755a79a84c2f9049cdd4a2112eacb/src/Makevars

And also inexplicably just specifies XXFLAGS… not as a -option or anything, just as an argument.

I assume something is doing something hacky which breaks when I specify PKG_CXXFLAGS.

Can you try compiling it with the makevars file removed/commented out? I’m open to change it if it makes peoples’ lives easier.

MikeDMorgan commented 3 years ago

Thanks. I cloned the master branch and I have tried commenting out both lines, and combinations of the two lines in both my .R/Makevars, and the one in destiny/src/Makevars. In all situations I receive the same error:

> devtools::install("~/src/destiny")
These packages have more recent versions available.
It is recommended to update all of them.
Which would you like to update?

 1: All                                   
 2: CRAN packages only                    
 3: None                                  
 4: cpp11        (0.2.5  -> 0.2.6 ) [CRAN]
 5: crayon       (1.3.4  -> 1.4.0 ) [CRAN]
 6: cli          (2.2.0  -> 2.3.0 ) [CRAN]
 7: matrixStats  (0.57.0 -> 0.58.0) [CRAN]
 8: tibble       (3.0.5  -> 3.0.6 ) [CRAN]
 9: broom        (0.7.3  -> 0.7.4 ) [CRAN]
10: MatrixGen... (1.2.0  -> 1.2.1 ) [CRAN]

Enter one or more numbers, or an empty line to skip updates:
✓  checking for file ‘/Users/morgan02/src/destiny/DESCRIPTION’ (341ms)
─  preparing ‘destiny’: (447ms)
✓  checking DESCRIPTION meta-information ...
─  cleaning src
─  checking for LF line-endings in source and make files and shell scripts
─  checking for empty or unneeded directories
─  looking to see if a ‘data/datalist’ file should be added
─  building ‘destiny_3.1.1.tar.gz’
   Warning: invalid uid value replaced by that for user 'nobody'
   Warning: invalid gid value replaced by that for user 'nobody'

Running /Library/Frameworks/R.framework/Resources/bin/R CMD INSTALL \
  /var/folders/lf/cjtf6ppx32b28hyzg6dgfnw1h6d7q3/T//RtmpqAFhm6/destiny_3.1.1.tar.gz \
  --install-tests 
* installing to library ‘/Users/morgan02/Library/R/4.0/library’
* installing *source* package ‘destiny’ ...
** using staged installation
** libs
/usr/local/clang4/bin/clang++  -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG  -I'/Users/morgan02/Library/R/4.0/library/Rcpp/include' -I'/Users/morgan02/Library/R/4.0/library/RcppEigen/include' -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/grDevices/include' -I/usr/local/include   -fPIC  XXFLAGS -c RcppExports.cpp -o RcppExports.o
clang-4.0: error: no such file or directory: 'XXFLAGS'
make: *** [RcppExports.o] Error 1
ERROR: compilation failed for package ‘destiny’
* removing ‘/Users/morgan02/Library/R/4.0/library/destiny’
Error in (function (command = NULL, args = character(), error_on_status = TRUE,  : 
  System command 'R' failed, exit status: 1, stdout & stderr were printed
Type .Last.error.trace to see where the error occured
francoiskroll commented 3 years ago

Did anyone find a solution to this? I seem to be stuck at the same spot, on macOS Big Sur. Thanks!

ajwilk commented 3 years ago

I'm also stuck at same spot, macOS Mojave. Thanks!

flying-sheep commented 3 years ago

Yeah, I still have no idea what causes the command line to be constructed that way. There’s two issues:

  1. Bioconductor changes the way PDFs are build sometimes and I don’t have the time to debug this. They used to build fine, now they don’t, so destiny is no longer available even though it itself builds fine
  2. The R build environment is a convoluted mess, and something on OSX causes the command line to be constructed with an out of place XXFLAGS. As Apple doesn’t provide a VM of their OS which devs can use, I don’t have a way to debug this.

if one of you figures out to fix one of the two, I’ll happily merge the PR