R package BH not found for Bioconductor package RBGL - r

I have had difficulties installing RBGL (Bioconductor Boost library) after upgrading. The error is encountered when R CMD build tries to build the (source) package. Running ./configure from the package root works fine; unfortunately, R CMD build cleans the package before running configure again.
Exact error is:
checking R package BH ... no
configure: error: R package BH not found.
ERROR: configuration failed for package ‘RBGL’
Running ./configure manually I get:
checking R package BH ... yes
configure: creating ./config.status
config.status: creating src/Makevars
In particular, the error arises from this line: AX_R_PACKAGE([BH],,[${R}]). Notably, if I remove this line from the configure script, the package builds and installs just fine.
fwiw:
> sessionInfo()
R version 3.6.1 (2019-07-05)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.3 LTS
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/openblas/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/libopenblasp-r0.2.20.so
locale:
[1] LC_CTYPE=en_GB.UTF-8 LC_NUMERIC=C LC_TIME=en_GB.UTF-8
[4] LC_COLLATE=en_GB.UTF-8 LC_MONETARY=en_GB.UTF-8 LC_MESSAGES=en_GB.UTF-8
[7] LC_PAPER=en_GB.UTF-8 LC_NAME=C LC_ADDRESS=C
[10] LC_TELEPHONE=C LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] BH_1.69.0-1
loaded via a namespace (and not attached):
[1] BiocManager_1.30.4 compiler_3.6.1 tools_3.6.1 parallel_3.6.1

Few quick things:
You need to show us the error
I am one of the BH authors and its maintainers, and I develop on Ubuntu; please trust me when I say it works.
When I try right now (using R 3.6.1 like you) I get an error from BioCManager as shown below.
You could try BioConductor devel for RBGL as per this page
Error Message
R> BiocManager::install("RBGL")
Error: Bioconductor version '3.8' requires R version '3.5'; \
see https://bioconductor.org/install
R>
Edit: Looking further into this all it took was two manual wget downloads from the package pages and an installation:
edd#rob:~$ cd /tmp
edd#rob:/tmp$ wget -q https://bioconductor.org/packages/release/bioc/src/contrib/RBGL_1.60.0.tar.gz
edd#rob:/tmp$ wget -q https://bioconductor.org/packages/release/bioc/src/contrib/graph_1.62.0.tar.gz
edd#rob:/tmp$ install.r graph_1.62.0.tar.gz RBGL_1.60.0.tar.gz # helper from littler
* installing *source* package ‘graph’ ...
** using staged installation
** libs
ccache gcc -I"/usr/share/R/include" -DNDEBUG -fpic -g -O3 -Wall -pipe -pedantic -std=gnu99 -c graph.c -o graph.o
ccache gcc -Wl,-S -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o graph.so graph.o -L/usr/lib/R/lib -lR
mv graph.so BioC_graph.so
installing to /usr/local/lib/R/site-library/00LOCK-graph/00new/graph/libs
** R
[... few lines removd ***]
** testing if installed package keeps a record of temporary installation path
* DONE (graph)
* installing *source* package ‘RBGL’ ...
** using staged installation
checking R package BH ... yes
configure: creating ./config.status
config.status: creating src/Makevars
** libs
ccache g++ -I"/usr/share/R/include" -DNDEBUG -I/usr/local/lib/R/site-library/BH/include -I"/usr/local/lib/R/site-library/BH/include" -fpic -g -O3 -Wall -pipe -pedantic -c bbc.cpp -o bbc.o
[... lots of output omitted ...]
** testing if installed package keeps a record of temporary installation path
* DONE (RBGL)
edd#rob:/tmp$
Edit 2: As you mention the issue with configure, I re-ran this by hand after unpacking the tarball. And, unsurprisingly given that the build worked for me, it finds it.
edd#rob:/tmp/RBGL$ ./configure
checking R package BH ... yes
configure: creating ./config.status
config.status: creating src/Makevars
edd#rob:/tmp/RBGL$
Where is your BH package installed, and why might your session find it but configire does not? Did you run one as root and one as you?

