-
-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support to additional platforms #4
Conversation
Thank you very much for wanting to contribute a lot, but sorry I can't accept this because you made my library only run on the client side (Flutter App) |
Can you help me? |
Currently, we don't have a way to have a package like this one to work seamleslly for both Dart and Flutter.
I can try. Could you share the build errors you got as well as the details of your environment? |
I tried to compile on linux it shows an error like this ---
[ ] FAILED: plugins/whisper_flutter/shared/libwhisper.so
[ ] : && /usr/bin/clang++ -fPIC -std=c++2a -O3 -DNDEBUG -shared -Wl,-soname,libwhisper.so -o plugins/whisper_flutter/shared/libwhisper.so plugins/whisper_flutter/shared/CMakeFiles/whisper_flutter.dir/main.cpp.o
plugins/whisper_flutter/shared/libwhisper.a plugins/whisper_flutter/shared/libggml.a && :
[ ] /usr/bin/ld: plugins/whisper_flutter/shared/libwhisper.a(whisper.cpp.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
[ ] /usr/bin/ld: plugins/whisper_flutter/shared/libggml.a(ggml.c.o): relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC
[ ] clang: error: linker command failed with exit code 1 (use -v to see invocation)
----
[ ] ninja: build stopped: subcommand failed.
[ +10 ms] Building Linux application... (completed in 31.2s)
[ ] "flutter linux" took 34,237ms.
[ +3 ms] Build process failed
[ ]
#0 throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
#1 _runBuild (package:flutter_tools/src/linux/build_linux.dart:183:5)
<asynchronous suspension>
#2 buildLinux (package:flutter_tools/src/linux/build_linux.dart:76:5)
<asynchronous suspension>
#3 BuildLinuxCommand.runCommand (package:flutter_tools/src/commands/build_linux.dart:86:5)
<asynchronous suspension>
#4 FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1257:27)
<asynchronous suspension>
#5 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#6 CommandRunner.runCommand (package:args/command_runner.dart:209:13)
<asynchronous suspension>
#7 FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:283:9)
<asynchronous suspension>
#8 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#9 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:229:5)
<asynchronous suspension>
#10 run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:64:9)
<asynchronous suspension>
#11 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#12 main (package:flutter_tools/executable.dart:91:3)
<asynchronous suspension>
i don't have much experience in cpp and cmake languages |
@azkadev Could you try it again adding
|
Still can't, the same error appears, maybe if you don't mind + have time please make another pull request, sorry I bothered you because I don't really understand cpp + compile cmake Sorry, my English is bad |
(this fixes building on linux)
This reverts commit b6cce92.
@azkadev Don't worry, mate. |
Thank you very much for helping me, now thanks to you my library can run on various platforms |
Well... there is a lot of changes:
bin
)And as a consequence of all the above, it makes the code portable for other additional platforms (macOS and iOS) and also improves the use on the other already supported ones (without the need for a binary explicitly included in the project).
As specified in the
README
file, I tested it on the following devices/platforms:Windows 11 Pro 22H2 (22621.1105)
CPU: AMD Ryzen 3600
Ram: 16gb
Android 13
CPU: Snapdragon 730
Ram: 4gb
Pixel 3a API 33 Android x64 emulator
At the moment, I am not able to test it on macOS, iOS, and Linux, but it should work (it may need some minor tweaking).
Well, that's basically it. Thanks for coming up with the idea of migrating the code to dart and doing the initial setup!
I hope to be able to continue to contribute :)