Comments (20)
Can confirm this error on Gentoo but not Arch with R=3.5.3
from writexl.
FWIW, I can build this library on my system without any problems (assuming this is where libxlsxwriter comes from): https://github.com/jmcnamara/libxlsxwriter.
from writexl.
Are you compiling with C99?
from writexl.
No
from writexl.
What is your R CMD config CC
? It should have -std=gnu99
.
Try setting CC = gcc -std=gnu99
in your $(R RHOME)/etc/Makeconf
.
from writexl.
> R CMD config CC
x86_64-pc-linux-gnu-gcc
> x86_64-pc-linux-gnu-gcc --version
x86_64-pc-linux-gnu-gcc (Gentoo 8.3.0-r1 p1.1) 8.3.0
No change when adding CC = x86_64-pc-linux-gnu-gcc -std=gnu99
to Makeconf
from writexl.
So it's complaining about the OF()
macro which should be defined in your system zlib in zconf.h
. For example on my macOS I see in /usr/include/zconf.h
:
#ifndef OF /* function prototypes */
# ifdef STDC
# define OF(args) args
# else
# define OF(args) ()
# endif
#endif
Do you have the same? @jmcnamara have you seen such compilation errors in minizip before?
from writexl.
There is no definition of OF
in my zconf.h
on Gentoo (and there is on Arch).
The corresponding lines on Gentoo are instead:
#ifndef _Z_OF /* function prototypes */
# ifdef STDC
# define _Z_OF(args) args
# else
# define _Z_OF(args) ()
# endif
#endif
from writexl.
This is an issue/feature on Gentoo where they helpfully redefine the zlib OF()
. They have reasons but it just bites everyone.
Libxlsxwriter has a build system work around for this:
jmcnamara/libxlsxwriter@32be6b9
from writexl.
Here is my previous analysis of the issue when I hit it in libxlsxwriter: jmcnamara/libxlsxwriter#116 (comment)
from writexl.
@mschubert I added a workaround, can you try again installing from source?
remotes::install_github("ropensci/writexl")
from writexl.
Your workaround does not compile, unfortunately.
I suspect that something in the Gentoo tool chain
- defines
OF
, which is why they renamed it in the first place - overwrites your macro (commenting out the
#if
still does not compile)
from writexl.
This is still an issue for me with R 3.6.1. I'm using Gentoo just like @mschubert, which I failed to mention earlier.
$ R CMD config CC
/usr/bin/gcc
$ gcc --version
gcc (Gentoo 8.3.0-r1 p1.1) 8.3.0
from writexl.
I was able to get it to build using the same technique as @jmcnamara. I don't know how portable it is though. https://github.com/viking/writexl/commit/aac41d2b7445a8609c1f060f604409a1ba655787
from writexl.
For future reference:
The gentoo issue: https://bugs.gentoo.org/383179
The temporary fix: devtools::install_github("viking/writexl@issue-34")
The proper fix: change libxslxwriter
to use libminizip
@viking: I suggest you change the title to "libxslxwriter compilation issue in gentoo", and file the bug at libxlsxwriter
instead of here.
from writexl.
I suggest you change the title to "libxslxwriter compilation issue in gentoo", and file the bug at libxlsxwriter instead of here.
@rfaelens Nope. Libxlsxwriter compiles fine on Gentoo and libxlsxwriter already provides a way of compiling with libminizip.
from writexl.
I bumped into this again today. None of the workaround mentioned above worked, but adding to ~/.R/Makevars
does:
CFLAGS += -DOF=_Z_OF
2022-07-31 Note if you find this for a related issue: setting this flag permanently breaks installation of the digest
R package
from writexl.
I'm the author and maintainer of libxlsxwriter and just to let you know that I've put a fix for this issue into the source code rather than the build system to avoid issues like this where the libxlsxwriter build system(s) isn't used on Gentoo or Gentoo derived systems.
So hopefully we can make this issue go away in the near future.
@jeroen I've been using R recently and for my own sake I'd like to fix this and some other maintenance issues, and maybe extend some of the functionality. If you are interested let me know: [email protected]
from writexl.
@jmcnamara should I just import the latest libxlsxwriter sources from your master branch?
from writexl.
@jeroen Let me see if I can resolve issue jmcnamara/libxlsxwriter#273 as well and then you can pull the fixed code. I'll let you know.
from writexl.
Related Issues (20)
- Consider improving error message when a named sheet name exceeds the max character length supported by Excel HOT 3
- write_xlsx fails silently if no path argument supplied HOT 1
- Error in libxlsxwriter: 'String exceeds Excel's limit of 32,767 characters.' HOT 5
- NAs HOT 2
- Never ever remove Clippy! HOT 4
- Error in libxlsxwriter : 'Worksheet row or column index out of range.' HOT 2
- Time only POSIXct columns end up a day out HOT 3
- I Loved Clippy !
- writexl::write_xlsx incompatibility with openxlsx HOT 3
- write_xlsx gives 2 errors when writing dates with NA - version 1.4.1 HOT 4
- writexl1.4.1 bug: Empty field -> "nan(snan) HOT 5
- write_xlsx directory
- Write / overwrite a sheet in an existing excel workbook (without overwriting entire workbook)? HOT 2
- Bug: Clippy does not appear! HOT 1
- Dont try to write more than max rows
- Mention openxlsx2 as an alternative to write content
- Feature Request: Make Clippy togglable
- Failure when the storage type of `POSIXct` is `integer`
- Support NetBSD, thanks HOT 3
- write xlsx without any fonts HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from writexl.