Related

How to install RcppArmadillo in AWS EMR version 5.29

I am trying to install RcppArmadillo using sparkR shell in AWS EMR version 5.29.
Here is my sessionInfo() -
R version 3.4.1 (2017-06-30)
Platform: x86_64-redhat-linux-gnu (64-bit)
Running under: Amazon Linux AMI 2018.03
Matrix products: default
BLAS/LAPACK: /usr/lib64/R/lib/libRblas.so
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] SparkR_2.4.4
loaded via a namespace (and not attached):
[1] compiler_3.4.1 tools_3.4.1
Here is my code to install this package -
package_path <- "/home/sma/"
install.packages('RcppArmadillo',repos = "http://cran.us.r-project.org",lib=package_path, dependencies = TRUE)
Here is the failure that I get when I execute the install.packages() statement -
SparkSession available as 'spark'.
* installing *source* package ‘RcppArmadillo’ ...
** package ‘RcppArmadillo’ successfully unpacked and MD5 sums checked
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ -m64 accepts -g... yes
checking how to run the C++ preprocessor... g++ -m64 -E
checking whether we are using the GNU C++ compiler... (cached) yes
checking whether g++ -m64 accepts -g... (cached) yes
checking whether we have a suitable tempdir... /tmp
checking whether R CMD SHLIB can already compile programs using OpenMP... no
checking whether g++ version is sufficient... yes, with OpenMP as version 7.2.1
checking for macOS... no
checking LAPACK_LIBS... R-supplied partial LAPACK found
configure: WARNING: Some complex-valued LAPACK functions may not be available
checking for OpenMP... found and suitable
configure: creating ./config.status
config.status: creating inst/include/RcppArmadilloConfigGenerated.h
config.status: creating src/Makevars
** libs
g++ -m64 -std=gnu++11 -I/usr/include/R -DNDEBUG -I"/home/sma/Rcpp/include" -I/usr/local/include -I../inst/include -fopenmp -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c RcppArmadillo.cpp -o RcppArmadillo.o
In file included from ../inst/include/RcppArmadilloForward.h:49:0,
from ../inst/include/RcppArmadillo.h:31,
from RcppArmadillo.cpp:22:
../inst/include/armadillo:70:12: fatal error: omp.h: No such file or directory
#include <omp.h>
^~~~~~~
compilation terminated.
make: *** [RcppArmadillo.o] Error 1
ERROR: compilation failed for package ‘RcppArmadillo’
* removing ‘/home/sma/RcppArmadillo’
The downloaded source packages are in
‘/mnt/tmp/RtmpQmFZ4n/downloaded_packages’
Warning messages:
1: In install.packages("RcppArmadillo", repos = "http://cran.us.r-project.org", :
installation of package ‘slam’ had non-zero exit status
2: In install.packages("RcppArmadillo", repos = "http://cran.us.r-project.org", :
installation of package ‘RcppArmadillo’ had non-zero exit status
You are running 'R version 3.4.1 (2017-06-30)' so I would suggest you pick a version of RcppArmadillo of a similar vintage. The archive directory at CRAN, sorted by date suggests that version RcppArmadillo_0.7.960.1.0 came out in on 2017-08-17, or shortly after the (ancient) R release you have here.
You could of course join in the present rather than pastm but for that I recommend the current R 4.0.3 as well as a current, as opposed to several years old, OS release.

Can't install reticulate in R

I'm trying to install reticulate so I can execute some Python code I've written from within R. Unfortunately, I'm having trouble installing the package and haven't had much luck in determining the reason.
I've found that it likely has something to do with compiling the package and possible issues with gcc or different versions of c++ compilers, but I'm a bit out of my depth with those issues and haven't been able to get anything working. I've tried uninstalling and reinstalling xcode command line tools, but that didn't solve the issue. Beyond that, I'm not entirely sure where to start. I'm hoping somebody has experienced this and there's a straightforward answer, I'd really appreciate any help.
> install.packages('reticulate')
There is a binary version available but the source version is later:
binary source needs_compilation
reticulate 1.13 1.14 TRUE
Do you want to install from sources the package which needs compilation? (Yes/no/cancel) y
installing the source package ‘reticulate’
trying URL 'https://cran.rstudio.com/src/contrib/reticulate_1.14.tar.gz'
Content type 'application/x-gzip' length 1504849 bytes (1.4 MB)
==================================================
downloaded 1.4 MB
* installing *source* package ‘reticulate’ ...
** package ‘reticulate’ successfully unpacked and MD5 sums checked
** libs
/usr/local/bin/gcc-8 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I/usr/local/include -fPIC -Wall -g -O2 -c RcppExports.cpp -o RcppExports.o
/usr/local/bin/gcc-8 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I/usr/local/include -fPIC -Wall -g -O2 -c event_loop.cpp -o event_loop.o
/usr/local/bin/gcc-8 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I/usr/local/include -fPIC -Wall -g -O2 -c libpython.cpp -o libpython.o
/usr/local/bin/gcc-8 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I/usr/local/include -fPIC -Wall -g -O2 -c output.cpp -o output.o
/usr/local/bin/gcc-8 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I/usr/local/include -fPIC -Wall -g -O2 -c python.cpp -o python.o
/usr/local/bin/gcc-8 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I/usr/local/include -fPIC -Wall -g -O2 -c readline.cpp -o readline.o
/usr/local/bin/gcc-8 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/usr/local/lib -o reticulate.so RcppExports.o event_loop.o libpython.o output.o python.o readline.o -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
installing to /Library/Frameworks/R.framework/Versions/3.5/Resources/library/reticulate/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
Error: package or namespace load failed for ‘reticulate’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/Library/Frameworks/R.framework/Versions/3.5/Resources/library/reticulate/libs/reticulate.so':
dlopen(/Library/Frameworks/R.framework/Versions/3.5/Resources/library/reticulate/libs/reticulate.so, 6): Symbol not found: __ZNSt15basic_streambufIcSt11char_traitsIcEE5imbueERKSt6locale
Referenced from: /Library/Frameworks/R.framework/Versions/3.5/Resources/library/reticulate/libs/reticulate.so
Expected in: flat namespace
in /Library/Frameworks/R.framework/Versions/3.5/Resources/library/reticulate/libs/reticulate.so
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/reticulate’
Warning in install.packages :
installation of package ‘reticulate’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/4g/ctbqp07114x4brzp4hr8zfc40000gn/T/RtmpDNvElq/downloaded_packages’
Session Info:
> sessionInfo()
R version 3.5.3 (2019-03-11)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS 10.15.2
Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_3.5.3 tools_3.5.3 yaml_2.2.0
Okay, I suggest to use conda to create a new environment and install there R anew. Because then you solve the issues - since only one line conda install -c conda-forge r-reticulate will install you reticulate and r-base solving for you all issues.
However some people (who don't know what conda is) won't be happy with my suggestion. I can't and won't help them.
But for those who know conda, I recommend:
conda create --name R_reticulate
source activate R_reticulate
conda install -c conda-forge r-reticulate
(of course you could determine version numbers when installing into conda environment ...)
if the version of R in your local env now is the same like your global R, you can even overtake most of the library installed in the pre-existing R - thus you don't have to reinstall them all over again. Simply by manipulating the path variable in your conda env's R.
(Just as a hack and if you are lazy to install everything anew, probably because you want just to play around with reticulate first, before you install it into your global R).
For that, in your global R, determine where your R packages are installed by .libPaths() from within your global R console.
Then start R in your R_reticulate conda environment,
and at beginning of session do
my_libPaths <- .libPaths()
# and e.g. add one or some of your global .libPaths() paths
# to here by
my_libPaths <- c(my_libPaths, one_of_global_path)
.libPaths(my_libPaths) # assign new libpaths!
# the order of the paths in the vector is important - decides about where R looks first!
# of course you can change order like you want in the vector!
By that, you don't have to re-install libraries.
However, the version number of global and local (conda) R must be same so that this works.
Otherwise you will get always warnings when loading libraries ...
Simpler is of course to re-install everything into your conda env's R. (conda will help you for this a lot!).

r package installation error "unknown type name ‘R_CallMethodDef’"

I'm trying to install r package "sparsesvd" using install.packages(), but got error during compilation. Any help is highly appreciated!
"unknown type name ‘R_CallMethodDef’"
I also tried conda install -c r r-sparsesvd; but got error.
Solving environment: failed
PackagesNotFoundError: The following packages are not available from
current channels:
r-sparsesvd
Current channels:
https://conda.anaconda.org/r/linux-64
https://conda.anaconda.org/r/noarch
https://conda.anaconda.org/bioconda/linux-64
https://conda.anaconda.org/bioconda/noarch
https://conda.anaconda.org/conda-forge/linux-64
https://conda.anaconda.org/conda-forge/noarch
https://repo.anaconda.com/pkgs/r/linux-64
https://repo.anaconda.com/pkgs/r/noarch
...
I tried
conda skeleton cran --recursive r-sparsesvd
conda build r-sparsesvd.
While the 1st step was successful, the build failed.
Execution halted
Tests failed for r-sparsesvd-0.1_4-r341h96ca727_0.tar.bz2
Here is the sessionInfo. Due to project reason, I have to use R3.3
R version 3.3.2 (2016-10-31) Platform: x86_64-pc-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)
locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C [3]
LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 [5]
LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 [7]
LC_PAPER=en_US.UTF-8 LC_NAME=C [9] LC_ADDRESS=C
LC_TELEPHONE=C [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages: [1] stats graphics grDevices utils
datasets methods base
loaded via a namespace (and not attached): [1] tools_3.3.2
This (once again) is not a problem with R, CRAN or its packages ...but apparently with Conda. On my system there is strictly no problem with this small package with very few dependencies:
R> install.packages("sparsesvd")
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/sparsesvd_0.1-4.tar.gz'
Content type 'application/x-gzip' length 29729 bytes (29 KB)
==================================================
downloaded 29 KB
* installing *source* package ‘sparsesvd’ ...
** package ‘sparsesvd’ successfully unpacked and MD5 sums checked
** libs
gcc -I"/usr/share/R/include" -DNDEBUG -fpic -g -O3 -Wall -pipe -std=gnu99 -march=native -c las2.c -o las2.o
gcc -I"/usr/share/R/include" -DNDEBUG -fpic -g -O3 -Wall -pipe -std=gnu99 -march=native -c main.c -o main.o
gcc -I"/usr/share/R/include" -DNDEBUG -fpic -g -O3 -Wall -pipe -std=gnu99 -march=native -c svdlib.c -o svdlib.o
gcc -I"/usr/share/R/include" -DNDEBUG -fpic -g -O3 -Wall -pipe -std=gnu99 -march=native -c svdutil.c -o svdutil.o
svdutil.c: In function ‘svd_readBinFloat’:
svdutil.c:265:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
y = *((float *) &x);
^
svdutil.c: In function ‘svd_writeBinFloat’:
svdutil.c:290:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
int y = htonl(*((int *) &r));
^~~
gcc -Wl,-S -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o sparsesvd.so las2.o main.o svdlib.o svdutil.o -L/usr/lib/R/lib -lR
installing to /usr/local/lib/R/site-library/sparsesvd/libs
** R
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
* DONE (sparsesvd)
The downloaded source packages are in
‘/tmp/RtmpI3TPWj/downloaded_packages’
R>

Cannot build package with dot in the name with newer version of Rcpp

since I updated my version of Rcpp to 0.12.11 (I tested it works for 0.12.10) I cannot build my package anymore.
Actually creating a new package called dot.test from RStudio cannot be built.
Updating dot.test documentation
Loading dot.test
Re-compiling dot.test
'/usr/lib64/R/bin/R' --no-site-file --no-environ --no-save --no-restore \
--quiet CMD INSTALL '/pxfs/data/statquant/public/dot.test' \
--library='/tmp/RtmpZARXxv/devtools_install_1ef63ab8fde6' --no-R --no-data \
--no-help --no-demo --no-inst --no-docs --no-exec --no-multiarch \
--no-test-load
* installing *source* package ‘dot.test’ ...
** libs
g++ -m64 -I/usr/include/R -DNDEBUG -I/usr/local/include -I"/lxhome/statquant/R/x86_64-redhat-linux-gnu-library/3.3/Rcpp/include" -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c RcppExports.cpp -o RcppExports.o
RcppExports.cpp:20:46: error: ‘dot’ was not declared in this scope
{"dot.test_rcpp_hello_world", (DL_FUNC) &dot.test_rcpp_hello_world, 0},
^
R> sessionInfo()
R version 3.3.0 (2016-05-03)
Platform: x86_64-redhat-linux-gnu (64-bit)
[...]
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] tools_3.3.0
R> system('which g++')
/opt/rh/devtoolset-3/root/usr/bin/g++
R> system('g++ --version')
g++ (GCC) 4.9.2 20150212 (Red Hat 4.9.2-6)
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
If that's understandable that C++ and a package name with . might be asking for problems it is not explicitly forbidden (that I know of).
There are tons of packages like data.table that have a dot in the name
My questions are then:
Did I miss an explicit rule from R-core ?
Do a . in the name implies I cannot use Rcpp::compileAttributes anymore ?
Is there a quick fix that would enable me to build and still use Rcpp>0.12.10 ?
It's a bug which Kirill reported to me the other day (in person), by now filed on GitHub ... and which should get fixed "soon".
See https://github.com/RcppCore/Rcpp/issues/721 for more and progress.
The quick fix, for now, is to use a hand-edited src/init.c until compileAttributes() gets fixed.

/usr/bin/ld: cannot find -lgfortran when installing 'RcppArmadillo' in R

The primary goal is to use DiffBind (a R package) to analyze my ChIPseq data.
(I found another post which might be relevant to my issue, and tried to extract the solution from it, but I guess the content was too "advanced" for me... )
Following the suggestion that I might need to update my DiffBind
I tried to install a new version of it.
By the checking the dependency of DiffBind I guess that the previous installation automatically install an old version of DiffBind because my R did not meet the requirement of current version of DiffBind.
But I was using the R under the root directory, for which I could not do much about it. So I decided install a newer version of R under my own directory. and I managed to do that.
Then I tried to install the current version of DiffBind, I got the error
ERROR: compilation failed for package ‘RcppArmadillo’
It turned out the dependency lib "RcppArmadillo" require a more up-to-date compiler, again, I was using the gcc compiler under the root directory, so I install a new version of gcc under my own directory.
$ gcc --version
gcc (GCC) 6.1.0
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ which gcc
/$HOME/Programme/gcc-6.1.0/bin//gcc
After that I tried to install the DiffBind (RcppArmadillo) again, but met another error:
* installing *source* package ‘RcppArmadillo’ ...
** package 'RcppArmadillo' successfully unpacked and MD5 sums checked
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking how to run the C++ preprocessor... g++ -E
checking whether we are using the GNU C++ compiler... (cached) yes
checking whether g++ accepts -g... (cached) yes
checking whether g++ version is sufficient... (6.1.0) yes
checking LAPACK_LIBS... fallback LAPACK from R 3.3.0 or later used
configure: creating ./config.status
config.status: creating inst/include/RcppArmadilloLapack.h
** libs
g++ -I/$HOME/Programme/R-3.3.1/lib64/R/include -DNDEBUG -I//$HOME/Programme/zlib-1.2.11/include -I//$HOME/Programme/bzip2-1.0.6/include -I//$HOME/Programme/xz-5.2.3/include -I//$HOME/Programme/pcre-8.40/include -I//$HOME/Programme/curl-7.52.1/include -I"/$HOME/Programme/R-3.3.1/lib64/R/library/Rcpp/include" -I../inst/include -fpic -g -O2 -c RcppArmadillo.cpp -o RcppArmadillo.o
g++ -I/$HOME/Programme/R-3.3.1/lib64/R/include -DNDEBUG -I//$HOME/Programme/zlib-1.2.11/include -I//$HOME/Programme/bzip2-1.0.6/include -I//$HOME/Programme/xz-5.2.3/include -I//$HOME/Programme/pcre-8.40/include -I//$HOME/Programme/curl-7.52.1/include -I"/$HOME/Programme/R-3.3.1/lib64/R/library/Rcpp/include" -I../inst/include -fpic -g -O2 -c RcppExports.cpp -o RcppExports.o
g++ -I/$HOME/Programme/R-3.3.1/lib64/R/include -DNDEBUG -I//$HOME/Programme/zlib-1.2.11/include -I//$HOME/Programme/bzip2-1.0.6/include -I//$HOME/Programme/xz-5.2.3/include -I//$HOME/Programme/pcre-8.40/include -I//$HOME/Programme/curl-7.52.1/include -I"/$HOME/Programme/R-3.3.1/lib64/R/library/Rcpp/include" -I../inst/include -fpic -g -O2 -c fastLm.cpp -o fastLm.o
g++ -shared -L/$HOME/Programme/R-3.3.1/lib64/R/lib -L//$HOME/Programme/zlib-1.2.11/lib -L//$HOME/Programme/bzip2-1.0.6/lib -L//$HOME/Programme/xz-5.2.3/lib -L//$HOME/Programme/pcre-8.40/lib -L//$HOME/Programme/curl-7.52.1/lib -o RcppArmadillo.so RcppArmadillo.o RcppExports.o fastLm.o -L/$HOME/Programme/R-3.3.1/lib64/R/lib -lRlapack -L/$HOME/Programme/R-3.3.1/lib64/R/lib -lRblas -lgfortran -lm -L/$HOME/Programme/R-3.3.1/lib64/R/lib -lR
/usr/bin/ld: cannot find -lgfortran
collect2: error: ld returned 1 exit status**
it turned out that gfortran could not be found.
but when I checked existence of gfortran it exist:
$ which gfortran
/usr/bin/gfortran
$ gfortran --version
GNU Fortran (GCC) 4.4.7 20120313 (Red Hat 4.4.7-17)
Copyright (C) 2010 Free Software Foundation, Inc.
GNU Fortran comes with NO WARRANTY, to the extent permitted by law.
You may redistribute copies of GNU Fortran
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING
So I assumed that gcc could not find gfortran, which is under the root directory.
how could I solve the problem?
Or could it be possible that the mismatch between the gcc and gfortran is the problem? if that is the case, what could be done to circumvent it?
My R version:
> sessionInfo()
R version 3.3.1 (2016-06-21)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Red Hat Enterprise Linux Server release 6.7 (Santiago)
locale:
[1] LC_CTYPE=ja_JP.UTF-8 LC_NUMERIC=C
[3] LC_TIME=ja_JP.UTF-8 LC_COLLATE=ja_JP.UTF-8
[5] LC_MONETARY=ja_JP.UTF-8 LC_MESSAGES=ja_JP.UTF-8
[7] LC_PAPER=ja_JP.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=ja_JP.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
I think the issue mentioned here has been solved.
As VladimirF mentioned in the comments, when I installed the new version of gcc, I did not enable the Fortran, which is not a default setting, so the gfortran was not installed in my previous attempts.
I deleted my previous Gcc, and re compiled it as follows:
tar -xvf gcc-6.1.0.tar.gz
cd gcc-6.1.0
./contrib/download_prerequisites
mkdir build
cd build
../configure --prefix=$HOME/Programme/gcc-6.1.0 --enable-languages=c,c++,fortran --disable-multilib
make -j 8
make install
set path for new gcc and lib
it worked!

Resources