On 18.03.2015 00:36, Fay Hou wrote:
Google said adding "-lcrypto -lssl" to $MYSQLLIBS may solve the problem
That may work, depending on which version of sysbench you're trying to compile. You had to put that on the ./configure command line like so ./configure --with-mysql-libs "... -lssl -lcrypto"
but, I am not sure how to hack the makefile “wakefile” to add "-lcrypto -lssl” to the command line.
You don't have to. In this case it's easy. Linking sysbench is the last step in the build process. So it is enough to just run the corrected command line manually. Example: you get the following output --- /bin/bash ../libtool --tag=CC --mode=link gcc -pthread -g -O2 -o sysbench sysbench.o sb_timer.o sb_options.o sb_logger.o db_driver.o tests/fileio/libsbfileio.a tests/threads/libsbthreads.a tests/memory/libsbmemory.a tests/cpu/libsbcpu.a tests/oltp/libsboltp.a tests/mutex/libsbmutex.a drivers/mysql/libsbmysql.a -L/usr/local/mysql/current/lib64 -lmysqlclient_r -lpthread -lz -lm -ldl -laio -lm ... Makefile:323: recipe for target 'sysbench' failed make[2]: *** [sysbench] Error 1 make[2]: Leaving directory '/tmp/sysbench-0.4.12/sysbench --- First thing to notice is the missing -lssl -lcrypto. Second thing: make was in the subdirectory "sysbench" when it ran the failed command. So let's go to that subdir too and correct the mistake: --- /tmp/sysbench-0.4.12 $cd sysbench /tmp/sysbench-0.4.12/sysbench $gcc -pthread -g -O2 -o sysbench sysbench.o sb_timer.o sb_options.o sb_logger.o db_driver.o tests/fileio/libsbfileio.a tests/threads/libsbthreads.a tests/memory/libsbmemory.a tests/cpu/libsbcpu.a tests/oltp/libsboltp.a tests/mutex/libsbmutex.a drivers/mysql/libsbmysql.a -L/usr/local/mysql/current/lib64 -lmysqlclient_r -lpthread -lz -lm -lssl -lcrypto -ldl -laio -lm --- And here we are (no error message). Notice that I just copied and pasted the command line that gave the error and added the missing libs manually. I also left out the libtool foo at the beginning. The reason why you get this error is one of: - broken MySQL installation; check what "mysql_config --libs" returns. Does it include -lss and -lcrypto? - broken sysbench source - broken version of autotools installed the last two could also be "sybench source relying on different autotools version than installed". For me it happens every second or so build of sysbench that I get this type of error. But I build many different releases of sysbench on many different platforms. XL