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

Problems with install DADA2 in R version 4.1 #1404

Closed
Alejandra31pucv opened this issue Aug 31, 2021 · 18 comments
Closed

Problems with install DADA2 in R version 4.1 #1404

Alejandra31pucv opened this issue Aug 31, 2021 · 18 comments

Comments

@Alejandra31pucv
Copy link

I have problems intalling DADA2 in the latest version of R 4.1

Bioconductor version 3.13 (BiocManager 1.30.16), R 4.1.1 (2021-08-10)
Installation paths not writeable, unable to update packages
path: C:/Program Files/R/R-4.1.1/library
packages:
survival
Warning message:
package(s) not installed when version(s) same as current; use force = TRUE to re-install: 'dada2'

@benjjneb
Copy link
Owner

The warning message does not indicate a problem installing dada2, just that the same version of the package is already there, so it wasn't reinstalled.

If library(dada2); packageVersion("dada2") works, then you are good to go.

@CaraFiore
Copy link

Hello,
I am working with students who are trying to install dada2 with R 4.1 on their mac computers and having the same issue - however, when they try to load the library, it says "not found" so the dada2 package is not installed. We tried the notes for install issues that are linked on the dada2 tutorial but that is not working either.
Here is the code entered:
if (!requireNamespace("BiocManager", quietly = TRUE))

  • install.packages("BiocManager")
    

BiocManager::install("dada2")

Here is the installation output (it looks like it starts to install fine):

_'getOption("repos")' replaces Bioconductor standard repositories, see '?repositories' for
details

replacement repositories:
CRAN: https://cran.rstudio.com/

Bioconductor version 3.13 (BiocManager 1.30.16), R 4.1.1 (2021-08-10)
Installing package(s) 'dada2'
also installing the dependencies ‘Rsamtools’, ‘GenomicAlignments’, ‘Rhtslib’, ‘ShortRead’

Packages which are only available in source form, and may need compilation of
C/C++/Fortran: ‘Rsamtools’ ‘GenomicAlignments’ ‘Rhtslib’ ‘ShortRead’ ‘dada2’
Do you want to attempt to install these from sources? (Yes/no/cancel) yes
installing the source packages ‘Rsamtools’, ‘GenomicAlignments’, ‘Rhtslib’, ‘ShortRead’, ‘dada2’

trying URL 'https://bioconductor.org/packages/3.13/bioc/src/contrib/Rsamtools_2.8.0.tar.gz'
Content type 'application/x-gzip' length 2870315 bytes (2.7 MB)

downloaded 2.7 MB

trying URL 'https://bioconductor.org/packages/3.13/bioc/src/contrib/GenomicAlignments_1.28.0.tar.gz'
Content type 'application/x-gzip' length 2301182 bytes (2.2 MB)

downloaded 2.2 MB

trying URL 'https://bioconductor.org/packages/3.13/bioc/src/contrib/Rhtslib_1.24.0.tar.gz'
Content type 'application/x-gzip' length 1471711 bytes (1.4 MB)

downloaded 1.4 MB

trying URL 'https://bioconductor.org/packages/3.13/bioc/src/contrib/ShortRead_1.50.0.tar.gz'
Content type 'application/x-gzip' length 5184732 bytes (4.9 MB)

downloaded 4.9 MB

trying URL 'https://bioconductor.org/packages/3.13/bioc/src/contrib/dada2_1.20.0.tar.gz'
Content type 'application/x-gzip' length 2871808 bytes (2.7 MB)

