Skip to content
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

Build success, but packed failed using QT deploy tool both win & mac #2228

Closed
wowliuzj opened this issue Apr 17, 2024 · 13 comments
Closed

Build success, but packed failed using QT deploy tool both win & mac #2228

wowliuzj opened this issue Apr 17, 2024 · 13 comments
Labels
installer question general questions

Comments

@wowliuzj
Copy link

wowliuzj commented Apr 17, 2024

Bug Report

Clone the code and follow the instruction open GPT4All-chat in QT, built and run successfully.

After running windeployqt in Windows 11 or macdeployqt in MacOS(intel chip) and run chat.exe directly
it reports FileNotFound libc++.dll and libunwin.dll in Windows11
if run in QT, the application output shows several warnings and exit -1.
[Warning] (Wed Apr 17 16:18:21 2024): QQmlApplicationEngine failed to load component
[Warning] (Wed Apr 17 16:18:21 2024): qrc:/gpt4all/main.qml:6:1: module "Qt5Compat.GraphicalEffects" is not installed
[Warning] (Wed Apr 17 16:18:21 2024): qrc:/gpt4all/main.qml:5:1: module "QtQuick.Layouts" is not installed
[Warning] (Wed Apr 17 16:18:21 2024): qrc:/gpt4all/main.qml:4:1: module "QtQuick.Controls.Basic" is not installed
[Warning] (Wed Apr 17 16:18:21 2024): qrc:/gpt4all/main.qml:3:1: module "QtQuick.Controls" is not installed
[Warning] (Wed Apr 17 16:18:21 2024): qrc:/gpt4all/main.qml: module "QtQml.WorkerScript" is not installed
[Warning] (Wed Apr 17 16:18:21 2024): qrc:/gpt4all/main.qml:1:1: module "QtCore" is not installed
[Warning] (Wed Apr 17 16:18:21 2024): qrc:/gpt4all/main.qml:6:1: module "Qt5Compat.GraphicalEffects" is not installed
[Warning] (Wed Apr 17 16:18:21 2024): qrc:/gpt4all/main.qml:5:1: module "QtQuick.Layouts" is not installed
[Warning] (Wed Apr 17 16:18:21 2024): qrc:/gpt4all/main.qml:4:1: module "QtQuick.Controls.Basic" is not installed
[Warning] (Wed Apr 17 16:18:21 2024): qrc:/gpt4all/main.qml:3:1: module "QtQuick.Controls" is not installed
[Warning] (Wed Apr 17 16:18:21 2024): qrc:/gpt4all/main.qml: module "QtQml.WorkerScript" is not installed
[Warning] (Wed Apr 17 16:18:21 2024): qrc:/gpt4all/main.qml:1:1: module "QtCore" is not installed
[Warning] (Wed Apr 17 16:18:21 2024): qrc:/gpt4all/main.qml:6:1: module "Qt5Compat.GraphicalEffects" is not installed
[Warning] (Wed Apr 17 16:18:21 2024): qrc:/gpt4all/main.qml:5:1: module "QtQuick.Layouts" is not installed
[Warning] (Wed Apr 17 16:18:21 2024): qrc:/gpt4all/main.qml:4:1: module "QtQuick.Controls.Basic" is not installed
[Warning] (Wed Apr 17 16:18:21 2024): qrc:/gpt4all/main.qml:3:1: module "QtQuick.Controls" is not installed
[Warning] (Wed Apr 17 16:18:21 2024): qrc:/gpt4all/main.qml: module "QtQml.WorkerScript" is not installed
[Warning] (Wed Apr 17 16:18:21 2024): qrc:/gpt4all/main.qml:1:1: module "QtCore" is not installed
[Warning] (Wed Apr 17 16:18:21 2024): qrc:/gpt4all/main.qml:6:1: module "Qt5Compat.GraphicalEffects" is not installed
[Warning] (Wed Apr 17 16:18:21 2024): qrc:/gpt4all/main.qml:5:1: module "QtQuick.Layouts" is not installed
[Warning] (Wed Apr 17 16:18:21 2024): qrc:/gpt4all/main.qml:4:1: module "QtQuick.Controls.Basic" is not installed
[Warning] (Wed Apr 17 16:18:21 2024): qrc:/gpt4all/main.qml:3:1: module "QtQuick.Controls" is not installed
[Warning] (Wed Apr 17 16:18:21 2024): qrc:/gpt4all/main.qml: module "QtQml.WorkerScript" is not installed
[Warning] (Wed Apr 17 16:18:21 2024): qrc:/gpt4all/main.qml:1:1: module "QtCore" is not installed
[Warning] (Wed Apr 17 16:18:21 2024): qrc:/gpt4all/main.qml:6:1: module "Qt5Compat.GraphicalEffects" is not installed
[Warning] (Wed Apr 17 16:18:21 2024): qrc:/gpt4all/main.qml:5:1: module "QtQuick.Layouts" is not installed
[Warning] (Wed Apr 17 16:18:21 2024): qrc:/gpt4all/main.qml:4:1: module "QtQuick.Controls.Basic" is not installed
[Warning] (Wed Apr 17 16:18:21 2024): qrc:/gpt4all/main.qml:3:1: module "QtQuick.Controls" is not installed
[Warning] (Wed Apr 17 16:18:21 2024): qrc:/gpt4all/main.qml: module "QtQml.WorkerScript" is not installed
[Warning] (Wed Apr 17 16:18:21 2024): qrc:/gpt4all/main.qml:1:1: module "QtCore" is not installed
[Warning] (Wed Apr 17 16:18:21 2024): qrc:/gpt4all/main.qml:6:1: module "Qt5Compat.GraphicalEffects" is not installed
[Warning] (Wed Apr 17 16:18:21 2024): qrc:/gpt4all/main.qml:5:1: module "QtQuick.Layouts" is not installed
[Warning] (Wed Apr 17 16:18:21 2024): qrc:/gpt4all/main.qml:4:1: module "QtQuick.Controls.Basic" is not installed
[Warning] (Wed Apr 17 16:18:21 2024): qrc:/gpt4all/main.qml:3:1: module "QtQuick.Controls" is not installed
[Warning] (Wed Apr 17 16:18:21 2024): qrc:/gpt4all/main.qml: module "QtQml.WorkerScript" is not installed
[Warning] (Wed Apr 17 16:18:21 2024): qrc:/gpt4all/main.qml:1:1: module "QtCore" is not installed
[Warning] (Wed Apr 17 16:18:21 2024): QIODevice::read (QNetworkReplyHttpImpl): device not open
[Warning] (Wed Apr 17 16:18:21 2024): ERROR: Couldn't parse: "" "illegal value"

