R package installation error
1
0
Entering edit mode
Jitendra ▴ 10
@nabiyogesh-11718
Last seen 15 hours ago
United Kingdom

Hi All,

I am having a issue in R packages installation on HPC. After loading R and lippng on HPC, it keeps showing the below error if I try to install any R packages from bioconductor; do you have any idea how to resolve this?

srun --pty --partition=k2-hipri --mem-per-cpu=10G bash 

module load R/4.1.0/gcc-9.3.0+lapack-3.9.0+blas-3.8.0 

module load libpng/16

Error;

*

* using staged installation

** libs

/opt/gridware/depots/54e7fb3c/el7/pkg/compilers/gcc/9.3.0/bin/gcc -I"/opt/gridware/depots/54e7fb3c/el7/pkg/apps/R/4.1.3/gcc-9.3.0+lapack-3.9.0+blas-3.8.0/lib64/R/include" -DNDEBUG   -I/opt/gridware/depots/54e7fb3c/el7/pkg/compilers/gcc/9.3.0/include   `libpng-config --cflags` -fpic  -g -O2  -c read.c -o read.o

Package libpng was not found in the pkg-config search path.

Perhaps you should add the directory containing `libpng.pc'

to the PKG_CONFIG_PATH environment variable

No package 'libpng' found
HPC R Bioconducter • 2.0k views
ADD COMMENT
2
Entering edit mode
@james-w-macdonald-5106
Last seen 10 hours ago
United States

Try reversing the order of your module load commands.

ADD COMMENT
0
Entering edit mode

Hi James, Thanks but now getting another issue and followed by some more errors;

/opt/gridware/depots/54e7fb3c/el7/pkg/compilers/gcc/9.3.0/bin/g++ -std=gnu++11 -shared -L/opt/gridware/depots/54e7fb3c/el7/pkg/apps/R/4.1.3/gcc-9.3.0+lapack-3.9.0+blas-3.8.0/lib64/R/lib -L/opt/gridware/depots/54e7fb3c/el7/pkg/libs/blas/3.8.0/gcc-9.3.0 -L/opt/gridware/depots/54e7fb3c/el7/pkg/compilers/gcc/9.3.0/lib64 -o nloptr.so init_nloptr.o nloptr.o test-C-API.o test-runner.o -L/opt/gridware/depots/54e7fb3c/el7/pkg/apps/R/4.1.3/gcc-9.3.0+lapack-3.9.0+blas-3.8.0/lib64/R/lib -lRlapack -L/opt/gridware/depots/54e7fb3c/el7/pkg/apps/R/4.1.3/gcc-9.3.0+lapack-3.9.0+blas-3.8.0/lib64/R/lib -lRblas -lgfortran -lm -lquadmath -Lnlopt/lib -lnlopt -L/opt/gridware/depots/54e7fb3c/el7/pkg/apps/R/4.1.3/gcc-9.3.0+lapack-3.9.0+blas-3.8.0/lib64/R/lib -lR
/usr/bin/ld: cannot find -lnlopt
collect2: error: ld returned 1 exit status
make: *** [nloptr.so] Error 1
ERROR: compilation failed for package ‘nloptr’
* removing ‘/mnt/scratch2/users/3052771/R/lib/nloptr’
* installing *source* package ‘GenomicFeatures’ ...
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
Error: package or namespace load failed for ‘AnnotationDbi’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
 there is no package called ‘png’
Execution halted
ERROR: lazy loading failed for package ‘GenomicFeatures’
* removing ‘/mnt/scratch2/users/3052771/R/lib/GenomicFeatures’
* installing *source* package ‘genefilter’ ...
** using staged installation
** libs

Many thanks,

ADD REPLY
0
Entering edit mode

Try BiocManager::install("png")

ADD REPLY
0
Entering edit mode

Thanks Marcel, again getting error;

> BiocManager::install("png")
Bioconductor version 3.14 (BiocManager 1.30.16), R 4.1.3 (2022-03-10)
Installing package(s) 'png'
trying URL 'https://cloud.r-project.org/src/contrib/png_0.1-7.tar.gz'
Content type 'application/x-gzip' length 24990 bytes (24 KB)
==================================================
downloaded 24 KB

* installing *source* package ‘png’ ...
** package ‘png’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
/opt/gridware/depots/54e7fb3c/el7/pkg/compilers/gcc/9.3.0/bin/gcc -I"/opt/gridware/depots/54e7fb3c/el7/pkg/apps/R/4.1.3/gcc-9.3.0+lapack-3.9.0+blas-3.8.0/lib64/R/include" -DNDEBUG   -I/opt/gridware/depots/54e7fb3c/el7/pkg/compilers/gcc/9.3.0/include   `libpng-config --cflags` -fpic  -g -O2  -c read.c -o read.o
Package libpng was not found in the pkg-config search path.
Perhaps you should add the directory containing `libpng.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libpng' found
Package libpng was not found in the pkg-config search path.
Perhaps you should add the directory containing `libpng.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libpng' found
Package libpng was not found in the pkg-config search path.
Perhaps you should add the directory containing `libpng.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libpng' found
Package libpng was not found in the pkg-config search path.
Perhaps you should add the directory containing `libpng.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libpng' found
Package libpng was not found in the pkg-config search path.
Perhaps you should add the directory containing `libpng.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libpng' found
/opt/gridware/depots/54e7fb3c/el7/pkg/compilers/gcc/9.3.0/bin/gcc -I"/opt/gridware/depots/54e7fb3c/el7/pkg/apps/R/4.1.3/gcc-9.3.0+lapack-3.9.0+blas-3.8.0/lib64/R/include" -DNDEBUG   -I/opt/gridware/depots/54e7fb3c/el7/pkg/compilers/gcc/9.3.0/include   `libpng-config --cflags` -fpic  -g -O2  -c write.c -o write.o
Package libpng was not found in the pkg-config search path.