downloaded 2.7 MB

  • installing source package ‘Rhtslib’ ...
    ** using non-staged installation via StagedInstall field
    ** libs
    cd "htslib-1.7" && make -f "/Library/Frameworks/R.framework/Resources/etc/Makeconf" -f "Makefile.Rhtslib"
    Makefile.Rhtslib:128: warning: overriding commands for target .c.o' /Library/Frameworks/R.framework/Resources/etc/Makeconf:168: warning: ignoring old commands for target .c.o'
    clang -arch arm64 -falign-functions=64 -Wall -g -O2 -fpic -I. -I/opt/R/arm64/include -D_FILE_OFFSET_BITS=64 -c -o kfunc.o kfunc.c
    clang -arch arm64 -falign-functions=64 -Wall -g -O2 -fpic -I. -I/opt/R/arm64/include -D_FILE_OFFSET_BITS=64 -c -o knetfile.o knetfile.c
    clang -arch arm64 -falign-functions=64 -Wall -g -O2 -fpic -I. -I/opt/R/arm64/include -D_FILE_OFFSET_BITS=64 -c -o kstring.o kstring.c
    clang -arch arm64 -falign-functions=64 -Wall -g -O2 -fpic -I. -I/opt/R/arm64/include -D_FILE_OFFSET_BITS=64 -c -o bcf_sr_sort.o bcf_sr_sort.c
    clang -arch arm64 -falign-functions=64 -Wall -g -O2 -fpic -I. -I/opt/R/arm64/include -D_FILE_OFFSET_BITS=64 -c -o bgzf.o bgzf.c
    clang -arch arm64 -falign-functions=64 -Wall -g -O2 -fpic -I. -I/opt/R/arm64/include -D_FILE_OFFSET_BITS=64 -c -o errmod.o errmod.c
    clang -arch arm64 -falign-functions=64 -Wall -g -O2 -fpic -I. -I/opt/R/arm64/include -D_FILE_OFFSET_BITS=64 -c -o faidx.o faidx.c
    clang -arch arm64 -falign-functions=64 -Wall -g -O2 -fpic -I. -I/opt/R/arm64/include -D_FILE_OFFSET_BITS=64 -c -o hfile.o hfile.c
    clang -arch arm64 -falign-functions=64 -Wall -g -O2 -fpic -I. -I/opt/R/arm64/include -D_FILE_OFFSET_BITS=64 -c -o hfile_net.o hfile_net.c
    echo '#define HTS_VERSION "1.7"' > version.h
    clang -arch arm64 -falign-functions=64 -Wall -g -O2 -fpic -I. -I/opt/R/arm64/include -D_FILE_OFFSET_BITS=64 -c -o hts.o hts.c
    clang -arch arm64 -falign-functions=64 -Wall -g -O2 -fpic -I. -I/opt/R/arm64/include -D_FILE_OFFSET_BITS=64 -c -o hts_os.o hts_os.c
    clang -arch arm64 -falign-functions=64 -Wall -g -O2 -fpic -I. -I/opt/R/arm64/include -D_FILE_OFFSET_BITS=64 -c -o md5.o md5.c
    clang -arch arm64 -falign-functions=64 -Wall -g -O2 -fpic -I. -I/opt/R/arm64/include -D_FILE_OFFSET_BITS=64 -c -o multipart.o multipart.c
    clang -arch arm64 -falign-functions=64 -Wall -g -O2 -fpic -I. -I/opt/R/arm64/include -D_FILE_OFFSET_BITS=64 -c -o probaln.o probaln.c
    clang -arch arm64 -falign-functions=64 -Wall -g -O2 -fpic -I. -I/opt/R/arm64/include -D_FILE_OFFSET_BITS=64 -c -o realn.o realn.c
    clang -arch arm64 -falign-functions=64 -Wall -g -O2 -fpic -I. -I/opt/R/arm64/include -D_FILE_OFFSET_BITS=64 -c -o regidx.o regidx.c
    clang -arch arm64 -falign-functions=64 -Wall -g -O2 -fpic -I. -I/opt/R/arm64/include -D_FILE_OFFSET_BITS=64 -c -o sam.o sam.c
    clang -arch arm64 -falign-functions=64 -Wall -g -O2 -fpic -I. -I/opt/R/arm64/include -D_FILE_OFFSET_BITS=64 -c -o synced_bcf_reader.o synced_bcf_reader.c
    clang -arch arm64 -falign-functions=64 -Wall -g -O2 -fpic -I. -I/opt/R/arm64/include -D_FILE_OFFSET_BITS=64 -c -o vcf_sweep.o vcf_sweep.c
    clang -arch arm64 -falign-functions=64 -Wall -g -O2 -fpic -I. -I/opt/R/arm64/include -D_FILE_OFFSET_BITS=64 -c -o tbx.o tbx.c
    clang -arch arm64 -falign-functions=64 -Wall -g -O2 -fpic -I. -I/opt/R/arm64/include -D_FILE_OFFSET_BITS=64 -c -o textutils.o textutils.c
    clang -arch arm64 -falign-functions=64 -Wall -g -O2 -fpic -I. -I/opt/R/arm64/include -D_FILE_OFFSET_BITS=64 -c -o thread_pool.o thread_pool.c
    clang -arch arm64 -falign-functions=64 -Wall -g -O2 -fpic -I. -I/opt/R/arm64/include -D_FILE_OFFSET_BITS=64 -c -o vcf.o vcf.c
    clang -arch arm64 -falign-functions=64 -Wall -g -O2 -fpic -I. -I/opt/R/arm64/include -D_FILE_OFFSET_BITS=64 -c -o vcfutils.o vcfutils.c
    clang -arch arm64 -falign-functions=64 -Wall -g -O2 -fpic -I. -I/opt/R/arm64/include -D_FILE_OFFSET_BITS=64 -c -o cram/cram_codecs.o cram/cram_codecs.c
    clang -arch arm64 -falign-functions=64 -Wall -g -O2 -fpic -I. -I/opt/R/arm64/include -D_FILE_OFFSET_BITS=64 -c -o cram/cram_decode.o cram/cram_decode.c
    clang -arch arm64 -falign-functions=64 -Wall -g -O2 -fpic -I. -I/opt/R/arm64/include -D_FILE_OFFSET_BITS=64 -c -o cram/cram_encode.o cram/cram_encode.c
    clang -arch arm64 -falign-functions=64 -Wall -g -O2 -fpic -I. -I/opt/R/arm64/include -D_FILE_OFFSET_BITS=64 -c -o cram/cram_external.o cram/cram_external.c
    clang -arch arm64 -falign-functions=64 -Wall -g -O2 -fpic -I. -I/opt/R/arm64/include -D_FILE_OFFSET_BITS=64 -c -o cram/cram_index.o cram/cram_index.c
    clang -arch arm64 -falign-functions=64 -Wall -g -O2 -fpic -I. -I/opt/R/arm64/include -D_FILE_OFFSET_BITS=64 -c -o cram/cram_io.o cram/cram_io.c
    cram/cram_io.c:61:10: fatal error: 'lzma.h' file not found
    #include <lzma.h>
    ^~~~~~~~
    1 error generated.
    make[1]: *** [cram/cram_io.o] Error 1
    make: *** [htslib] Error 2
    ERROR: compilation failed for package ‘Rhtslib’
  • removing ‘/Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/Rhtslib’
    ERROR: dependency ‘Rhtslib’ is not available for package ‘Rsamtools’
  • removing ‘/Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/Rsamtools’
    ERROR: dependency ‘Rsamtools’ is not available for package ‘GenomicAlignments’
  • removing ‘/Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/GenomicAlignments’
    ERROR: dependencies ‘Rsamtools’, ‘GenomicAlignments’, ‘Rhtslib’ are not available for package ‘ShortRead’
  • removing ‘/Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/ShortRead’
    ERROR: dependency ‘ShortRead’ is not available for package ‘dada2’
  • removing ‘/Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/dada2’

