HDF.PINVOKE on IOS

Has anyone ever managed to run HDF.PInvoke on IOS?
I managed to run it without issues on an Android build, but I get exceptions when using H5T and H5F on IOS.
Do you know where that might come from?
Is there a correct way to handle the h5 file before calling read on IOS?

Hi, @frederic.seraphine !

Thank you for testing HDF5 on iOS!
Would you please share your error messages?

I’m curious because I could not even build HDF5 on my mac-12:

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Devel\
oper/SDKs/iPhoneOS16.2.sdk/usr/include/stdlib.h:184:6: note:
      'system' has been explicitly marked unavailable here
int      system(const char *) __DARWIN_ALIAS_C(system);
         ^
iopipe.c:94:14: error: 'system' is unavailable: not available on iOS
    status = system("df >/dev/null");
             ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Devel\
oper/SDKs/iPhoneOS16.2.sdk/usr/include/stdlib.h:184:6: note:
      'system' has been explicitly marked unavailable here
int      system(const char *) __DARWIN_ALIAS_C(system);
         ^
2 errors generated.

A colleague with a mac built the .a for me so I only tested the PInvoke
He told me that he actually failed to build 1.10.11 and ended up building 1.12.0 despite being above the advised version for HDF.PInvoke

In the end we could not run PInvoke because of one function on UNIX build that used a dlopen() in the H5DLLImporter (H5UnixDllImporter), when switching it to a static linking logic for IOS, it went nicely and now I can use HDF5 on IOS and didn’t encounter any further exception yet…

I will ask him what error he got when building the native libraries in version 1.10.11…

1 Like

That’s fantastic!

Yes, building HDF5 library only has no issue for iOS.

Can you ask your Mac colleague
if he can try building the latest HDF5 on visionOS?