Percona-Lab / query-playback

Query Playback
Other
106 stars 47 forks source link

CMake Error: MYSQL_LIB #40

Closed utdrmac closed 6 years ago

utdrmac commented 6 years ago

Fresh CentOS7 install.

    1  yum -y install tbb tbb-devel cmake boost boost-devel gcc gcc-c++ git
    2  yum install http://www.percona.com/downloads/percona-release/redhat/0.1-4/percona-release-0.1-4.noarch.rpm
    4  yum install Percona-Server-client-57 Percona-Server-devel-57.x86_64 -y
[root@vimeo-mysql-test-3 build_dir]# cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo ..
-- The C compiler identification is GNU 4.8.5
-- The CXX compiler identification is GNU 4.8.5
-- Check for working C compiler: /bin/cc
-- Check for working C compiler: /bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /bin/c++
-- Check for working CXX compiler: /bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Could NOT find Doxygen (missing:  DOXYGEN_EXECUTABLE)
-- Boost version: 1.53.0
-- Found the following Boost libraries:
--   system
--   thread
--   regex
--   program_options
--   chrono
Processing plugin error_report
Processing plugin full_report
Processing plugin general_log
Processing plugin mysql_client
Processing plugin null_dbclient
Processing plugin query_log
Processing plugin simple_report
Processing plugin thread_per_connection
Processing plugin thread_pool
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
MYSQL_LIB
    linked by target "mysql_client" in directory /root/query-playback/percona_playback/mysql_client
utdrmac commented 6 years ago
[root@vimeo-mysql-test-3 build_dir]# find /usr -name "*mysqlclient*"
/usr/lib64/pkgconfig/mysqlclient.pc
/usr/lib64/mysql/libmysqlclient.so.18.1.0
/usr/lib64/mysql/libmysqlclient_r.so.18.1.0
/usr/lib64/mysql/libmysqlclient_r.so.18.0.0
/usr/lib64/mysql/libmysqlclient_r.so.18
/usr/lib64/mysql/libmysqlclient.so.20
/usr/lib64/mysql/libmysqlclient.so.20.3.6
/usr/lib64/mysql/libmysqlclient.so.18
/usr/lib64/mysql/libmysqlclient.a
/usr/lib64/mysql/libmysqlclient.so
utdrmac commented 6 years ago

Removing "_r" allowed this to compile. IIRC, _r libs were removed a while back no?

find_library(MYSQL_LIB "mysqlclient" PATH_SUFFIXES "mysql")
Trashtravis commented 6 years ago

Hitting the exactly same error to compile.

Hi @utdrmac ,

Removing the /usr/lib64/mysql/libmysqlclient_r.* libs didn't solve for me. Could you share what did you do in more detail if possible? It's been a wreck to debug that I may be missing something.

Thank you.

utdrmac commented 6 years ago

@Trashtravis As I understand it, this project is officially dead. You may want to look at ProxySQL's query mirroring functionality as a replacement. I haven't touched query-playback since last dec when I posted this.

It's not about removing the _r libs from the path. It's about editing the Cmake files and finding that line (find_library) and editing it to remove the "_r" so that the line reads as I pasted in the above comment.

stefanproell commented 6 years ago

The comment from @utdrmac helped in my case. I could compile and install Percona Query Playback as follows under Ubuntu:

sudo apt-get install libtbb-dev libmysqlclient-dev libboost-program-options-dev libboost-thread-dev libboost-regex-dev libboost-system-dev libboost-chrono-dev pkg-config cmake  libssl-dev
git clone https://github.com/Percona-Lab/query-playback.git

Then edit the file ~/git/query-playback/percona_playback/mysql_client/CMakeLists.txt and remove the suffix as described. Make sure to have this line here

find_library(MYSQL_LIB "mysqlclient" PATH_SUFFIXES "mysql")

and proceed with

cd ~/git/query-playback/build_dir
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo ..
make
sudo make install
vingarzan commented 3 years ago

I also had to do export LDFLAGS="-Wl,--copy-dt-needed-entries", as I got some complaints about:

/usr/bin/ld: /usr/lib64/mysql/libmysqlclient.a(my_compress.c.o): undefined reference to symbol 'uncompress'
/lib64/libz.so.1: error adding symbols: DSO missing from command line

I think the issue could be different, but I'm leaving this here, maybe it helps someone else too. Seems that the linking might need some improvements, as the libs must now be all included and won't be automatically work for a dependency of a dependency.

MJabirBaig commented 2 years ago

Hi,

I am doing a load test using percona-playback for MariaDB-10.6 on ubuntu-18, when I am running percona playback it is looking into a test database for all the tables instead of respective databases, can someone help me with this, I am attaching the errors below.

Error during query: Table 'test.xxx' doesn't exist, number of tries 1 of 1 Error during query: Table 'test.xxx' doesn't exist, number of tries 1 of 1

percona-playback --mysql-max-retries=0 --mysql-user=root --mysql-password=***** --mysql-host=127.0.0.1 --mysql-port=3306 --mysql-socket=/var/run/mysqld/mysqld.sock --db-plugin=libmysqlclient --query-log-file=/usr/local/src/mariadb-slow.log

I used this option as well - --mysql-test-connect=off

it is doing this for all the database tables. I am attaching the installation procedure below.

https://gist.github.com/zazabe/e5b4f1fd5135b5e7afb7c4a55142a7f7

zachBridges commented 1 year ago

An alternative to building query-playback without troubleshooting libraries and their various versions is to use an older operating system whose maximum package versions closer match the last time this project was worked on. I was able to build query-playback on Ubuntu 18.04 without having to dig through versions of tbb, boost, etc. Cheers!