The downloaded source packages are in
‘/private/var/folders/tc/292_d7rn4b77n2ky2cfyd3lh0000gn/T/RtmpRKowar/downloaded_packages’
Old packages: 'mgcv'
Update all/some/none? [a/s/n]:
a
Warning: unable to access index for repository https://bioconductor.org/packages/3.13/bioc/bin/macosx/big-sur-arm64/contrib/4.1:
cannot open URL 'https://bioconductor.org/packages/3.13/bioc/bin/macosx/big-sur-arm64/contrib/4.1/PACKAGES'
Warning: unable to access index for repository https://bioconductor.org/packages/3.13/data/annotation/bin/macosx/big-sur-arm64/contrib/4.1:
cannot open URL 'https://bioconductor.org/packages/3.13/data/annotation/bin/macosx/big-sur-arm64/contrib/4.1/PACKAGES'
Warning: unable to access index for repository https://bioconductor.org/packages/3.13/data/experiment/bin/macosx/big-sur-arm64/contrib/4.1:
cannot open URL 'https://bioconductor.org/packages/3.13/data/experiment/bin/macosx/big-sur-arm64/contrib/4.1/PACKAGES'
Warning: unable to access index for repository https://bioconductor.org/packages/3.13/workflows/bin/macosx/big-sur-arm64/contrib/4.1:
cannot open URL 'https://bioconductor.org/packages/3.13/workflows/bin/macosx/big-sur-arm64/contrib/4.1/PACKAGES'
Warning: unable to access index for repository https://bioconductor.org/packages/3.13/books/bin/macosx/big-sur-arm64/contrib/4.1:
cannot open URL 'https://bioconductor.org/packages/3.13/books/bin/macosx/big-sur-arm64/contrib/4.1/PACKAGES'

There is a binary version available but the source version is later:
binary source needs_compilation
mgcv 1.8-36 1.8-37 TRUE

Do you want to install from sources the package which needs compilation? (Yes/no/cancel) yes
installing the source package ‘mgcv’

trying URL 'https://cran.rstudio.com/src/contrib/mgcv_1.8-37.tar.gz'
Content type 'application/x-gzip' length 1175506 bytes (1.1 MB)

downloaded 1.1 MB

  • installing source package ‘mgcv’ ...
    ** package ‘mgcv’ successfully unpacked and MD5 sums checked
    ** using staged installation
    ** libs
    clang -arch arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c coxph.c -o coxph.o
    clang -arch arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c davies.c -o davies.o
    clang -arch arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c discrete.c -o discrete.o
    clang -arch arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c gdi.c -o gdi.o
    clang -arch arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c init.c -o init.o
    clang -arch arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c magic.c -o magic.o
    clang -arch arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c mat.c -o mat.o
    clang -arch arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c matrix.c -o matrix.o
    clang -arch arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c mgcv.c -o mgcv.o
    clang -arch arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c misc.c -o misc.o
    clang -arch arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c mvn.c -o mvn.o
    clang -arch arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c qp.c -o qp.o
    clang -arch arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c soap.c -o soap.o
    clang -arch arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c sparse-smooth.c -o sparse-smooth.o
    clang -arch arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c sparse.c -o sparse.o
    clang -arch arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c tprs.c -o tprs.o
    clang -arch arm64 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/opt/R/arm64/lib -o mgcv.so coxph.o davies.o discrete.o gdi.o init.o magic.o mat.o matrix.o mgcv.o misc.o mvn.o qp.o soap.o sparse-smooth.o sparse.o tprs.o -L/Library/Frameworks/R.framework/Resources/lib -lRlapack -L/Library/Frameworks/R.framework/Resources/lib -lRblas -L/opt/R/arm64/gfortran/lib/gcc/aarch64-apple-darwin20.2.0/11.0.0 -L/opt/R/arm64/gfortran/lib -lgfortran -lemutls_w -lm -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
    ld: warning: directory not found for option '-L/opt/R/arm64/gfortran/lib/gcc/aarch64-apple-darwin20.2.0/11.0.0'
    ld: warning: directory not found for option '-L/opt/R/arm64/gfortran/lib'
    ld: library not found for -lgfortran
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    make: *** [mgcv.so] Error 1
    ERROR: compilation failed for package ‘mgcv’
  • removing ‘/Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/mgcv’
  • restoring previous ‘/Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/mgcv’

The downloaded source packages are in
‘/private/var/folders/tc/292_d7rn4b77n2ky2cfyd3lh0000gn/T/RtmpRKowar/downloaded_packages’
There were 11 warnings (use warnings() to see them)

#Test the installation:

library(dada2)
Error in library(dada2) : there is no package called ‘dada2’_

