zhengxwen / gdsfmt

R Interface to CoreArray Genomic Data Structure (GDS) Files (Development version only)
http://www.bioconductor.org/packages/gdsfmt
18 stars 4 forks source link

installation fails on Alpine Linux: lseek64 and ftruncate64 not defined #38

Open bastistician opened 5 days ago

bastistician commented 5 days ago

Package 'gdsfmt' currently fails installation on Alpine Linux (or, more generally, under musl libc). I get:

CoreArray/dPlatform.cpp:1212:32: error: 'lseek64' was not declared in this scope; did you mean 'lseek'?
CoreArray/dPlatform.cpp:1228:32: error: 'ftruncate64' was not declared in this scope; did you mean 'ftruncate'?

The corresponding code already seems to take care of cygwin/mac/BSD:

https://github.com/zhengxwen/gdsfmt/blob/3109e86385b5aa60d05dee88172fd25c025a0f10/src/CoreArray/dPlatform.cpp#L1209-L1213 https://github.com/zhengxwen/gdsfmt/blob/3109e86385b5aa60d05dee88172fd25c025a0f10/src/CoreArray/dPlatform.cpp#L1225-L1229

As there is no __MUSL__ macro by design, maybe add something like || (defined(COREARRAY_PLATFORM_LINUX) && !defined(__GLIBC__)) to also enter the first branch? (This assumes features.h has been included at that point, which I did not check.)

zhengxwen commented 1 day ago

Could you please show me sessionInfo() in R, the gcc version, and the gdsfmt version?

bastistician commented 1 day ago

You could reproduce the error using the rhub/r-minimal Docker image with the following oneliner:

docker run --rm -t rhub/r-minimal installr -d zhengxwen/gdsfmt

This will use the current development version from GitHub.

I have originally observed the installation failure using released 'gdsfmt' 1.42.0 in current R 4.4.2 on an Alpine Linux 3.20 system with C++ compiler g++ (Alpine 13.2.1_git20240309) 13.2.1 20240309. R.version$platform is "x86_64-pc-linux-musl", R.version$os is "linux-musl".