GithubHelp home page GithubHelp logo

Comments (3)

jmcnamara avatar jmcnamara commented on June 12, 2024

For a big endian system you will need to pass the USE_BIG_ENDIAN flag:

http://libxlsxwriter.github.io/getting_started.html#gsg_endian

I didn’t see that in the Cmake flags in the failed build (but I may have missed it because I’m traveling and reading this on my phone).

Could you try add that if it isn’t being used.

That doesn’t explain why it passed earlier but try that as a starting point.

Obviously 1.1.5 fails on all big-endian architectures (powerpc, hp-ux, sparc).

Since this looks like a regression, bisecting the code base may help.

Do l need a big endian system to reproduce this? As far as I remember you can’t use a big-endian VM guest on a little endian host. Is that correct or can you cross compile and run the tests on a little-endian system?

When I developed the USE_BIG_ENDIAN feature I used a ~20 year old Power PC mac Mini that I brought down from the attic. :-)

from libxlsxwriter.

hosiet avatar hosiet commented on June 12, 2024

Thanks. However, USE_BIG_ENDIAN is only present in hand-written Makefile, and was never placed in the logic of CMake:

-> % git rev-parse --short HEAD
4aaca54c
-> % cat CMakeLists.txt | grep ENDIAN | wc -l
0

My thought is that the control of using big-endian or not should not be configurable, but rather depends on the target build platform. With my personal preference, I would like to suggest the following patch to completely get rid of manual defining a macro (I release this code snippet under the same license as libxlsxwriter, BSD-2-Clause):

diff --git a/CMakeLists.txt b/CMakeLists.txt
index fb5a2f5..8996c31 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -243,6 +243,13 @@ if(BUILD_TESTS)
     list(APPEND LXW_PRIVATE_COMPILE_DEFINITIONS TESTING)
 endif()
 
+# Define "LXW_BIG_ENDIAN" macro on big-endian architectures
+include(TestBigEndian)
+TEST_BIG_ENDIAN(LXW_TARGET_BIG_ENDIAN)
+if(LXW_TARGET_BIG_ENDIAN)
+    list(APPEND LXW_PRIVATE_COMPILE_DEFINITIONS LXW_BIG_ENDIAN)
+endif()
+
 file(GLOB LXW_SOURCES src/*.c)
 file(GLOB_RECURSE LXW_HEADERS RELATIVE include *.h)

Let me know whether that looks good to you. I am applying this patch for a Debian's trial build 1.1.5-1~exp3, and you will be able to see the build results within the next 24 hours at https://buildd.debian.org/status/package.php?p=libxlsxwriter&suite=experimental . If the patch is working, we should see that all big-endian builds pass again.

from libxlsxwriter.

jmcnamara avatar jmcnamara commented on June 12, 2024

Thanks for the patch. That is a better solution.

I have applied it to main.

from libxlsxwriter.

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.