Steps to Reproduce

  1. clone code from github
  2. open project in QT
  3. after build run windeployqt or macdeployqt
  4. try to run application

Your Environment

  • Bindings version (e.g. "Version" from pip show gpt4all): V 2.7.4
  • Operating System: Windows11 21H2, MacOS 12.7.4
  • QT Kit: Qt_6_7_0_llvm_mingw_64_bit
@wowliuzj wowliuzj added bindings gpt4all-binding issues bug-unconfirmed labels Apr 17, 2024
@cebtenzzre
Copy link
Member

The main supported way of installing GPT4All from source is to build an offline installer by adding GPT4ALL_OFFLINE_INSTALLER=ON to the CMake definitions, and running the package target. If you do anything else, I wouldn't expect it to work.

@cebtenzzre cebtenzzre closed this as not planned Won't fix, can't repro, duplicate, stale Apr 17, 2024
@cebtenzzre cebtenzzre removed the bindings gpt4all-binding issues label Apr 17, 2024
@wowliuzj
Copy link
Author

The main supported way of installing GPT4All from source is to build an offline installer by adding GPT4ALL_OFFLINE_INSTALLER=ON to the CMake definitions, and running the package target. If you do anything else, I wouldn't expect it to work.

Sorry, I am new to CMake, where should I add this ?

@cosmic-snow
Copy link
Collaborator

If by

  1. open project in QT

you mean Qt Creator, you should actually be able to find/see that in the CMake configuration table:
image

Or I guess you could add it manually in that string form mentioned above (not tried myself).

