From 969ff0ee6b204f9a33bcd57c9f3b6fb5d1c6900c Mon Sep 17 00:00:00 2001 From: Adam Treat Date: Mon, 5 Jun 2023 10:50:16 -0400 Subject: [PATCH] Fix installers for windows and linux. --- gpt4all-chat/cmake/deploy-qt-linux.cmake.in | 3 +++ gpt4all-chat/cmake/deploy-qt-windows.cmake.in | 9 --------- gpt4all-chat/llm.cpp | 3 +++ 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/gpt4all-chat/cmake/deploy-qt-linux.cmake.in b/gpt4all-chat/cmake/deploy-qt-linux.cmake.in index 8c4240f1..b560736f 100644 --- a/gpt4all-chat/cmake/deploy-qt-linux.cmake.in +++ b/gpt4all-chat/cmake/deploy-qt-linux.cmake.in @@ -6,6 +6,9 @@ set(BIN_DIR ${DATA_DIR}/bin) set(Qt6_ROOT_DIR "@Qt6_ROOT_DIR@") set(ENV{LD_LIBRARY_PATH} "${BIN_DIR}:${Qt6_ROOT_DIR}/../lib/") execute_process(COMMAND ${LINUXDEPLOYQT} ${BIN_DIR}/chat -qmldir=${CMAKE_CURRENT_SOURCE_DIR} -bundle-non-qt-libs -qmake=${Qt6_ROOT_DIR}/bin/qmake -verbose=2) +file(GLOB MYLLMODELLIBS ${CPACK_TEMPORARY_INSTALL_DIRECTORY}/packages/${COMPONENT_NAME_MAIN}/data/lib/*llmodel.*) +file(COPY ${MYLLMODELLIBS} + DESTINATION ${CPACK_TEMPORARY_INSTALL_DIRECTORY}/packages/${COMPONENT_NAME_MAIN}/data/bin) file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/icons/logo-32.png" DESTINATION ${DATA_DIR}) file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/icons/logo-48.png" diff --git a/gpt4all-chat/cmake/deploy-qt-windows.cmake.in b/gpt4all-chat/cmake/deploy-qt-windows.cmake.in index 0c432e4e..ff4ff6d8 100644 --- a/gpt4all-chat/cmake/deploy-qt-windows.cmake.in +++ b/gpt4all-chat/cmake/deploy-qt-windows.cmake.in @@ -2,16 +2,7 @@ set(WINDEPLOYQT "@WINDEPLOYQT@") set(COMPONENT_NAME_MAIN "@COMPONENT_NAME_MAIN@") set(CMAKE_CURRENT_SOURCE_DIR "@CMAKE_CURRENT_SOURCE_DIR@") execute_process(COMMAND ${WINDEPLOYQT} --qmldir ${CMAKE_CURRENT_SOURCE_DIR} ${CPACK_TEMPORARY_INSTALL_DIRECTORY}/packages/${COMPONENT_NAME_MAIN}/data/bin) -file(GLOB MYGPTJLIBS ${CPACK_TEMPORARY_INSTALL_DIRECTORY}/packages/${COMPONENT_NAME_MAIN}/data/lib/*gptj.*) -file(GLOB MYMPTLIBS ${CPACK_TEMPORARY_INSTALL_DIRECTORY}/packages/${COMPONENT_NAME_MAIN}/data/lib/*mpt.*) -file(GLOB MYLLAMALIBS ${CPACK_TEMPORARY_INSTALL_DIRECTORY}/packages/${COMPONENT_NAME_MAIN}/data/lib/*llama.*) file(GLOB MYLLMODELLIBS ${CPACK_TEMPORARY_INSTALL_DIRECTORY}/packages/${COMPONENT_NAME_MAIN}/data/lib/*llmodel.*) -file(COPY ${MYGPTJLIBS} - DESTINATION ${CPACK_TEMPORARY_INSTALL_DIRECTORY}/packages/${COMPONENT_NAME_MAIN}/data/bin) -file(COPY ${MYMPTLIBS} - DESTINATION ${CPACK_TEMPORARY_INSTALL_DIRECTORY}/packages/${COMPONENT_NAME_MAIN}/data/bin) -file(COPY ${MYLLAMALIBS} - DESTINATION ${CPACK_TEMPORARY_INSTALL_DIRECTORY}/packages/${COMPONENT_NAME_MAIN}/data/bin) file(COPY ${MYLLMODELLIBS} DESTINATION ${CPACK_TEMPORARY_INSTALL_DIRECTORY}/packages/${COMPONENT_NAME_MAIN}/data/bin) file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/icons/logo-32.png" diff --git a/gpt4all-chat/llm.cpp b/gpt4all-chat/llm.cpp index 80674b74..c998d5f8 100644 --- a/gpt4all-chat/llm.cpp +++ b/gpt4all-chat/llm.cpp @@ -26,6 +26,9 @@ LLM::LLM() , m_compatHardware(true) { QString llmodelSearchPaths = QCoreApplication::applicationDirPath(); + const QString libDir = QCoreApplication::applicationDirPath() + "/../lib/"; + if (directoryExists(libDir)) + llmodelSearchPaths += ";" + libDir; #if defined(Q_OS_MAC) const QString binDir = QCoreApplication::applicationDirPath() + "/../../../"; if (directoryExists(binDir))