Error installing cn.mops and Rsamtools in R 3.1.3
4
0
Entering edit mode
@spollen-william-g-5281
Last seen 8.0 years ago
United States

Hello
I am trying to install cn.mops and having trouble.  I start with a fresh install of R version 3.1.3, and then use
>source("http://bioconductor.org/biocLite.R")
>biocLite()
to install bioconductor.  Here is the output when installing cn.mops:

> biocLite("cn.mops")
BioC_mirror: http://bioconductor.org
Using Bioconductor version 3.0 (BiocInstaller 1.16.2), R version 3.1.3.
Installing package(s) 'cn.mops'
also installing the dependency 'Rsamtools'

trying URL 'http://bioconductor.org/packages/3.0/bioc/src/contrib/Rsamtools_1.18.3.tar.gz'
Content type 'application/x-gzip' length 2969174 bytes (2.8 MB)
opened URL
==================================================
downloaded 2.8 MB

trying URL 'http://bioconductor.org/packages/3.0/bioc/src/contrib/cn.mops_1.12.0.tar.gz'
Content type 'application/x-gzip' length 970100 bytes (947 KB)
opened URL
==================================================
downloaded 947 KB

* installing *source* package 'Rsamtools' ...
** libs
gcc -std=gnu99 -I/ircf/ircfapps/src/R-3.1.3/include -DNDEBUG  -I/usr/local/include -I"/share/ircf/ircfapps/src/R-3.1.3/library/S4Vectors/include" -I"/share/ircf/ircfapps/src/R-3.1.3/library/IRanges/include" -I"/share/ircf/ircfapps/src/R-3.1.3/library/XVector/include" -I"/share/ircf/ircfapps/src/R-3.1.3/library/Biostrings/include"  -fopenmp -D_USE_KNETFILE -D_FILE_OFFSET_BITS=64 -U_FORTIFY_SOURCE -Dfprintf=_samtools_fprintf -Dexit=_samtools_exit -Dabort=_samtools_abort -I./samtools -I./samtools/bcftools -I./tabix -fpic  -g -O2  -c Biostrings_stubs.c -o Biostrings_stubs.o
gcc -std=gnu99 -I/ircf/ircfapps/src/R-3.1.3/include -DNDEBUG  -I/usr/local/include -I"/share/ircf/ircfapps/src/R-3.1.3/library/S4Vectors/include" -I"/share/ircf/ircfapps/src/R-3.1.3/library/IRanges/include" -I"/share/ircf/ircfapps/src/R-3.1.3/library/XVector/include" -I"/share/ircf/ircfapps/src/R-3.1.3/library/Biostrings/include"  -fopenmp -D_USE_KNETFILE -D_FILE_OFFSET_BITS=64 -U_FORTIFY_SOURCE -Dfprintf=_samtools_fprintf -Dexit=_samtools_exit -Dabort=_samtools_abort -I./samtools -I./samtools/bcftools -I./tabix -fpic  -g -O2  -c IRanges_stubs.c -o IRanges_stubs.o
g++ -I/ircf/ircfapps/src/R-3.1.3/include -DNDEBUG  -I/usr/local/include -I"/share/ircf/ircfapps/src/R-3.1.3/library/S4Vectors/include" -I"/share/ircf/ircfapps/src/R-3.1.3/library/IRanges/include" -I"/share/ircf/ircfapps/src/R-3.1.3/library/XVector/include" -I"/share/ircf/ircfapps/src/R-3.1.3/library/Biostrings/include"   -fpic  -g -O2  -c PileupBuffer.cpp -o PileupBuffer.o
In file included from PileupBuffer.cpp:1:
PileupBuffer.h:4:15: error: map: No such file or directory
PileupBuffer.h:5:15: error: set: No such file or directory
PileupBuffer.h:6:18: error: vector: No such file or directory
PileupBuffer.h:7:19: error: utility: No such file or directory
PileupBuffer.h:8:21: error: algorithm: No such file or directory
PileupBuffer.h:9:19: error: cassert: No such file or directory
In file included from ResultManager.h:12,
                 from PileupBuffer.h:11,
                 from PileupBuffer.cpp:1:
PosCache.h:8:19: error: numeric: No such file or directory
In file included from ResultManager.h:13,
                 from PileupBuffer.h:11,
                 from PileupBuffer.cpp:1:
PosCacheColl.h:4:19: error: cstdlib: No such file or directory
In file included from ResultManager.h:15,
                 from PileupBuffer.h:11,
                 from PileupBuffer.cpp:1:
/ircf/ircfapps/src/R-3.1.3/include/Rinternals.h:30:19: error: cstdio: No such file or directory
/ircf/ircfapps/src/R-3.1.3/include/Rinternals.h:34:20: error: climits: No such file or directory
In file included from ResultManager.h:12,
                 from PileupBuffer.h:11,
                 from PileupBuffer.cpp:1:
PosCache.h:11: error: 'std::map' has not been declared
PosCache.h:12: error: 'std::pair' has not been declared
PosCache.h:13: error: 'std::make_pair' has not been declared
PosCache.h:28: error: ISO C++ forbids declaration of 'vector' with no type
PosCache.h:28: error: invalid use of '::'
PosCache.h:28: error: expected ';' before '<' token
PosCache.h:29: error: ISO C++ forbids declaration of 'map' with no type
PosCache.h:29: error: invalid use of '::'
PosCache.h:29: error: expected ';' before '<' token
PosCache.h:30: error: ISO C++ forbids declaration of 'vector' with no type
PosCache.h:30: error: typedef name may not be a nested-name-specifier
PosCache.h:30: error: expected ';' before '<' token
PosCache.h:31: error: ISO C++ forbids declaration of 'map' with no type
PosCache.h:31: error: typedef name may not be a nested-name-specifier
PosCache.h:31: error: expected ';' before '<' token
PosCache.h:39: error: ISO C++ forbids declaration of 'pair' with no type
PosCache.h:39: error: expected ',' or '...' before '<' token
PosCache.h:55: error: ISO C++ forbids declaration of 'set' with no type
PosCache.h:55: error: invalid use of '::'
PosCache.h:55: error: expected ';' before '<' token
PileupBuffer.cpp:162: error: expected ';' at end of input
PileupBuffer.cpp:162: error: expected '}' at end of input
In file included from ResultManager.h:12,
                 from PileupBuffer.h:11,
                 from PileupBuffer.cpp:1:
PosCache.h: In constructor 'PosCache::PosCache(GenomicPosition)':
PosCache.h:33: error: class 'PosCache' does not have any field named 'tupleVec'
PosCache.h:33: error: class 'PosCache' does not have any field named 'nucCounts'
PosCache.h: In member function 'void PosCache::storeTuple(BamTuple&)':
PosCache.h:35: error: 'tupleVec' was not declared in this scope
PosCache.h:36: error: 'nucCounts' was not declared in this scope
PosCache.h:36: error: 'make_pair' was not declared in this scope
PosCache.h: In static member function 'static int PosCache::addSecond(int, int)':
PosCache.h:40: error: 'thePair' was not declared in this scope
PosCache.h: In member function 'int PosCache::totalNucFreq() const':
PosCache.h:43: error: 'accumulate' is not a member of 'std'
PosCache.h:43: error: 'nucCounts' was not declared in this scope
PosCache.h: In member function 'int PosCache::primaryNucFreq() const':
PosCache.h:47: error: expected initializer before '<' token
PosCache.h:48: error: 'iter' was not declared in this scope
PosCache.h:48: error: expected ';' before 'it'
PosCache.h:49: error: 'it' was not declared in this scope
PosCache.h:49: error: 'nucCounts' was not declared in this scope
PosCache.h: At global scope:
PosCache.h:54: error: expected unqualified-id at end of input
make: *** [PileupBuffer.o] Error 1
ERROR: compilation failed for package 'Rsamtools'
* removing '/share/ircf/ircfapps/src/R-3.1.3/library/Rsamtools'
ERROR: dependency 'Rsamtools' is not available for package 'cn.mops'
* removing '/share/ircf/ircfapps/src/R-3.1.3/library/cn.mops'

The downloaded source packages are in
        '/tmp/Rtmp0nNsxR/downloaded_packages'
Warning messages:
1: In install.packages(pkgs = pkgs, lib = lib, repos = repos, ...) :
  installation of package 'Rsamtools' had non-zero exit status
2: In install.packages(pkgs = pkgs, lib = lib, repos = repos, ...) :
  installation of package 'cn.mops' had non-zero exit status

Here is my sessionInfo and traceback:
> traceback()
No traceback available
> sessionInfo()
R version 3.1.3 (2015-03-09)
Platform: x86_64-unknown-linux-gnu (64-bit)
Running under: CentOS release 6.3 (Final)

locale:
[1] C

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

other attached packages:
[1] BiocInstaller_1.16.2

loaded via a namespace (and not attached):
[1] tools_3.1.3

 

It looks like Rsamtools is hung up, not able to find some files to be included in PileupBuffer.cpp compilation.
I am able to install some other packages associated with Rsamtools (S4Vectors, IRanges, XVector, Biostrings).
Any suggestions are welcome. Thanks, Bill

rsamtools cn.mops installation • 2.7k views
ADD COMMENT
2
Entering edit mode
@nathaniel-hayden-6327
Last seen 9.4 years ago
United States

Hi, Bill. Are you on a managed system such as a cluster where there might be a non-standard setup? If you are on such a system I recommend talking to your sysadmin, as it doesn't appear to be a problem with the packages you're trying to install.

At first blush it looks like your g++ doesn't have the proper C++ standard library header location on the include search path. The files g++ says it can't find (map, set, vector, utility, etc.) are C++ standard library headers, and should exist on your system. Do you have compilation problems with other packages that use C++? Rcpp is an obvious example. First try, e.g., biocLite("Rcpp"). If you can install Rcpp then I am very confused. But let's pretend you can't.

To test what's going on I suggest creating a tiny C++ program that includes a C++ standard library header, and check you can compile with the g++ that R points to. In a temporary folder open a shell and enter, say,

echo "#include <vector>" > test.cpp
echo "int main() { std::vector<int> v; return 0; }" >> test.cpp
R CMD g++ test.cpp

(Or you can create the test.cpp with your favorite editor.) If the compiler invocation works that tells us the g++ R points to doesn't have a header problem and something else is going on. On the off chance the g++ R points to is different from the g++ in your path I recommend also trying just g++ test.cpp.

I suspect that won't work. There are more troubleshooting steps if it doesn't. But let's start with that.

If you're more advanced I would use a combination of the locate utility to find where vector lives ('locate vector' in a shell) and passing the -v option to g++ (which will show among other things the directories it uses for include search path; look for '#include <...> search starts here:' or some such). On my system g++ finds vector in /usr/include/c++/4.8.

ADD COMMENT
0
Entering edit mode

If which g++ and R CMD which g++ give the same result that tells you the g++ R points to and the g++ you get when you type g++ at the command line are the same.

ADD REPLY
1
Entering edit mode
@spollen-william-g-5281
Last seen 8.0 years ago
United States

Gents,

I think I have it solved.   I was trying to install the packages while using our LSF-like scheduler, and so R must have been looking for the compiler on one of the cluster machines, not the head node (sorry I did not state that up front. On the other cluster I use the head node and cluster nodes do not disagree on these things).  When I install from the head node everything goes in, Rcpp, Rsamtools, cn.mops, and cummeRbund.   I have learned a few things.   Thanks for your patience and help.

 

Bill

 

ADD COMMENT
0
Entering edit mode
@spollen-william-g-5281
Last seen 8.0 years ago
United States