Many thanks

ADD REPLY
1
Entering edit mode

Is that after doing

module load libpng/16

Also, the error for missing -lnlopt means you don't have the NLopt headers. You might need to either have your sysadmin install NLopt, or install it yourself.

ADD REPLY
0
Entering edit mode

Yes James, after loading libpng/16. I am not sure how I can add it to my path;

Perhaps you should add the directory containing `libpng.pc'
to the PKG_CONFIG_PATH environment variable

Many thanks

ADD REPLY
0
Entering edit mode

If I try to install NLopt then also it shows error;

/opt/gridware/depots/54e7fb3c/el7/pkg/compilers/gcc/9.3.0/bin/g++ -std=gnu++11 -shared -L/opt/gridware/depots/54e7fb3c/el7/pkg/apps/R/4.1.3/gcc-9.3.0+lapack-3.9.0+blas-3.8.0/lib64/R/lib -L/opt/gridware/depots/54e7fb3c/el7/pkg/libs/blas/3.8.0/gcc-9.3.0 -L/opt/gridware/depots/54e7fb3c/el7/pkg/compilers/gcc/9.3.0/lib64 -o nloptr.so init_nloptr.o nloptr.o test-C-API.o test-runner.o -L/opt/gridware/depots/54e7fb3c/el7/pkg/apps/R/4.1.3/gcc-9.3.0+lapack-3.9.0+blas-3.8.0/lib64/R/lib -lRlapack -L/opt/gridware/depots/54e7fb3c/el7/pkg/apps/R/4.1.3/gcc-9.3.0+lapack-3.9.0+blas-3.8.0/lib64/R/lib -lRblas -lgfortran -lm -lquadmath -Lnlopt/lib -lnlopt -L/opt/gridware/depots/54e7fb3c/el7/pkg/apps/R/4.1.3/gcc-9.3.0+lapack-3.9.0+blas-3.8.0/lib64/R/lib -lR
/usr/bin/ld: cannot find -lnlopt
collect2: error: ld returned 1 exit status
make: *** [nloptr.so] Error 1
ERROR: compilation failed for package ‘nloptr’
* removing ‘/mnt/scratch2/users/3052771/R/lib/nloptr’

The downloaded source packages are in
    ‘/tmp/RtmpwnHFUO/downloaded_packages’
Warning message:
In install.packages("nloptr") :
  installation of package ‘nloptr’ had non-zero exit status

Many thanks,

ADD REPLY
1
Entering edit mode

Many thanks for your all help. This issue is sorted by our HPC admin. There was some wrong path settings in R environment.

Thanks, nabiyogesh

ADD REPLY

Login before adding your answer.

Traffic: 810 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6