marty1885 / paroli

Streaming TTS based on Piper with optional RK3588 NPU support
MIT License
44 stars 9 forks source link

Build Error: Cannot find MySQL. #8

Open carina-akaia opened 4 weeks ago

carina-akaia commented 4 weeks ago

Hi, I'm trying to build the program on Ubuntu 24.04 installed on Turing RK1 ( RK3588-based compute module ), but the server part build is crashing due to Cmake being unable to detect MySQL lib for Drogon:

-- jsoncpp verson:1.9.5
-- Found UUID: /usr/lib/aarch64-linux-gnu/libuuid.so
-- pg inc: /usr/include/postgresql/usr/include/postgresql/16/server
CMake Error at /usr/lib/aarch64-linux-gnu/cmake/Drogon/FindMySQL.cmake:98 (message):
  Cannot find MySQL.  Include dir: /usr/include/mysql library dir:
Call Stack (most recent call first):
  /usr/share/cmake-3.28/Modules/CMakeFindDependencyMacro.cmake:76 (find_package)
  /usr/lib/aarch64-linux-gnu/cmake/Drogon/DrogonConfig.cmake:62 (find_dependency)
  CMakeLists.txt:28 (find_package)

-- Configuring incomplete, errors occurred!

I have more than all the required packages installed ( for example, apparently it's looking for either MySQL or MariaDB, I installed both ) but still no progress.

P.S. I'm not a C/C++ programmer so I'd greatly appreciate any help, as I only wasted time trying to figure it out myself

Kracozebr commented 4 days ago

Hi, I have had the same problem and manage to fix it. First of to build paroli I installed a lot of packages:

sudo apt-get update && sudo apt-get install cmake build-essential drogon libdrogon-dev libjsoncpp-dev uuid-dev zlib1g-dev libpq-dev libsqlite3-dev libmysqlclient-dev libbrotli-dev libhiredis-dev libyaml-cpp-dev libogg-dev

Towards your problem I added few lines in cmakelists.txt before find_package(Drogon REQUIRED):

...
set(MYSQL_INCLUDE_DIR "/usr/include/mysql")
set(MYSQL_LIBRARIES "/usr/lib/aarch64-linux-gnu/libmysqlclient.so")
set(CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH}:/usr/lib/aarch64-linux-gnu")

find_package(Drogon REQUIRED)
...

but before check location of mysql:

find /usr/lib -name "libmysqlclient.so"
# my output is:
/usr/lib/aarch64-linux-gnu/libmysqlclient.so

So if your location is different then /usr/lib/aarch64-linux-gnu/ you should write it in cmakelists.txt