Hi Nathaniel,

The Rcpp did not install, as you suspected, so I will talk to the sys admin about how to access the proper C++ standard library header, or have it (re-)installed if needed.  I tried your test script, either with R CMD g++ or just g++,  and got an a.out file that is binary and does not produce anything if I execute it.  Not sure if that is what I was supposed to see or not. 

 

Thanks so much,

Bill

 

 

ADD COMMENT
0
Entering edit mode

OK, from what you said it sounds like you were able to successfully compile with either g++ or R CMD g++? The distinction is important. And it's correct that the program shouldn't produce any output, we're just seeing if g++ (1) finds the standard library headers and (2) links to the C++ standard library properly.

Do both R CMD g++ test.cpp and just 'g++ test.cpp' successfully produce a.out? (If it produces a.out that means compilation succeeded.) Which one does it fail for? It should have an error message that looks like what you had above ("No such file or directory"). I would expect R CMD g++ test.cpp to fail.

Does which g++ give the same output as R CMD which g++ (both entered at the command line, not in R)? I ask because if g++ test.cpp from above succeeded (i.e., did not say it had errors and produced a.out) but R CMD g++ test.cpp did not, it's simply a matter of telling your R installation to use the g++ pointed to by which g++. Either way, your sys admin should be told about the fact that your R installation points to a broken g++.

ADD REPLY
0
Entering edit mode

Both produce the a.out file and both use the same g++ when run from the linux command line:

$ which g++
/usr/bin/g++
$ R CMD which g++
/usr/bin/g++

 

ADD REPLY
0
Entering edit mode

Maybe a slightly better test is rm -f test.*o; R CMD SHLIB test.cpp. This should create test.so, which should load in R with R -e "dyn.load('test.so')". For me I get

/tmp$ rm -f test.*o; R CMD SHLIB test.cpp
clang++-3.5 -I/home/mtmorgan/bin/R-3-2-branch/include -DNDEBUG  -I/usr/local/include    -fpic  -ggdb -O0 -pedantic -c test.cpp -o test.o
clang++-3.5 -shared -L/home/mtmorgan/bin/R-3-2-branch/lib -L/usr/local/lib64 -o test.so test.o -L/home/mtmorgan/bin/R-3-2-branch/lib -lR
/tmp$ R --vanilla -e "dyn.load('test.so')"
> dyn.load('test.so')
> 
>
/tmp$ 

 

ADD REPLY
0
Entering edit mode

Hi Martin,

I do that and get exactly what you get.

Bill

ADD REPLY
0
Entering edit mode

Hi Bill -- please copy and paste your results into your reply; there may be subtle but important differences, and obviously you didn't get _exactly_ the same results.

ADD REPLY
0
Entering edit mode

Ok, here goes:

/ircf/ircfapps/src/R-3.1.3/bin/R -e "dyn.load('test.so')"

R version 3.1.3 (2015-03-09) -- "Smooth Sidewalk"
Copyright (C) 2015 The R Foundation for Statistical Computing
Platform: x86_64-unknown-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> dyn.load('test.so')
>
>

 

ADD REPLY
0
Entering edit mode

Hi Bill -- I'm not being difficult, but I meant the compilation part. I think you can edit your earlier reply, too , so we don't get narrower and narrower boxes to answer in...

ADD REPLY
0
Entering edit mode
@spollen-william-g-5281
Last seen 8.0 years ago
United States

I think I have discovered the problem.   When trying, and failing, to install these R packages on this cluster I used the job scheduler.  Today I tried without the scheduler and all the packages got installed (Rcpp, cn.mops, Rsamtools, cummeRbund), and the cn.mops functions that I have tried so far seem to work. There must be one or more compute nodes in our cluster that have a C++ problem.  

Thank you both for your help.   I should have realized the possible difference between head node and compute node sooner.

 

Bill

ADD COMMENT

Login before adding your answer.

Traffic: 469 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