Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ProxySQL 2.2.2 failed to build in FreeBSD 13 #3619

Closed
iron-udjin opened this issue Sep 10, 2021 · 1 comment
Closed

ProxySQL 2.2.2 failed to build in FreeBSD 13 #3619

iron-udjin opened this issue Sep 10, 2021 · 1 comment

Comments

@iron-udjin
Copy link

iron-udjin commented Sep 10, 2021

Hello,

OS: FreeBSD 13
ProxySQL: 2.2.2
MariaDB: 10.3.31

#env GIT_VERSION=v2.2.2 gmake build_deps

-- SYSTEM processor: amd64
CMake Error at cmake/ConnectorName.cmake:30 (ENDMACRO):
  Flow control statements are not properly nested.
Call Stack (most recent call first):
  CMakeLists.txt:434 (INCLUDE)


-- Configuring incomplete, errors occurred!
See also "/root/apps/proxysql-2.2.2/deps/mariadb-client-library/mariadb_client/CMakeFiles/CMakeOutput.log".
See also "/root/apps/proxysql-2.2.2/deps/mariadb-client-library/mariadb_client/CMakeFiles/CMakeError.log".
gmake[1]: *** [Makefile:173: mariadb-client-library/mariadb_client/libmariadb/libmariadbclient.a] Error 1
gmake[1]: Leaving directory '/root/apps/proxysql-2.2.2/deps'
gmake: *** [Makefile:87: build_deps] Error 2

CMakeError.log (full content https://pastebin.com/826wY4D3)

Run Build Command(s):/usr/local/bin/gmake -f Makefile cmTC_f0dc4/fast && gmake[2]: Entering directory '/root/apps/proxysql-2.2.2/deps/mariadb-client-library/mariadb-connector-c-3.1.9-src/CMakeFiles/CMakeTmp'
gmake  -f CMakeFiles/cmTC_f0dc4.dir/build.make CMakeFiles/cmTC_f0dc4.dir/build
gmake[3]: Entering directory '/root/apps/proxysql-2.2.2/deps/mariadb-client-library/mariadb-connector-c-3.1.9-src/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_f0dc4.dir/src.c.o
/usr/bin/cc -DCMAKE_HAVE_LIBC_PTHREAD   -MD -MT CMakeFiles/cmTC_f0dc4.dir/src.c.o -MF CMakeFiles/cmTC_f0dc4.dir/src.c.o.d -o CMakeFiles/cmTC_f0dc4.dir/src.c.o -c /root/apps/proxysql-2.2.2/deps/mariadb-client-library/mariadb_client/CMakeFiles/CMakeTmp/src.c
Linking C executable cmTC_f0dc4
/usr/local/bin/cmake -E cmake_link_script CMakeFiles/cmTC_f0dc4.dir/link.txt --verbose=1
/usr/bin/cc CMakeFiles/cmTC_f0dc4.dir/src.c.o -o cmTC_f0dc4 
ld: error: undefined symbol: pthread_create
>>> referenced by src.c
>>>               CMakeFiles/cmTC_f0dc4.dir/src.c.o:(main)
cc: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[3]: *** [CMakeFiles/cmTC_f0dc4.dir/build.make:100: cmTC_f0dc4] Error 1
gmake[3]: Leaving directory '/root/apps/proxysql-2.2.2/deps/mariadb-client-library/mariadb-connector-c-3.1.9-src/CMakeFiles/CMakeTmp'
gmake[2]: *** [Makefile:127: cmTC_f0dc4/fast] Error 2
gmake[2]: Leaving directory '/root/apps/proxysql-2.2.2/deps/mariadb-client-library/mariadb-connector-c-3.1.9-src/CMakeFiles/CMakeTmp'


Source file was:
#include <pthread.h>

static 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: /root/apps/proxysql-2.2.2/deps/mariadb-client-library/mariadb_client/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/local/bin/gmake -f Makefile cmTC_a6fff/fast && gmake[2]: Entering directory '/root/apps/proxysql-2.2.2/deps/mariadb-client-library/mariadb-connector-c-3.1.9-src/CMakeFiles/CMakeTmp'
gmake  -f CMakeFiles/cmTC_a6fff.dir/build.make CMakeFiles/cmTC_a6fff.dir/build
gmake[3]: Entering directory '/root/apps/proxysql-2.2.2/deps/mariadb-client-library/mariadb-connector-c-3.1.9-src/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_a6fff.dir/CheckFunctionExists.c.o
/usr/bin/cc   -DCHECK_FUNCTION_EXISTS=pthread_create -MD -MT CMakeFiles/cmTC_a6fff.dir/CheckFunctionExists.c.o -MF CMakeFiles/cmTC_a6fff.dir/CheckFunctionExists.c.o.d -o CMakeFiles/cmTC_a6fff.dir/CheckFunctionExists.c.o -c /usr/local/share/cmake/Modules/CheckFunctionExists.c
Linking C executable cmTC_a6fff
/usr/local/bin/cmake -E cmake_link_script CMakeFiles/cmTC_a6fff.dir/link.txt --verbose=1
/usr/bin/cc  -DCHECK_FUNCTION_EXISTS=pthread_create CMakeFiles/cmTC_a6fff.dir/CheckFunctionExists.c.o -o cmTC_a6fff  -lpthreads 
ld: error: unable to find library -lpthreads
cc: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[3]: *** [CMakeFiles/cmTC_a6fff.dir/build.make:100: cmTC_a6fff] Error 1
gmake[3]: Leaving directory '/root/apps/proxysql-2.2.2/deps/mariadb-client-library/mariadb-connector-c-3.1.9-src/CMakeFiles/CMakeTmp'
gmake[2]: *** [Makefile:127: cmTC_a6fff/fast] Error 2
gmake[2]: Leaving directory '/root/apps/proxysql-2.2.2/deps/mariadb-client-library/mariadb-connector-c-3.1.9-src/CMakeFiles/CMakeTmp'

libpthread.so exists:
#ls -la /usr/lib/libpthread.so /usr/include/pthread.h

-r--r--r--  1 root  wheel  13004 Jan  1  2021 /usr/include/pthread.h
lrwxr-xr-x  1 root  wheel      9 Sep  4 00:06 /usr/lib/libpthread.so -> libthr.so

How can I deal with this errors?

Thank you!

@renecannao
Copy link
Contributor

Latest ProxySQL builds in latest FreeBSD

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants