I recently tried to install Rsubread on Cygwin. I did that a few months ago successfully and now I tried it with the same steps as last time (I wrote quite detailed instructions last time). Of course, the machine is different - last time I had Win7, R 3.1.3 installed in CYGWIN_NT-6.1 and RSubread 1.16.1. But anyway - I expect it to work:
The current setup is a Win 2012 R2 server, R 3.2.4 installed in CYGWIN_NT-6.3 and RSubread 1.20.6. The problem is the following:
> biocLite('Rsubread') BioC_mirror: https://bioconductor.org Using Bioconductor 3.2 (BiocInstaller 1.20.3), R 3.2.4 Revised (2016-03-16 r70336). Installing package(s) ‘Rsubread’ trying URL 'https://bioconductor.org/packages/3.2/bioc/src/contrib/Rsubread_1.20.6.tar.gz' Content type 'application/x-gzip' length 9247359 bytes (8.8 MB) ================================================== downloaded 8.8 MB * installing *source* package ‘Rsubread’ ... @@@@@ The operating system is CYGWIN_NT-6.3. ** libs gcc -I/usr/lib/R/include -DNDEBUG -DMAKE_FOR_EXON -D MACOS -D SUBREAD_VERSION="\"Rsubread 1.20.6\"" -ggdb -O2 -pipe -Wimplicit-function-declaration -std=gnu99 -fdebug-prefix-map=/cygdrive/e/cyg_pub/devel/R/R-3.2.4-1.x86_64/build=/usr/src/debug/R-3.2.4-1 -fdebug-prefix-map=/cygdrive/e/cyg_pub/devel/R/R-3.2.4-1.x86_64/src/R-revised=/usr/src/debug/R-3.2.4-1 -c HelperFunctions.c -o HelperFunctions.o HelperFunctions.c:30:24: fatal error: sys/sysctl.h: No such file or directory compilation terminated. make: *** [/usr/lib/R/etc/Makeconf:134: HelperFunctions.o] Error 1 ERROR: compilation failed for package ‘Rsubread’ * removing ‘/usr/lib/R/site-library/Rsubread’
I'm not sure, but sysctl.h should actually not even be included on Cygwin. The following is the include section in HelperFunctions.c:
#include <ctype.h> #include <string.h> #include <assert.h> #ifdef MACOS #include <sys/types.h> #include <sys/socket.h> #include <sys/ioctl.h> #include <sys/sysctl.h> #include <net/if.h> #include <net/if_dl.h> #include <netinet/in.h> #include <arpa/inet.h> #else #include <sys/ioctl.h> #include <net/if.h> #include <unistd.h> #include <netinet/in.h> #endif #include "subread.h" #include "gene-algorithms.h" #include "HelperFunctions.h"
As far as I understand it, sysctl.h should only be included if MACOS is defined - which was indeed the case (see above). However, that would mean that it used Makevars.MacOS or Makevars.SunOS... Why? It does recognize the Cygwin. Or do I miss something? Could that be fixed?
(note aside - what would be very obscure though if it could influence it: I access the machine with Microsoft Remote Desktop from a Mac... The old system ran instead on a Virtualbox - also on the Mac)
Thanks and best regards,
> sessionInfo() R version 3.2.4 Revised (2016-03-16 r70336) Platform: x86_64-unknown-cygwin (64-bit) Running under: CYGWIN_NT-6.3 WINDOWS-P8HLEBT 2.5.1(0.297/5/3) 2016-04-21 22:14 x86_64 Cygwin locale:  en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8 attached base packages:  stats graphics grDevices utils datasets methods base