# CI/testing for big endian architectures?

**URL:** <https://discourse.julialang.org/t/ci-testing-for-big-endian-architectures/26671>\
**Category:** General Usage\
**Tags:** question\
**Created:** [July 23, 2019, 8:03am UTC](https://discourse.julialang.org/t/ci-testing-for-big-endian-architectures/26671 "2019-07-23T08:03:28Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [July 23, 2019, 8:03am UTC](https://discourse.julialang.org/t/ci-testing-for-big-endian-architectures/26671/1 "2019-07-23T08:03:28Z")

</div>

I am working on code for which byte order is relevant when unpacking binary data. My understanding is that most modern architectures are little-endian, so I could just put an

```julia
Base.ENDIAN_BOM == 0x04030201 || error("only little-endian is supported")

```

and be done with it.

Is this a reasonable approach? Or are there any big-endian architectures in use that I don’t know about? (I know little about these things).

If yes, is there a free CI service that allows testing?

(The issue is basically that the data is in little-endian format, with matching architecture I can just `mmap`, otherwise I need to `ltoh`).

---

<div class="post-metadata">

**Author:** ![pixel27](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pixel27/32/8902_2.png) [@pixel27](https://discourse.julialang.org/u/pixel27)\
**Post date:** [July 23, 2019, 11:57am UTC](https://discourse.julialang.org/t/ci-testing-for-big-endian-architectures/26671/2 "2019-07-23T11:57:15Z")

</div>

Some Atom CPUs are “switchable” that is the most likely big endian architecture us peons are likely to (currently) have access to. Other than that unless you expect this to run on mainframes you probably don’t have to worry about it…unless a new architecture is born that needs to be big endian for some reason.

Part of me shudders saying that…I might have a pathological need to ensure my code can run everywhere…

---

<div class="post-metadata">

**Author:** ![jpsamaroo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jpsamaroo/32/46804_2.png) [@jpsamaroo](https://discourse.julialang.org/u/jpsamaroo)\
**Post date:** [July 23, 2019, 11:59am UTC](https://discourse.julialang.org/t/ci-testing-for-big-endian-architectures/26671/3 "2019-07-23T11:59:48Z")

</div>

I’m pretty sure POWER9 CPUs are switchable at boot time as well, however these are also currently hard to come by (and are generally very expensive compared to x86-64). And Julia doesn’t have great support for them right now, last I recall.

---

<div class="post-metadata">

**Author:** ![jpsamaroo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jpsamaroo/32/46804_2.png) [@jpsamaroo](https://discourse.julialang.org/u/jpsamaroo)\
**Post date:** [July 23, 2019, 12:02pm UTC](https://discourse.julialang.org/t/ci-testing-for-big-endian-architectures/26671/4 "2019-07-23T12:02:33Z")

</div>

I would say throwing an error is the best approach if you don’t have access to big endian CI to test with (or desire to build in support). IMO, just say in your error, “Big endian is not _yet_ supported”, which implies that a PR to add support would be welcomed.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [July 23, 2019, 12:27pm UTC](https://discourse.julialang.org/t/ci-testing-for-big-endian-architectures/26671/5 "2019-07-23T12:27:58Z")

</div>

> [@jpsamaroo](#):
>
> implies that a PR to add support would be welcomed.

I always welcome PRs, but in this case I would not be able to test them, or commit to fixing issues (because I would not be able to reproduce them).

So my tentative conclusion is that for the time being, I would just rule out any architecture that is not little endian.

---

<div class="post-metadata">

**Author:** ![Daniel\_Berge](https://avatars.discourse-cdn.com/v4/letter/d/eb9ed0/32.png) [@Daniel\_Berge](https://discourse.julialang.org/u/Daniel_Berge)\
**Post date:** [July 23, 2019, 3:44pm UTC](https://discourse.julialang.org/t/ci-testing-for-big-endian-architectures/26671/6 "2019-07-23T15:44:33Z")

</div>

I’m working to make a package to read LabView TDMS files, which supports optional big endian layout. I’m debating as to whether to bother implementing support for it, when in practice it’s probably never used.

---

<div class="post-metadata">

**Author:** ![simonbyrne](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/simonbyrne/32/19_2.png) [@simonbyrne](https://discourse.julialang.org/u/simonbyrne)\
**Post date:** [July 23, 2019, 6:58pm UTC](https://discourse.julialang.org/t/ci-testing-for-big-endian-architectures/26671/7 "2019-07-23T18:58:15Z")

</div>

As far as I know, no one has ever run Julia on bigendian architecture. If you want to try, I would suggest asking for an account at OSU OSL [OpenStack POWER](https://osuosl.org/services/powerdev/). I would be keen to hear how you go.
