Closed urim85 closed 6 months ago
Hi, the error codes are simply line numbers, but it looks like your code is quite different.
On both main and dev, if (file_size_ != file_size) return __LINE__;
should be line 218, not 155. Is the code modified?
I think the issue is that off_t on Android defaults to 32-bit. You can build with -D_FILE_OFFSET_BITS=64
which fixes it for 15c and above. We'll also change to lseek64, thanks for pointing this out :)
I think this is fixed now, please reopen if not.
It works well!!
But sentencepiece with add_definitions(-D_FILE_OFFSET_BITS=64) has an error.
/usr/lib/android-sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/fstream:968:9: error: use of undeclared identifier 'fseeko' if (fseeko(_file, __sp, SEEK_SET))
I put the definition like this
FetchContent_Declare(sentencepiece GIT_REPOSITORY https://github.com/google/sentencepiece GIT_TAG 53de76561cfc149d3c01037f0595669ad32a5e7c) FetchContent_MakeAvailable(sentencepiece)
add_definitions(-D_FILE_OFFSET_BITS=64)
FetchContent_Declare(highway GIT_REPOSITORY https://github.com/google/highway.git GIT_TAG da250571a45826b21eebbddc1e50d0c1137dee5f) FetchContent_MakeAvailable(highway)
Thank you very much!
Please help us out by searching for such error messages on the web :) This one is mentioned in https://developer.android.com/ndk/guides/common-problems, it seems we have to raise minSdkVersion to 24.
I have made Gemma executable to run on Android arm64-v8a with below option.
And it runs on my Android. However there is error for reading weights.
There is a failure in the "BlobReader::Open" function, on the line "blobstore->CheckValidity(IO::FileSize(filename))". The expected value of "IO::FileSize(filename)" is 3163184640, but it is currently returning 0.
However, before the line "hwy::CopySameSize(&bs, blobstore.get())" in the "BlobReader::Open" function, the "IO::FileSize(filename)" is functioning correctly.
Anyway, The comments in https://github.com/google/gemma.cpp/issues/21, it should work well.
Could you help me to figure out what I missed?