Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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

Open
bastistician opened this issue Nov 18, 2024 · 5 comments
Assignees

Comments

@bastistician
Copy link

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:

#if defined(COREARRAY_CYGWIN) || defined(COREARRAY_PLATFORM_MACOS) || defined(COREARRAY_PLATFORM_BSD)
return lseek(Handle, Offset, sk);
#else
return lseek64(Handle, Offset, sk);
#endif

#if defined(COREARRAY_CYGWIN) || defined(COREARRAY_PLATFORM_MACOS) || defined(COREARRAY_PLATFORM_BSD)
return ftruncate(Handle, NewSize)==0;
#else
return ftruncate64(Handle, NewSize)==0;
#endif

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
Copy link
Owner

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

@zhengxwen zhengxwen self-assigned this Nov 22, 2024
@bastistician
Copy link
Author

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".

@bastistician
Copy link
Author

Any chance this could be fixed in the next release? Unfortunately, I cannot install several other packages because they depend on 'gdsfmt'. Thanks!

@zhengxwen
Copy link
Owner

I am working on this issue now.

@zhengxwen
Copy link
Owner

The commit d91e2d0 should fix the issue.
gdsfmt_1.42.1 should be available on BioC release soon.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants