Package install not working for Shazam after outputting a bunch of GCC and G++ compiler commands (non-zero exit status)

I am trying to install The Shazam Package with install.packages("shazam") from the Immunoglobulin analysis Immcantation suite and it always gives me the following error, I have uninstalled and reinstalled multiple versions of R including 4.1 and 3.6 and it always ends the same way with the following error.

gcc -std=gnu99 -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o Matrix.so CHMfactor.o Csparse.o TMatrix_as.o Tsparse.o init.o Mutils.o chm_common.o cs.o cs_utils.o dense.o dgCMatrix.o dgTMatrix.o dgeMatrix.o dpoMatrix.o dppMatrix.o dsCMatrix.o dsyMatrix.o dspMatrix.o dtCMatrix.o dtTMatrix.o dtrMatrix.o dtpMatrix.o factorizations.o ldense.o lgCMatrix.o sparseQR.o abIndex.o CHOLMOD.a COLAMD.a AMD.a SuiteSparse_config.a -llapack -lblas -lgfortran -lm -lquadmath -L/usr/lib/R/lib -lR
/usr/bin/ld: cannot find -llapack
/usr/bin/ld: cannot find -lblas
/usr/bin/ld: cannot find -lgfortran
collect2: error: ld returned 1 exit status
make: *** [/usr/share/R/share/make/shlib.mk:6: Matrix.so] Error 1
ERROR: compilation failed for package ‘Matrix’
* removing ‘/home/ubuntu/R/x86_64-pc-linux-gnu-library/3.6/Matrix’
* installing *source* package ‘KernSmooth’ ...
** package ‘KernSmooth’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
gfortran -fno-optimize-sibling-calls  -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-jbaK_j/r-base-3.6.3=. -fstack-protector-strong  -c blkest.f -o blkest.o
/bin/bash: gfortran: command not found
make: *** [/usr/lib/R/etc/Makeconf:191: blkest.o] Error 127
ERROR: compilation failed for package ‘KernSmooth’
* removing ‘/home/ubuntu/R/x86_64-pc-linux-gnu-library/3.6/KernSmooth’
ERROR: dependencies ‘Biostrings’, ‘GenomicAlignments’, ‘IRanges’, ‘Matrix’ are not available for package ‘alakazam’
* removing ‘/home/ubuntu/R/x86_64-pc-linux-gnu-library/3.6/alakazam’
ERROR: dependencies ‘alakazam’, ‘KernSmooth’ are not available for package ‘shazam’
* removing ‘/home/ubuntu/R/x86_64-pc-linux-gnu-library/3.6/shazam’

The downloaded source packages are in
	‘/tmp/RtmpOWmFn6/downloaded_packages’
Warning messages:
1: In install.packages("shazam") :
  installation of package ‘Matrix’ had non-zero exit status
2: In install.packages("shazam") :
  installation of package ‘KernSmooth’ had non-zero exit status
3: In install.packages("shazam") :
  installation of package ‘alakazam’ had non-zero exit status
4: In install.packages("shazam") :
  installation of package ‘shazam’ had non-zero exit status

The full errors and error codes and output is in the below pastebin.

How do I fix this? I am using Ubuntu 20.04.

Maybe you are missing system dependencies, try installing these ones

sudo apt install -y libicu-dev
sudo apt install -y libglpk-dev
sudo apt install -y libgmp3-dev
sudo apt install -y libxml2-dev
sudo apt install -y zlib1g-dev

Also, you could try to install a binary from RPM

install.packages("shazam", repos = 'https://packagemanager.rstudio.com/all/__linux__/focal/latest')
2 Likes

You seem to be missing some crucial development packages. I assume you are using R either from the Ubuntu repositories or from the CRAN repository. In that case

sudo apt install r-base-dev

should fix the issue at hand. Possible sources of binary packages:

I tried both your advice and the installation of the system dependencies from user andresrcs and i received the following errors, again with a non-zero exit status.

I'm really confused what to do from here since I installed all the dependencies I should've been using to my knowledge. Could it be a version conflict or something?

The original problem has been solved since there are no compiling errors, your problem now is that you are missing non CRAN package dependencies

ERROR: dependencies ‘Biostrings’, ‘GenomicAlignments’, ‘IRanges’ are not available for package ‘alakazam’

I think you need to install those from Bioconductor, for example


if (!requireNamespace("BiocManager", quietly = TRUE))
    install.packages("BiocManager")

BiocManager::install("GenomicAlignments")
2 Likes

The crucial error is this:

ERROR: dependencies ‘Biostrings’, ‘GenomicAlignments’, ‘IRanges’ are not available for package ‘alakazam’
* removing ‘/home/ubuntu/R/x86_64-pc-linux-gnu-library/4.1/alakazam’
ERROR: dependency ‘alakazam’ is not available for package ‘shazam’
* removing ‘/home/ubuntu/R/x86_64-pc-linux-gnu-library/4.1/shazam’

Looking at CRAN - Package alakazam one sees that alakazam does depend on these three packages which are part of BioConductor. Installation instructions: Bioconductor - Install

1 Like

The problem has been fixed now.

Apparently I was missing some CURL dependency for the compiler which was causing a fatal error when i tried to install the aforementioned dependencies.

Besides that, running R in sudo mode helped.

It gave me this error:

hfile_libcurl.c:45:10: fatal error: curl/curl.h: No such file or directory 45 | #include <curl/curl.h>

and to fix it i used the following command

sudo apt-get install libcurl4-openssl-dev

and then I went about using the BiocManager to install the rest of the missing dependencies before doing install.packages("alakazam") and install.packages("shazam").

Thanks for the help!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.