sneumann / Rdisop

This is the git repository matching the Bioconductor package Rdisop: Decomposition of Isotopic Patterns
4 stars 7 forks source link

Build failure on Windows #13

Closed sneumann closed 5 years ago

sneumann commented 5 years ago

http://bioconductor.org/checkResults/devel/bioc-LATEST/Rdisop/tokay2-buildbin.html

...
C:/Rtools/mingw_32/bin/g++ -shared -s -static-libgcc -o Rdisop.dll tmp.def disop.o imslib/src/ims/element.o imslib/src/ims/composedelement.o imslib/src/ims/isotopedistribution.o imslib/src/ims/alphabet.o imslib/src/ims/weights.o imslib/src/ims/distributedalphabet.o imslib/src/ims/transformation.o imslib/src/ims/isotopespecies.o imslib/src/ims/base/parser/alphabettextparser.o imslib/src/ims/base/parser/distributedalphabettextparser.o imslib/src/ims/base/parser/massestextparser.o imslib/src/ims/base/parser/moleculesequenceparser.o imslib/src/ims/base/parser/standardmoleculesequenceparser.o imslib/src/ims/base/parser/keggligandcompoundsparser.o imslib/src/ims/base/parser/moleculeionchargemodificationparser.o imslib/src/ims/calib/linepairstabber.o imslib/src/ims/calib/matchmatrix.o imslib/src/ims/calib/linearpointsetmatcher.o imslib/src/ims/decomp/realmassdecomposer.o imslib/src/ims/utils/distribution.o imslib/src/ims/distributionprobabilityscorer.o imslib/src/ims/characteralphabet.o imslib/src/ims/nitrogenrulefilter.o C:/Users/biocbuild/bbs-3.9-bioc/R/library/RcppClassic/lib/i386/libRcppClassic.a -LC:/extsoft/lib/i386 -LC:/extsoft/lib -LC:/Users/BIOCBU˜1/BBS-3˜1.9-B/R/bin/i386 -lR
imslib/src/ims/element.o: file not recognized: File format not recognized
Livia-Rasp commented 5 years ago

This issue is probably related to the following issue on Stackoverflow: https://stackoverflow.com/questions/17126384/g-output-file-not-recognized-file-format-not-recognized

I will look into fixing it

mjhelf commented 5 years ago

HI there,

I had issues installing from github (devtools::install_github("sneumann/Rdisop")) on Windows, too:

g++.exe: error: libraries/R-3.5.0/RcppClassic/lib/i386/libRcppClassic.a: No such file or directory
no DLL was created
ERROR: compilation failed for package 'Rdisop'
* removing 'C:/Users/mjh/R libraries/R-3.5.0/Rdisop'

As you can see, there is a space in my library location, and I think that was a problem because of this line:

https://github.com/sneumann/Rdisop/blob/88541a723a5f6d75c90c612137f8f45ab1d5a4a6/src/Makevars#L3

should the RcppClassic:::LdFlags() (which -in Windows- returns the path to libRcppClassic.a without quotes) actually still be in there? After uninstalling RcppClassic the installation was successful (despite causing this predictable error while building Rdisop):

Error in loadNamespace(name) : there is no package called 'RcppClassic'

Installation on Ubuntu worked, but I also do not have spaces in my library path there.

Looking more into it, it seems like Rcpp:::LdFlags() is deprecated and returns an empty string, so maybe you can just scrap the entire line 3 in Makevars?

sneumann commented 5 years ago

Hi Max, very good observation! I gave it a try in 1.43.4 Let's see what build machines say. If you could check devtools::install_github("sneumann/Rdisop" again on Windows, that would be great too. Yours, Steffen

mjhelf commented 5 years ago

Hi Steffen,

thanks for the prompt response! It works now under Windows, with or without RcppClassic installed.

As an aside, there is one more remnant of the RcppClassic dependency in your travis config:

https://github.com/sneumann/Rdisop/blob/a76abb6cffd15fabc095e949691563c4adad4496/.travis.yml#L3

sneumann commented 5 years ago

Good catch ! Removed that now as well. Yours, Steffen

sneumann commented 5 years ago

Hi @mjhelf , no luck on the build machines http://bioconductor.org/checkResults/devel/bioc-LATEST/Rdisop/tokay2-buildbin.html could you try the exact command line shown in the BioC build log ? Thanks, yours, Steffen

mjhelf commented 5 years ago

Hi @sneumann,

I have Rtools 3.5 and R 3.6.0-alpha on Windows 10 and ran the command with the tarball from GitHub:

C:\Users\mjh\Downloads>rm -rf Rdisop.buildbin-libdir && mkdir Rdisop.buildbin-libdir && C:\Users\mjh\R\\R-3.6.0alpha\bin\R.exe CMD INSTALL --merge-multiarch --build --library=Rdisop.buildbin-libdir sneumann-Rdisop-6a06961.tar.gz

This worked for 32- and 64 bit and produced a zip file with the compiled package. Here is everything that happened in the 32-bit build starting where the build machine runs into trouble, hope it helps:

disop.cpp: In function 'void initializeAlphabet(SEXP, alphabet_t&, int)':
disop.cpp:804:33: warning: typedef 'elements_type' locally defined but not used [-Wunused-local-typedefs]
   typedef alphabet_t::container elements_type;
                                 ^
c:/Rtools/mingw_32/bin/g++  -I"C:/Users/mjh/R/R-36~1.0AL/include" -DNDEBUG  -I"C:/Users/mjh/R libraries/R-3.5.0/Rcpp/include"     -I./imslib/src/   -O2 -Wall  -mtune=generic -c imslib/src/ims/element.cpp -o imslib/src/ims/element.o
In file included from imslib/src/ims/element.cpp:6:0:
./imslib/src/ims/element.h: In member function 'ims::Element::mass_type ims::Element::getMass(ims::Element::size_type) const':
./imslib/src/ims/element.h:166:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       for (int i=0; i < IsotopeDistribution::SIZE; i++) {
                       ^
c:/Rtools/mingw_32/bin/g++  -I"C:/Users/mjh/R/R-36~1.0AL/include" -DNDEBUG  -I"C:/Users/mjh/R libraries/R-3.5.0/Rcpp/include"     -I./imslib/src/   -O2 -Wall  -mtune=generic -c imslib/src/ims/composedelement.cpp -o imslib/src/ims/composedelement.o
In file included from ./imslib/src/ims/composedelement.h:7:0,
                 from imslib/src/ims/composedelement.cpp:8:
./imslib/src/ims/element.h: In member function 'ims::Element::mass_type ims::Element::getMass(ims::Element::size_type) const':
./imslib/src/ims/element.h:166:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       for (int i=0; i < IsotopeDistribution::SIZE; i++) {
                       ^
c:/Rtools/mingw_32/bin/g++  -I"C:/Users/mjh/R/R-36~1.0AL/include" -DNDEBUG  -I"C:/Users/mjh/R libraries/R-3.5.0/Rcpp/include"     -I./imslib/src/   -O2 -Wall  -mtune=generic -c imslib/src/ims/isotopedistribution.cpp -o imslib/src/ims/isotopedistribution.o
c:/Rtools/mingw_32/bin/g++  -I"C:/Users/mjh/R/R-36~1.0AL/include" -DNDEBUG  -I"C:/Users/mjh/R libraries/R-3.5.0/Rcpp/include"     -I./imslib/src/   -O2 -Wall  -mtune=generic -c imslib/src/ims/alphabet.cpp -o imslib/src/ims/alphabet.o
In file included from ./imslib/src/ims/alphabet.h:8:0,
                 from imslib/src/ims/alphabet.cpp:6:
./imslib/src/ims/element.h: In member function 'ims::Element::mass_type ims::Element::getMass(ims::Element::size_type) const':
./imslib/src/ims/element.h:166:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       for (int i=0; i < IsotopeDistribution::SIZE; i++) {
                       ^
c:/Rtools/mingw_32/bin/g++  -I"C:/Users/mjh/R/R-36~1.0AL/include" -DNDEBUG  -I"C:/Users/mjh/R libraries/R-3.5.0/Rcpp/include"     -I./imslib/src/   -O2 -Wall  -mtune=generic -c imslib/src/ims/weights.cpp -o imslib/src/ims/weights.o
c:/Rtools/mingw_32/bin/g++  -I"C:/Users/mjh/R/R-36~1.0AL/include" -DNDEBUG  -I"C:/Users/mjh/R libraries/R-3.5.0/Rcpp/include"     -I./imslib/src/   -O2 -Wall  -mtune=generic -c imslib/src/ims/distributedalphabet.cpp -o imslib/src/ims/distributedalphabet.o
In file included from ./imslib/src/ims/alphabet.h:8:0,
                 from ./imslib/src/ims/distributedalphabet.h:7,
                 from imslib/src/ims/distributedalphabet.cpp:7:
./imslib/src/ims/element.h: In member function 'ims::Element::mass_type ims::Element::getMass(ims::Element::size_type) const':
./imslib/src/ims/element.h:166:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       for (int i=0; i < IsotopeDistribution::SIZE; i++) {
                       ^
c:/Rtools/mingw_32/bin/g++  -I"C:/Users/mjh/R/R-36~1.0AL/include" -DNDEBUG  -I"C:/Users/mjh/R libraries/R-3.5.0/Rcpp/include"     -I./imslib/src/   -O2 -Wall  -mtune=generic -c imslib/src/ims/transformation.cpp -o imslib/src/ims/transformation.o
c:/Rtools/mingw_32/bin/g++  -I"C:/Users/mjh/R/R-36~1.0AL/include" -DNDEBUG  -I"C:/Users/mjh/R libraries/R-3.5.0/Rcpp/include"     -I./imslib/src/   -O2 -Wall  -mtune=generic -c imslib/src/ims/isotopespecies.cpp -o imslib/src/ims/isotopespecies.o
c:/Rtools/mingw_32/bin/g++  -I"C:/Users/mjh/R/R-36~1.0AL/include" -DNDEBUG  -I"C:/Users/mjh/R libraries/R-3.5.0/Rcpp/include"     -I./imslib/src/   -O2 -Wall  -mtune=generic -c imslib/src/ims/base/parser/alphabettextparser.cpp -o imslib/src/ims/base/parser/alphabettextparser.o
c:/Rtools/mingw_32/bin/g++  -I"C:/Users/mjh/R/R-36~1.0AL/include" -DNDEBUG  -I"C:/Users/mjh/R libraries/R-3.5.0/Rcpp/include"     -I./imslib/src/   -O2 -Wall  -mtune=generic -c imslib/src/ims/base/parser/distributedalphabettextparser.cpp -o imslib/src/ims/base/parser/distributedalphabettextparser.o
c:/Rtools/mingw_32/bin/g++  -I"C:/Users/mjh/R/R-36~1.0AL/include" -DNDEBUG  -I"C:/Users/mjh/R libraries/R-3.5.0/Rcpp/include"     -I./imslib/src/   -O2 -Wall  -mtune=generic -c imslib/src/ims/base/parser/massestextparser.cpp -o imslib/src/ims/base/parser/massestextparser.o
c:/Rtools/mingw_32/bin/g++  -I"C:/Users/mjh/R/R-36~1.0AL/include" -DNDEBUG  -I"C:/Users/mjh/R libraries/R-3.5.0/Rcpp/include"     -I./imslib/src/   -O2 -Wall  -mtune=generic -c imslib/src/ims/base/parser/moleculesequenceparser.cpp -o imslib/src/ims/base/parser/moleculesequenceparser.o
c:/Rtools/mingw_32/bin/g++  -I"C:/Users/mjh/R/R-36~1.0AL/include" -DNDEBUG  -I"C:/Users/mjh/R libraries/R-3.5.0/Rcpp/include"     -I./imslib/src/   -O2 -Wall  -mtune=generic -c imslib/src/ims/base/parser/standardmoleculesequenceparser.cpp -o imslib/src/ims/base/parser/standardmoleculesequenceparser.o
c:/Rtools/mingw_32/bin/g++  -I"C:/Users/mjh/R/R-36~1.0AL/include" -DNDEBUG  -I"C:/Users/mjh/R libraries/R-3.5.0/Rcpp/include"     -I./imslib/src/   -O2 -Wall  -mtune=generic -c imslib/src/ims/base/parser/keggligandcompoundsparser.cpp -o imslib/src/ims/base/parser/keggligandcompoundsparser.o
imslib/src/ims/base/parser/keggligandcompoundsparser.cpp: In member function 'virtual void ims::KeggLigandCompoundsParser::parse(const sequence_type&)':
imslib/src/ims/base/parser/keggligandcompoundsparser.cpp:53:31: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
  for (; letter_pos < last_pos &&
                               ^
c:/Rtools/mingw_32/bin/g++  -I"C:/Users/mjh/R/R-36~1.0AL/include" -DNDEBUG  -I"C:/Users/mjh/R libraries/R-3.5.0/Rcpp/include"     -I./imslib/src/   -O2 -Wall  -mtune=generic -c imslib/src/ims/base/parser/moleculeionchargemodificationparser.cpp -o imslib/src/ims/base/parser/moleculeionchargemodificationparser.o
c:/Rtools/mingw_32/bin/g++  -I"C:/Users/mjh/R/R-36~1.0AL/include" -DNDEBUG  -I"C:/Users/mjh/R libraries/R-3.5.0/Rcpp/include"     -I./imslib/src/   -O2 -Wall  -mtune=generic -c imslib/src/ims/calib/linepairstabber.cpp -o imslib/src/ims/calib/linepairstabber.o
c:/Rtools/mingw_32/bin/g++  -I"C:/Users/mjh/R/R-36~1.0AL/include" -DNDEBUG  -I"C:/Users/mjh/R libraries/R-3.5.0/Rcpp/include"     -I./imslib/src/   -O2 -Wall  -mtune=generic -c imslib/src/ims/calib/matchmatrix.cpp -o imslib/src/ims/calib/matchmatrix.o
c:/Rtools/mingw_32/bin/g++  -I"C:/Users/mjh/R/R-36~1.0AL/include" -DNDEBUG  -I"C:/Users/mjh/R libraries/R-3.5.0/Rcpp/include"     -I./imslib/src/   -O2 -Wall  -mtune=generic -c imslib/src/ims/calib/linearpointsetmatcher.cpp -o imslib/src/ims/calib/linearpointsetmatcher.o
c:/Rtools/mingw_32/bin/g++  -I"C:/Users/mjh/R/R-36~1.0AL/include" -DNDEBUG  -I"C:/Users/mjh/R libraries/R-3.5.0/Rcpp/include"     -I./imslib/src/   -O2 -Wall  -mtune=generic -c imslib/src/ims/decomp/realmassdecomposer.cpp -o imslib/src/ims/decomp/realmassdecomposer.o
In file included from ./imslib/src/ims/alphabet.h:8:0,
                 from ./imslib/src/ims/decomp/decomputils.h:12,
                 from imslib/src/ims/decomp/realmassdecomposer.cpp:9:
./imslib/src/ims/element.h: In member function 'ims::Element::mass_type ims::Element::getMass(ims::Element::size_type) const':
./imslib/src/ims/element.h:166:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       for (int i=0; i < IsotopeDistribution::SIZE; i++) {
                       ^
In file included from imslib/src/ims/decomp/realmassdecomposer.cpp:9:0:
./imslib/src/ims/decomp/decomputils.h: In function 'std::pair<typename DecompositionWeights::alphabet_mass_type, typename DecompositionWeights::alphabet_mass_type> ims::DecompUtils::getMinMaxWeightsRoundingErrors(const DecompositionWeights&)':
./imslib/src/ims/decomp/decomputils.h:92:53: warning: typedef 'weight_type' locally defined but not used [-Wunused-local-typedefs]
  typedef typename DecompositionWeights::weight_type weight_type;
                                                     ^
c:/Rtools/mingw_32/bin/g++  -I"C:/Users/mjh/R/R-36~1.0AL/include" -DNDEBUG  -I"C:/Users/mjh/R libraries/R-3.5.0/Rcpp/include"     -I./imslib/src/   -O2 -Wall  -mtune=generic -c imslib/src/ims/utils/distribution.cpp -o imslib/src/ims/utils/distribution.o
c:/Rtools/mingw_32/bin/g++  -I"C:/Users/mjh/R/R-36~1.0AL/include" -DNDEBUG  -I"C:/Users/mjh/R libraries/R-3.5.0/Rcpp/include"     -I./imslib/src/   -O2 -Wall  -mtune=generic -c imslib/src/ims/distributionprobabilityscorer.cpp -o imslib/src/ims/distributionprobabilityscorer.o
c:/Rtools/mingw_32/bin/g++  -I"C:/Users/mjh/R/R-36~1.0AL/include" -DNDEBUG  -I"C:/Users/mjh/R libraries/R-3.5.0/Rcpp/include"     -I./imslib/src/   -O2 -Wall  -mtune=generic -c imslib/src/ims/characteralphabet.cpp -o imslib/src/ims/characteralphabet.o
In file included from ./imslib/src/ims/alphabet.h:8:0,
                 from ./imslib/src/ims/characteralphabet.h:6,
                 from imslib/src/ims/characteralphabet.cpp:3:
./imslib/src/ims/element.h: In member function 'ims::Element::mass_type ims::Element::getMass(ims::Element::size_type) const':
./imslib/src/ims/element.h:166:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       for (int i=0; i < IsotopeDistribution::SIZE; i++) {
                       ^
c:/Rtools/mingw_32/bin/g++  -I"C:/Users/mjh/R/R-36~1.0AL/include" -DNDEBUG  -I"C:/Users/mjh/R libraries/R-3.5.0/Rcpp/include"     -I./imslib/src/   -O2 -Wall  -mtune=generic -c imslib/src/ims/nitrogenrulefilter.cpp -o imslib/src/ims/nitrogenrulefilter.o
In file included from ./imslib/src/ims/composedelement.h:7:0,
                 from ./imslib/src/ims/nitrogenrulefilter.h:4,
                 from imslib/src/ims/nitrogenrulefilter.cpp:5:
./imslib/src/ims/element.h: In member function 'ims::Element::mass_type ims::Element::getMass(ims::Element::size_type) const':
./imslib/src/ims/element.h:166:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       for (int i=0; i < IsotopeDistribution::SIZE; i++) {
                       ^
c:/Rtools/mingw_32/bin/g++ -shared -s -static-libgcc -o Rdisop.dll tmp.def disop.o imslib/src/ims/element.o imslib/src/ims/composedelement.o imslib/src/ims/isotopedistribution.o imslib/src/ims/alphabet.o imslib/src/ims/weights.o imslib/src/ims/distributedalphabet.o imslib/src/ims/transformation.o imslib/src/ims/isotopespecies.o imslib/src/ims/base/parser/alphabettextparser.o imslib/src/ims/base/parser/distributedalphabettextparser.o imslib/src/ims/base/parser/massestextparser.o imslib/src/ims/base/parser/moleculesequenceparser.o imslib/src/ims/base/parser/standardmoleculesequenceparser.o imslib/src/ims/base/parser/keggligandcompoundsparser.o imslib/src/ims/base/parser/moleculeionchargemodificationparser.o imslib/src/ims/calib/linepairstabber.o imslib/src/ims/calib/matchmatrix.o imslib/src/ims/calib/linearpointsetmatcher.o imslib/src/ims/decomp/realmassdecomposer.o imslib/src/ims/utils/distribution.o imslib/src/ims/distributionprobabilityscorer.o imslib/src/ims/characteralphabet.o imslib/src/ims/nitrogenrulefilter.o -LC:/Users/mjh/R/R-36~1.0AL/bin/i386 -lR
installing to C:/Users/mjh/Downloads/Rdisop.buildbin-libdir/00LOCK-sneumann-Rdisop-6a06961/00new/Rdisop/libs/i386
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
  converting help for package 'Rdisop'
    finding HTML links ... done
    addMolecules                            html
    decomposeMass                           html
    getMolecule                             html
    initializeCHNOPS                        html
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
sneumann commented 5 years ago

Hi, on bioc-devel we had a report by Mike Smith (@grimbough) reproducing the failure:

I can reproduce the error using R-3.6.0beta and running the following two steps to replicate the Bioc builder commands:

R CMD build --keep-empty-dirs --no-resave-data Rdisop
rm -rf Rdisop.buildbin-libdir && mkdir Rdisop.buildbin-libdir && C:\Users\biocbuild\bbs-3.9-bioc\R\bin\R.exe CMD INSTALL --merge-multiarch --build --library=Rdisop.buildbin-libdir Rdisop_1.43.4.tar.gz

Bit of a guess, and I don't know why this would have changed, but the Rdisop_1.43.4.tar.gz produced by step one contains the *.o files referenced in the error.  If these were produced for 64-bit architecture then they'll fail when the build process tries to use them for the 32-bit binary.  Perhaps your Rcpp edits removed some cleanup code that was there before?  I note there's no Makevars.win or cleanup.win but my memory is a bit fuzzy on whether only versions with *.win will be run on Windows or if that's just a way to provide alternative code if needed.

Indeed, I removed the Makevars.win since it looked the same as the Linux version. The current 1.43.5 attempt now has some explicit find *.o | xargs rm" in thecleanup` script.

sneumann commented 5 years ago

Crap , both 1.43.4 and 1.43.5 work on the winbuilder

Rdisop-winbuilder_1.43.4.txt Rdisop-winbuilder_1.43.5.txt

sneumann commented 5 years ago

Hi @grimbough, you did it ! Just in time for the release Rdisop is green again ! Thanks for your contribution, yours, Steffen