Don't forget to regenerate (Run CMake) and then rebuild, though. CMake is is creating your build configuration.

However, if you just want to run it from inside Qt Creator, that's possible, too, and you don't need to change anything for that. Do:

Build > Run Without Deployment

(near the bottom of the menu)

@wowliuzj
Copy link
Author

Here is my steps:
1, I turend option GPT4ALL_OFFLINE_INSTALLER ON in CMake configuration table,
2, rerun/regenerate CMake file
3, rebuild the project.
4, Open a new terminal and run "/Qt/6.8.0/macos/bin/macdeployqt /gpt4all/build-gpt4all-chat-Qt_6_8_0_for_macOS-Release/bin/gpt4all.app/Content/Macos/gpt4all -qmldir=/gpt4all/gpt4all-chat"
5, The program runs perfect in this Mac with Qt installed,
6, Copy the bundle to another Mac to run it but failed.
If I want to build in Mac and run it on other Macs, how should I do it?

@cosmic-snow
Copy link
Collaborator

cosmic-snow commented Apr 29, 2024

Not sure because I don't have a Mac, but with GPT4ALL_OFFLINE_INSTALLER ON you should actually produce an installer similar to the one that is offered through the website.

You would copy that to the other Macs and run it to start the installation.

To me, it doesn't look like that is what you did there in your steps. The installer should have bundled the Qt dependencies.

@wowliuzj
Copy link
Author

I did turn the option on
image
and also in the CMake file
image
But no matter I turn it on or off, the building result doesn't have much different.
I am using Qt 6.8.0 for macOS. But I didn't install XCode on my Mac, Should I install it?

@cosmic-snow
Copy link
Collaborator

cosmic-snow commented Apr 30, 2024

I was assuming you were also following the instructions of cebtenzzre:

... build an offline installer by adding GPT4ALL_OFFLINE_INSTALLER=ON to the CMake definitions, and running the package target.

But your latest comment makes me think that maybe you're only setting that option, but you aren't running the target package.

If that's the case, go to your build settings. Under the CMake options you can add a Build Step. Select CMake Build in the dropdown and you should see a new list with checkboxes ('Targets:'), one of them labelled PACKAGE. Activate that, then build again.

Here's how that checkbox looks on my end:
image
Then I get an installer in the build directory:
image

@cosmic-snow cosmic-snow added question general questions installer and removed bug-unconfirmed labels Apr 30, 2024
@wowliuzj
Copy link
Author

Yes, thanks for your remind. I missed the target part. But after I added build step and select target as package, the build failed with "ninja: build stopped: subcommand failed."
Is this correct?
image

@cosmic-snow
Copy link
Collaborator

If the first build step (whose command line is cut off in your screenshot) is actually compiling, then that should be fine, yes.

Can you open the 'Compile Output' View at the bottom and see if you can figure out what exactly has failed?

@wowliuzj
Copy link
Author

Here is the output, looks like I missed some part of Qt.
image

I removed the build folder, re-run the CMake file and re-build the project. Even if it failed. I run the macdeployqt command, and copy the bundle to a new created virtual machine. It is running! Real thanks for your help!
Let me fixed the QtIFW compiler "binarycreator", to see if whether it could generate a install package or not.

@cosmic-snow
Copy link
Collaborator

Good. But I'm not sure about that error. QtIFW is the Installer FrameWork and should be part of the Qt installation, if you've checked the right boxes when installing. Which I'm assuming you did because you were able to run deploy commands, but I'm not entirely sure whether those are part of QtIFW or not. Maybe make sure it's part of your installation?

@wowliuzj
Copy link
Author

This is the first time that I am using Qt. Just followed the instruction here to installed the Qt.
Not sure whether it related with XCode or not, since I didn't have it in my system. I will reinstall the Qt and try it again.
Thanks again for your help!

@cosmic-snow
Copy link
Collaborator

Ah right, one thing I've just noticed is that if you check build_and_run.md, the Qt Installer Framework isn't checked in that screenshot. See 'Developer and Designer Tools'. Maybe that's it.

Other than that I can't say more because I don't have a Mac anywhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
installer question general questions
Projects
None yet
Development

No branches or pull requests

3 participants