Also, when we tried the install option for if you run into dependency issues (https://benjjneb.github.io/dada2/dada-installation.html), we got the following message (including if we use the updated short read for R 4.1 - we only tried this for ShortRead):

_ERROR: dependency ‘ShortRead’ is not available for package ‘dada2’

  • removing ‘/Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/dada2’
    Warning messages:
    1: In i.p(...) :
    installation of package ‘Rhtslib’ had non-zero exit status
    2: In i.p(...) :
    installation of package ‘Rsamtools’ had non-zero exit status
    3: In i.p(...) :
    installation of package ‘GenomicAlignments’ had non-zero exit status
    4: In i.p(...) :
    installation of package ‘ShortRead’ had non-zero exit status
    5: In i.p(...) :
    installation of package ‘/var/folders/tc/292_d7rn4b77n2ky2cfyd3lh0000gn/T//RtmpRKowar/file5aef2c4e811c/dada2_1.21.0.tar.gz’ had non-zero exit status_

Any insight is appreciated and thank you for your time.

@benjjneb
Copy link
Owner

Please see the answer/solution for this issue on the Bioconductor forum: https://support.bioconductor.org/p/9137290/

Short version, for the time being using Bioconductor/R via Rosetta emulation mode on M1 Macs will be easier to manage.

@cjfields
Copy link

cjfields commented Oct 12, 2021

EDIT: See also issue #1375

Just a note for the adventurous types trying to compile dada2 native M1, you can get part of the way there by installing the M1-compiled dependencies here: https://mac.r-project.org/libs-arm64/ (see the instructions at the bottom of that page for downloading and installing). You need (minimally) gfortran and xz to get Rsamtools and ShortRead installed.

However, currently dada2 still fails from a core library, which may be harder to overcome as it appears to be pulled in from Rmain.cpp (see #error this header is for x86 only below):

> BiocManager::install('dada2')
'getOption("repos")' replaces Bioconductor standard repositories, see '?repositories' for details

replacement repositories:
    CRAN: https://cran.rstudio.com/

Bioconductor version 3.13 (BiocManager 1.30.16), R 4.1.1 (2021-08-10)
Installing package(s) 'dada2'
Package which is only available in source form, and may need compilation of C/C++/Fortran: ‘dada2’
Do you want to attempt to install these from sources? (Yes/no/cancel) Yes
installing the source package ‘dada2’

trying URL 'https://bioconductor.org/packages/3.13/bioc/src/contrib/dada2_1.20.0.tar.gz'
Content type 'application/x-gzip' length 2871808 bytes (2.7 MB)
==================================================
downloaded 2.7 MB

* installing *source* package ‘dada2’ ...
** using staged installation
** libs
clang++ -arch arm64 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG  -I'/Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/Rcpp/include' -I'/Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/RcppParallel/include' -I/opt/R/arm64/include   -fPIC  -falign-functions=64 -Wall -g -O2  -c RcppExports.cpp -o RcppExports.o
In file included from RcppExports.cpp:4:
In file included from ./../inst/include/dada2.h:7:
./../inst/include/dada2_RcppExports.h:14:14: warning: unused function 'validateSignature' [-Wunused-function]
        void validateSignature(const char* sig) {
             ^
1 warning generated.
clang++ -arch arm64 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG  -I'/Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/Rcpp/include' -I'/Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/RcppParallel/include' -I/opt/R/arm64/include   -fPIC  -falign-functions=64 -Wall -g -O2  -c Rmain.cpp -o Rmain.o
In file included from Rmain.cpp:7:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/13.0.0/include/cpuid.h:14:2: error: this header is for x86 only
#error this header is for x86 only
 ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/13.0.0/include/cpuid.h:286:5: error: invalid output constraint '=a' in asm
    __cpuid(__leaf, __eax, __ebx, __ecx, __edx);
    ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/13.0.0/include/cpuid.h:251:11: note: expanded from macro '__cpuid'
        : "=a"(__eax), "=r" (__ebx), "=c"(__ecx), "=d"(__edx) \
          ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/13.0.0/include/cpuid.h:301:5: error: invalid output constraint '=a' in asm
    __cpuid(__leaf, *__eax, *__ebx, *__ecx, *__edx);
    ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/13.0.0/include/cpuid.h:251:11: note: expanded from macro '__cpuid'
        : "=a"(__eax), "=r" (__ebx), "=c"(__ecx), "=d"(__edx) \
          ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/13.0.0/include/cpuid.h:315:5: error: invalid output constraint '=a' in asm
    __cpuid_count(__leaf, __subleaf, *__eax, *__ebx, *__ecx, *__edx);
    ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/13.0.0/include/cpuid.h:258:11: note: expanded from macro '__cpuid_count'
        : "=a"(__eax), "=r" (__ebx), "=c"(__ecx), "=d"(__edx) \
          ^
Rmain.cpp:9:3: error: invalid output constraint '=a' in asm
  __cpuid_count(InfoType, 0, info[0], info[1], info[2], info[3]);
  ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/13.0.0/include/cpuid.h:258:11: note: expanded from macro '__cpuid_count'
        : "=a"(__eax), "=r" (__ebx), "=c"(__ecx), "=d"(__edx) \
          ^
5 errors generated.
make: *** [Rmain.o] Error 1
ERROR: compilation failed for package ‘dada2’
* removing ‘/Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/dada2’

The downloaded source packages are in
	‘/private/var/folders/ww/w72_l7wx16z1yrlx9s_4bzxc0000gn/T/RtmpHQVsDB/downloaded_packages’
Warning messages:
1: In .inet_warning(msg) :
  unable to access index for repository https://bioconductor.org/packages/3.13/bioc/bin/macosx/big-sur-arm64/contrib/4.1:
  cannot open URL 'https://bioconductor.org/packages/3.13/bioc/bin/macosx/big-sur-arm64/contrib/4.1/PACKAGES'
2: In .inet_warning(msg) :
  unable to access index for repository https://bioconductor.org/packages/3.13/data/annotation/bin/macosx/big-sur-arm64/contrib/4.1:
  cannot open URL 'https://bioconductor.org/packages/3.13/data/annotation/bin/macosx/big-sur-arm64/contrib/4.1/PACKAGES'
3: In .inet_warning(msg) :
  unable to access index for repository https://bioconductor.org/packages/3.13/data/experiment/bin/macosx/big-sur-arm64/contrib/4.1:
  cannot open URL 'https://bioconductor.org/packages/3.13/data/experiment/bin/macosx/big-sur-arm64/contrib/4.1/PACKAGES'
4: In .inet_warning(msg) :
  unable to access index for repository https://bioconductor.org/packages/3.13/workflows/bin/macosx/big-sur-arm64/contrib/4.1:
  cannot open URL 'https://bioconductor.org/packages/3.13/workflows/bin/macosx/big-sur-arm64/contrib/4.1/PACKAGES'
5: In .inet_warning(msg) :
  unable to access index for repository https://bioconductor.org/packages/3.13/books/bin/macosx/big-sur-arm64/contrib/4.1:
  cannot open URL 'https://bioconductor.org/packages/3.13/books/bin/macosx/big-sur-arm64/contrib/4.1/PACKAGES'
6: In .inet_warning(msg) :
  installation of package ‘dada2’ had non-zero exit status

@GiulianoColosimo
Copy link

I am having the exact same issue as @cjfields
Some posts suggest to go back to an R installation specific for NON-arm64 processors and use Rosetta emulators. Not sure if I want to go that way. Does anyone know how if/when/how this issue could/will be solved?

@benjjneb
Copy link
Owner

@GiulianoColosimo Thanks for the ping on this. I am now in possession of an M1 Macbook Pro, so this is something I should revisit. All the x86 specific vectorized code is contained and can be bypassed by a simple flag, so a fix should be straightforward I think. In fact this pull request #1147 may already do the trick, I just hadn't been able to test it on an ARM system until recently.

@GiulianoColosimo
Copy link

@benjjneb Thanks for getting back on this. I have looked at the pull request you mentioned. Using the see2neon solution seems a little above my pay grade, but I am ready to go that way if I cannot have dada2 work. I am running on a MBPro with M1 Pro. Just a little afraid of doing something I do not completely understand eheh.

@wolfganghuber
Copy link

wolfganghuber commented Apr 26, 2022

Hi, I'm having the same problem while trying to install dada2 on my ARM64 Macbook, found this thread via Google, and am wondering whether the problem has already been resolved?
I'm using dada2_1.23.0.tar.gz from http://bioconductor.org/packages/devel/bioc/html/dada2.html and R version 4.2.0 aarch64-apple-darwin20 (64-bit) running under macOS Monterey 12.3.1. I'm trying the build the MSMB book with Susan, hundreds of other CRAN and Bioconductor packages have been installed, dada2 is the last one that is missing...

clang++ -arch arm64 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG  -I'/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/Rcpp/include' -I'/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/RcppParallel/include' -I/opt/R/arm64/include   -fPIC  -falign-functions=64 -Wall -g -O2  -c Rmain.cpp -o Rmain.o
In file included from Rmain.cpp:7:
/Library/Developer/CommandLineTools/usr/lib/clang/13.1.6/include/cpuid.h:14:2: error: this header is for x86 only
#error this header is for x86 only

@benjjneb
Copy link
Owner

benjjneb commented May 5, 2022

@wolfganghuber Sorry for slow response. No this isn't solved yet. I do now have a working branch on my new M1 Mac, largely based on the previous PR by @terjekv: #1147

I'm still in the process of transferring my "working environment" over to my new M1 mac, but right now I anticipate getting this pushed up to the devel branch in the next week or two.

@Cecilia-Wang
Copy link

Cecilia-Wang commented Jul 31, 2022

Hi there,

I have been able to install most R packages (under R version 4.2.1) I need with the M1 MB pro, except for dada2.
I was just wondering if there is any update.

@benjjneb
Copy link
Owner

benjjneb commented Aug 1, 2022

Sorry for this being delayed. This fix will be in (to natively compile on arm64 architectures like the M1) in the next release of dada2 this Fall. (And hopefully much sooner on the devel branch)

@benjjneb
Copy link
Owner

benjjneb commented Nov 3, 2022

Quick update, the latest release (package version 1.26, in Bioconductor 1.16) now supports ARM architectures.

Github release link: https://github.com/benjjneb/dada2/releases/tag/v1.26

BioC release link: https://bioconductor.org/packages/release/bioc/html/dada2.html

@cjfields
Copy link

cjfields commented Nov 3, 2022

I'll give it a try, thanks @benjjneb !

@wolfganghuber
Copy link

wolfganghuber commented Nov 21, 2022 via email

@cwbeltz
Copy link

cwbeltz commented Dec 3, 2022

Thank you for the work on this @benjjneb ! I've been keeping an eye out for this and looking forward to using it on some re-analysis.

@cjfields
Copy link

cjfields commented Dec 4, 2022

This installed without issue, thanks @benjjneb

@luigallucci
Copy link

@benjjneb I'm trying to install dada2 with last version of Bioconductor on my new mac, but it fail to complete the installation of different dependencies.

In file included from RcppEigen.cpp:22:
In file included from ../inst/include/RcppEigen.h:25:
In file included from ../inst/include/RcppEigenForward.h:37:
In file included from ../inst/include/unsupported/Eigen/SparseExtra:51:
../inst/include/Eigen/src/Core/util/ReenableStupidWarnings.h:14:33: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
   14 |     #pragma clang diagnostic pop
      |                                 ^
17 warnings and 1 error generated.
make: *** [/Users/lgallucc/miniforge3/envs/downstream/lib/R/etc/Makeconf:200: RcppEigen.o] Error 1
ERROR: compilation failed for package ‘RcppEigen’
* removing ‘/Users/lgallucc/miniforge3/envs/downstream/lib/R/library/RcppEigen’
ERROR: dependency ‘RcppEigen’ is not available for package ‘interp’
* removing ‘/Users/lgallucc/miniforge3/envs/downstream/lib/R/library/interp’
ERROR: dependency ‘interp’ is not available for package ‘latticeExtra’
* removing ‘/Users/lgallucc/miniforge3/envs/downstream/lib/R/library/latticeExtra’
ERROR: dependency ‘latticeExtra’ is not available for package ‘ShortRead’
* removing ‘/Users/lgallucc/miniforge3/envs/downstream/lib/R/library/ShortRead’
ERROR: dependency ‘ShortRead’ is not available for package ‘dada2’
* removing ‘/Users/lgallucc/miniforge3/envs/downstream/lib/R/library/dada2’

I pacchetti scaricati con il codice sorgente sono in
	‘/private/var/folders/pk/vwt_djyd69z9cf72qw4shc_m0000gq/T/RtmpGZEvcf/downloaded_packages’
Aggiornamento indice HTML dei pacchetti in '.Library'
Making 'packages.html' ... fatto
Messaggi di avvertimento:
1: In install.packages(...) :
  l'installazione del pacchetto ‘RcppEigen’ ha uno stato di uscita non-zero
2: In install.packages(...) :
  l'installazione del pacchetto ‘interp’ ha uno stato di uscita non-zero
3: In install.packages(...) :
  l'installazione del pacchetto ‘latticeExtra’ ha uno stato di uscita non-zero
4: In install.packages(...) :
  l'installazione del pacchetto ‘ShortRead’ ha uno stato di uscita non-zero
5: In install.packages(...) :
  l'installazione del pacchetto ‘dada2’ ha uno stato di uscita non-zero

Suggestion? It's first time working on a Mac, I always used a ubuntu computer.

@benjjneb
Copy link
Owner

@luisymbio Since this is not being caused by dada2, but rather by the failed dependency RcppEigen, I would recommend trying the Bioconductor support site: https://support.bioconductor.org/

I don't have anything intelligent to say about why RcppEigen is failing.

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

9 participants