docker容器启动centos7.9系统,官网下载GreatSQL-GreatSQL-5.7.36-39.tar.gz源码,解压后进入GreatSQL-GreatSQL-5.7.36-39/build-gs目录参考README.md执行编译源码命令 bash -xe ./percona-server-5.7_builder.sh --builddir=`pwd`/workdir --get_sources=0 --install_deps=1 --with_ssl=1 --build_tarball=1 --no_git_info=1 --local_boost=1 编译失败,CMakeError.log报错如下,找不到pthread库函数定义,可是系统是有自带libpthread库的。请教各路大神,编译失败的原因可能是什么?如何解决?谢谢! Run Build Command(s):/usr/bin/gmake cmTC_6a78d/fast && /usr/bin/gmake -f CMakeFiles/cmTC_6a78d.dir/build.make CMakeFiles/cmTC_6a78d.dir/build gmake[1]: Entering directory `/home/dujh/dev/greatsql/GreatSQL-GreatSQL-5.7.36-39/build-gs/workdir/TARGET/bld/CMakeFiles/CMakeTmp' Building C object CMakeFiles/cmTC_6a78d.dir/src.c.o /opt/rh/devtoolset-10/root/usr/bin/gcc -fPIC -fno-omit-frame-pointer -fno-strict-aliasing -DPERCONA_INNODB_VERSION=5.7.36 -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -fPIC -DCMAKE_HAVE_LIBC_PTHREAD -o CMakeFiles/cmTC_6a78d.dir/src.c.o -c /home/dujh/dev/greatsql/GreatSQL-GreatSQL-5.7.36-39/build-gs/workdir/TARGET/bld/CMakeFiles/CMakeTmp/src.c Linking C executable cmTC_6a78d /usr/bin/cmake3 -E cmake_link_script CMakeFiles/cmTC_6a78d.dir/link.txt --verbose=1 /opt/rh/devtoolset-10/root/usr/bin/gcc -fPIC -fno-omit-frame-pointer -fno-strict-aliasing -DPERCONA_INNODB_VERSION=5.7.36 -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -fPIC -DCMAKE_HAVE_LIBC_PTHREAD -rdynamic CMakeFiles/cmTC_6a78d.dir/src.c.o -o cmTC_6a78d /opt/rh/devtoolset-10/root/usr/libexec/gcc/x86_64-redhat-linux/10/ld: CMakeFiles/cmTC_6a78d.dir/src.c.o: in function `main': /home/dujh/dev/greatsql/GreatSQL-GreatSQL-5.7.36-39/build-gs/workdir/TARGET/bld/CMakeFiles/CMakeTmp/src.c:11: undefined reference to `pthread_create' /opt/rh/devtoolset-10/root/usr/libexec/gcc/x86_64-redhat-linux/10/ld: /home/dujh/dev/greatsql/GreatSQL-GreatSQL-5.7.36-39/build-gs/workdir/TARGET/bld/CMakeFiles/CMakeTmp/src.c:12: undefined reference to `pthread_detach' /opt/rh/devtoolset-10/root/usr/libexec/gcc/x86_64-redhat-linux/10/ld: /home/dujh/dev/greatsql/GreatSQL-GreatSQL-5.7.36-39/build-gs/workdir/TARGET/bld/CMakeFiles/CMakeTmp/src.c:13: undefined reference to `pthread_cancel' /opt/rh/devtoolset-10/root/usr/libexec/gcc/x86_64-redhat-linux/10/ld: /home/dujh/dev/greatsql/GreatSQL-GreatSQL-5.7.36-39/build-gs/workdir/TARGET/bld/CMakeFiles/CMakeTmp/src.c:14: undefined reference to `pthread_join' /opt/rh/devtoolset-10/root/usr/libexec/gcc/x86_64-redhat-linux/10/ld: /home/dujh/dev/greatsql/GreatSQL-GreatSQL-5.7.36-39/build-gs/workdir/TARGET/bld/CMakeFiles/CMakeTmp/src.c:15: undefined reference to `pthread_atfork' collect2: error: ld returned 1 exit status gmake[1]: *** [cmTC_6a78d] Error 1 gmake[1]: Leaving directory `/home/dujh/dev/greatsql/GreatSQL-GreatSQL-5.7.36-39/build-gs/workdir/TARGET/bld/CMakeFiles/CMakeTmp' gmake: *** [cmTC_6a78d/fast] Error 2 Source file was: #include <pthread.h> void* test_func(void* data) { return data; } int main(void) { pthread_t thread; pthread_create(&thread, NULL, test_func, NULL); pthread_detach(thread); pthread_cancel(thread); pthread_join(thread, NULL); pthread_atfork(NULL, NULL, NULL); pthread_exit(NULL); return 0; } Determining if the function pthread_create exists in the pthreads failed with the following output: Change Dir: /home/dujh/dev/greatsql/GreatSQL-GreatSQL-5.7.36-39/build-gs/workdir/TARGET/bld/CMakeFiles/CMakeTmp 系统自带的libpthread库版本如下: [root@babb133d7dad build-gs]# ll /lib64/libpthread* -rwxr-xr-x 1 root root 142144 May 18 2022 /lib64/libpthread-2.17.so -rw-r--r-- 1 root root 1764 May 18 2022 /lib64/libpthread_nonshared.a -rw-r--r-- 1 root root 222 May 18 2022 /lib64/libpthread.so lrwxrwxrwx 1 root root 18 Feb 29 09:03 /lib64/libpthread.so.0 -> libpthread-2.17.so 请教各路大神,编译失败的原因可能是什么?如何解决?谢谢! |
gavindu85
2024-4-8 10:58:04
| ||
yejr
2024-4-9 08:55:11
| ||
gavindu85
2024-4-9 17:42:40
| ||
yejr
2024-4-10 09:04:06
| ||
gavindu85
2024-4-15 14:27:14
| ||
yejr
2024-4-15 15:23:57
| ||
合作电话:010-64087828
社区邮箱:greatsql@greatdb.com