Git Product home page Git Product logo

Comments (20)

mschubert avatar mschubert commented on May 27, 2024 1

Can confirm this error on Gentoo but not Arch with R=3.5.3

from writexl.

viking avatar viking commented on May 27, 2024

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.

jeroen avatar jeroen commented on May 27, 2024

Are you compiling with C99?

from writexl.

mschubert avatar mschubert commented on May 27, 2024

No

from writexl.

jeroen avatar jeroen commented on May 27, 2024

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.

mschubert avatar mschubert commented on May 27, 2024
> 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.

jeroen avatar jeroen commented on May 27, 2024

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.

mschubert avatar mschubert commented on May 27, 2024

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.

jmcnamara avatar jmcnamara commented on May 27, 2024

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.

jmcnamara avatar jmcnamara commented on May 27, 2024

Here is my previous analysis of the issue when I hit it in libxlsxwriter: jmcnamara/libxlsxwriter#116 (comment)

from writexl.

jeroen avatar jeroen commented on May 27, 2024

@mschubert I added a workaround, can you try again installing from source?

remotes::install_github("ropensci/writexl")

from writexl.

mschubert avatar mschubert commented on May 27, 2024

Your workaround does not compile, unfortunately.

I suspect that something in the Gentoo tool chain

  1. defines OF, which is why they renamed it in the first place
  2. overwrites your macro (commenting out the #if still does not compile)

from writexl.

viking avatar viking commented on May 27, 2024

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.

viking avatar viking commented on May 27, 2024

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.

rfaelens avatar rfaelens commented on May 27, 2024

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.

jmcnamara avatar jmcnamara commented on May 27, 2024

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.

mschubert avatar mschubert commented on May 27, 2024

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.

jmcnamara avatar jmcnamara commented on May 27, 2024

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.

jeroen avatar jeroen commented on May 27, 2024

@jmcnamara should I just import the latest libxlsxwriter sources from your master branch?

from writexl.

jmcnamara avatar jmcnamara commented on May 27, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.