# macOS ARM64 configure error

**URL:** <https://discourse.vtk.org/t/macos-arm64-configure-error/8689>\
**Category:** Development\
**Created:** [June 9, 2022, 10:56am UTC](https://discourse.vtk.org/t/macos-arm64-configure-error/8689 "2022-06-09T10:56:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ocommowi](https://discourse.vtk.org/user_avatar/discourse.vtk.org/ocommowi/32/5308_2.png) [@ocommowi](https://discourse.vtk.org/u/ocommowi)\
**Post date:** [June 9, 2022, 10:56am UTC](https://discourse.vtk.org/t/macos-arm64-configure-error/8689/1 "2022-06-09T10:56:48Z")

</div>

Hi,

I am currently compiling VTK on its release branch for a project on github and I’m testing ARM64 build. The build is made on an intel mac (github actions slave) and I tested two things : setting osx architectures in cmake either to “x86\_64;arm64” or “arm64”.

And here comes the problem : while it works smoothly with the first option, the cmake configure fails on hdf5 with the second option. You might check the full log here (hope you have access) : [Merge pull request #92 from Inria-Empenn/stanisz-sum-truncation · Inria-Empenn/Anima-Public@517dbaf · GitHub](https://github.com/Inria-Empenn/Anima-Public/runs/6810338175?check_suite_focus=true)

Otherwise the error is the following :  
– Check size of \_\_float128  
– Check size of \_\_float128 - failed  
– Check size of \_Quad  
– Check size of \_Quad - failed  
CMake Error at ThirdParty/hdf5/vtkhdf5/config/cmake/ConfigureChecks.cmake:367 (list):  
list index: 1 out of range (-1, 0)  
Call Stack (most recent call first):  
ThirdParty/hdf5/vtkhdf5/CMakeLists.txt:503 (include)

Would anyone have any idea what happens here and if there is something that could be done / a bug correction may be ?

Thanks

---

<div class="post-metadata">

**Author:** ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)\
**Post date:** [June 9, 2022, 3:32pm UTC](https://discourse.vtk.org/t/macos-arm64-configure-error/8689/2 "2022-06-09T15:32:14Z")

</div>

> [@ocommowi](#):
>
> CMake Error at ThirdParty/hdf5/vtkhdf5/config/cmake/ConfigureChecks.cmake:367 (list):  
> list index: 1 out of range (-1, 0)

As a note, this is a problem with HDF5’s environment detection strategies. It does `try_run` kind of things to extract out information from the environment. But I guess you’re cross compiling here and not actually on an arm64 machine. I’m actually rather surprised that the former worked and the latter did not (though maybe you’re on an x86\_64 host which masks the arm64 problem). This kind of gathering is completely broken for cross-compilation (you can’t generally run the binary) and multi-arch builds because running it only answers the question for one of the targets.

---

<div class="post-metadata">

**Author:** ![Michael\_Jackson](https://discourse.vtk.org/user_avatar/discourse.vtk.org/michael_jackson/32/61_2.png) [@Michael\_Jackson](https://discourse.vtk.org/u/Michael_Jackson)\
**Post date:** [June 9, 2022, 8:09pm UTC](https://discourse.vtk.org/t/macos-arm64-configure-error/8689/3 "2022-06-09T20:09:34Z")

</div>

The take away here is that you basically cannot cross compile HDF5 due to their detection system. I went through this back in the PPC → Intel transition and I basically had to compile our software on 2 different machines for a while.

This is what you CAN do:

On intel x86\_64 you can comple x86\_64 code. Period. Hard Stop.

On ARM64 you can separately compile x86\_64 and ARM64 and then use “lipo” to put them all together into a single binary.

What you CANNOT do is try to compile both x86\_64 and ARM64 _ **at the same time** _. It will not work.

---

<div class="post-metadata">

**Author:** ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)\
**Post date:** [June 9, 2022, 9:00pm UTC](https://discourse.vtk.org/t/macos-arm64-configure-error/8689/4 "2022-06-09T21:00:48Z")

</div>

I’ll just note here that CMake supports doing combined compiles, some projects just make assumptions that make that impossible (in short: anything that does `try_run` to determine build configuration setup).
