instantiations / es_compression

Compression framework for Dart providing FFI implementations for Brotli, Lz4, Zstd (Zstandard) with ready-to-use prebuilt binaries for Win/Linux/Mac.
https://www.instantiations.com
BSD 3-Clause "New" or "Revised" License
41 stars 8 forks source link

Building lz4 library for iOS (flutter) #27

Closed sburcher closed 2 years ago

sburcher commented 2 years ago

Hello, I'm trying to use the lz4 package in an iOS app I'm developing using flutter. I see that you have the blob builder tool to build the dynamic libraries. I can generate the eslz4-mac64.dylib library, but how do I generate a eslz4-ios64.dylib?

Then just to clarify, I can do the following in my flutter app:

import 'dart:convert'; import 'package:es_compression/lz4.dart';

final lz4codec = Lz4Codec.libraryPath = <path_to_es_compression>/eslz4-ios64.dylib

and then

print('Lz4 library version: ${lz4.libraryVersion}');

would print the lz4 version of the library? Is this how I can confirm that I've loaded the library?

If I direct the libraryPath to the mac64 library I get the following error:

Invalid argument(s): Failed to lookup symbol 'LZ4_versionNumber': dlsym(RTLD_DEFAULT, LZ4_versionNumber): symbol not found

sethloco commented 2 years ago

Hello,

I don't have an ios development platform, so I can't speak to exactly how eslz4-ios64.dylib should be generated. If you are able to do so, I am willing to have that added to the blob_builder. A contributor did one for android. Having one for ios would be nice

As to the second part involving mac64, can you tell me if this is mac M1(ARM) or Intel? This library comes prepackaged with win/linux/mac(intel) libraries. The lz4 example and test appear to line-up with what you are describing.

If you want to provide me the:

  1. Platform you are on (i.e. mac-M1)
  2. Instructions to how you built the dynamic library
  3. Test script that you expect to work

Then I will reproduce it on my end and see where the issue is.

sethloco commented 2 years ago

I’ll leave this open for a few more days