dosorio / Peptides

An R package to calculate indices and theoretical physicochemical properties of peptides and protein sequences.
80 stars 21 forks source link

Compilation fails #26

Closed jspaezp closed 5 years ago

jspaezp commented 5 years ago

Hello Daniel,

I Seem to be having an issue on windows regarding the compilation of the package.

The error log is as follows:

> devtools::install()
√  checking for file 'C:\Users\admin\git\Peptides/DESCRIPTION' (685ms)
-  preparing 'Peptides': (2.1s)
√  checking DESCRIPTION meta-information ... 
-  cleaning src
-  checking for LF line-endings in source and make files and shell scripts (604ms)
-  checking for empty or unneeded directories
-  looking to see if a 'data/datalist' file should be added
-  building 'Peptides_2.4.1.tar.gz'

Running "C:/PROGRA~1/R/R-36~1.0/bin/x64/Rcmd.exe" INSTALL "C:\Users\admin\AppData\Local\Temp\RtmpU32l4u/Peptides_2.4.1.tar.gz" \
  --install-tests 
* installing to library 'C:/Users/admin/Documents/R/win-library/3.6'
* installing *source* package 'Peptides' ...
** using staged installation
** libs
-
*** arch - i386
C:/Rtools/mingw_32/bin/g++  -I"C:/PROGRA~1/R/R-36~1.0/include" -DNDEBUG  -I"C:/Users/admin/Documents/R/win-library/3.6/Rcpp/include"        -O2 -Wall  -mtune=generic -c RcppExports.cpp -o RcppExports.o
C:/Rtools/mingw_32/bin/g++  -I"C:/PROGRA~1/R/R-36~1.0/include" -DNDEBUG  -I"C:/Users/admin/Documents/R/win-library/3.6/Rcpp/include"        -O2 -Wall  -mtune=generic -c charge_pI.cpp -o charge_pI.o
charge_pI.cpp: In function 'int pKscales(std::string)':
charge_pI.cpp:10:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for (int i = 0; i < sizeof(scales)/sizeof(scales[0]); i++){
                     ^
charge_pI.cpp:15:10: warning: 'sScale' may be used uninitialized in this function [-Wmaybe-uninitialized]
   return sScale;
          ^
C:/Rtools/mingw_32/bin/gcc  -I"C:/PROGRA~1/R/R-36~1.0/include" -DNDEBUG  -I"C:/Users/admin/Documents/R/win-library/3.6/Rcpp/include"        -O3 -Wall  -std=gnu99 -mtune=generic -c init.c -o init.o
C:/Rtools/mingw_32/bin/g++ -shared -s -static-libgcc -o Peptides.dll tmp.def RcppExports.o charge_pI.o init.o -LC:/PROGRA~1/R/R-36~1.0/bin/i386 -lR
:init.c:(.rdata+0x64): undefined reference to `Peptides_absoluteCharge'
init.o:init.c:(.rdata+0x70): undefined reference to `Peptides_chargeList'
init.o:init.c:(.rdata+0x7c): undefined reference to `Peptides_RcppExport_registerCCallable'
collect2.exe: error: ld returned 1 exit status
no DLL was created
ERROR: compilation failed for package 'Peptides'
* removing 'C:/Users/admin/Documents/R/win-library/3.6/Peptides'
* restoring previous 'C:/Users/admin/Documents/R/win-library/3.6/Peptides'

I feel like the relevant line would be ...

:init.c:(.rdata+0x64): undefined reference to `Peptides_absoluteCharge'
init.o:init.c:(.rdata+0x70): undefined reference to `Peptides_chargeList'
init.o:init.c:(.rdata+0x7c): undefined reference to `Peptides_RcppExport_registerCCallable'

is there any particular compiler that would be required that I am not aware of ?

unfortunately , my knowledge of c/cpp is not enough to help with further debugging.

Kindest wishes, Sebastian

dosorio commented 5 years ago

Hi Sebastian,

In Windows, you can install https://cran.r-project.org/bin/windows/Rtools/ or directly try the WinBuilder site from R project: https://win-builder.r-project.org/ to check the package.

I checked the code, and it passed the check --as-cran argument.

Best,

Daniel