[MXS-113] MaxScale seems to fail if built against MariaDB 10.0 libraries Created: 2015-04-23  Updated: 2015-06-03  Resolved: 2015-06-03

Status: Closed
Project: MariaDB MaxScale
Component/s: Documentation
Affects Version/s: None
Fix Version/s: 1.2.0

Type: Bug Priority: Minor
Reporter: Simon J Mudd Assignee: markus makela
Resolution: Fixed Votes: 0
Labels: None


 Description   

I was looking at how to build this to do some testing and notice that building with MariaDB-5.5 rpms (on CentOS 6) the build fails if I use the MariaDB-10.0 rpms. Trying with MariaDB-5.5 rpms seems to allow the build to complete.

The build failure gives me:

...
[ 48%] Building C object server/core/CMakeFiles/maxscale.dir/memlog.c.o
/home/simon/src/git/MaxScale/server/core/memlog.c: In function ‘memlog_log’:
/home/simon/src/git/MaxScale/server/core/memlog.c:136: warning: cast from pointer to integer of different size
[ 50%] Building C object server/core/CMakeFiles/maxscale.dir/resultset.c.o
Linking CXX executable maxscale
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../lib64/libmysqld.a(log0recv.cc.o): In function `recv_dblwr_t::add(unsigned char*)':
(.text+0x714a): undefined reference to `std::_detail::_List_node_base::_M_hook(std::_detail::_List_node_base*)'
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../lib64/libmysqld.a(fil0fil.cc.o): In function `fil_get_space_names(std::list<char const*, std::allocator<char const*> >&)':
(.text+0x9b33): undefined reference to `std::_detail::_List_node_base::_M_hook(std::_detail::_List_node_base*)'
collect2: ld returned 1 exit status
make[2]: *** [server/core/maxscale] Error 1
make[1]: *** [server/core/CMakeFiles/maxscale.dir/all] Error 2
make: *** [all] Error 2

when the installed MariaDB rpms are:

$ rpm -qa | grep MariaDB
MariaDB-server-10.0.17-1.el6.x86_64
MariaDB-compat-10.0.17-1.el6.x86_64
MariaDB-client-10.0.17-1.el6.x86_64
MariaDB-devel-10.0.17-1.el6.x86_64
MariaDB-common-10.0.17-1.el6.x86_64

Whereas doing it with these rpms works fine:

...
Linking CXX shared library libtopfilter.so
[ 95%] Built target topfilter
[ 97%] Building C object server/modules/filter/hint/CMakeFiles/hintfilter.dir/hintfilter.c.o
[ 98%] Building C object server/modules/filter/hint/CMakeFiles/hintfilter.dir/hintparser.c.o
Linking CXX shared library libhintfilter.so
[ 98%] Built target hintfilter
[100%] Building C object client/CMakeFiles/maxadmin.dir/maxadmin.c.o
Linking C executable maxadmin
[100%] Built target maxadmin
$ rpm -qa | grep MariaDB
MariaDB-devel-5.5.42-1.el6.x86_64
MariaDB-common-5.5.42-1.el6.x86_64
MariaDB-server-5.5.42-1.el6.x86_64
MariaDB-compat-5.5.42-1.el6.x86_64
MariaDB-client-5.5.42-1.el6.x86_64

Note: I'd built by creating a build directory under git/MaxScale and doing
$ cd build ; cmake ..; make

So not sure the exact cause or if perhaps I'm doing something wrong.

I see that MaxScale/Documentation/Getting-Started/Building-MaxScale-from-Source-Code.md
mentions "MariaDB Develop libraries version 5.5.38 or later". If the 10.0 build problem is not my own then perhaps the docs could be clearer. However, supporting both versions and getting the build system to recognise any differences would make things easier.



 Comments   
Comment by markus makela [ 2015-04-24 ]

If you could give us more information about your system I believe we can solve this issue. What we need is Linux Distribution, MariaDB library installation method and library version, the standard c++ library version.

Those undefined references seem to be from the libstdc++ . This makes me think that the installed c++ library is either too old or somehow a non-standard version.

Comment by Simon J Mudd [ 2015-04-27 ]

Hi Markus. So I should be able to build against MariaDB 10 libraries? If so please make that explicit in the documentation.
If the compilation should work against either MariaDB 5.5 or MariaDB 10.0 then say so too. It makes things clearer if the user (me) has an issue and thus points to a local configuration/ setup problem.

I did say which OS I was using but I can be a bit more specific.

$ rpm -qa | grep MariaDB
MariaDB-devel-10.0.17-1.el6.x86_64
MariaDB-common-10.0.17-1.el6.x86_64
MariaDB-server-10.0.17-1.el6.x86_64
MariaDB-compat-10.0.17-1.el6.x86_64
MariaDB-client-10.0.17-1.el6.x86_64
$ rpm -q centos-release
centos-release-6-5.el6.centos.11.2.x86_64

And the C compiler is the OS default (so a tiny bit old):

$ rpm -qa | grep -E '(std|gcc)' | sort
compat-libstdc++-33-3.2.3-69.el6.x86_64
gcc-4.4.7-4.el6.x86_64
gcc-c++-4.4.7-4.el6.x86_64
libgcc-4.4.7-4.el6.i686
libgcc-4.4.7-4.el6.x86_64
libstdc++-4.4.7-4.el6.i686
libstdc++-4.4.7-4.el6.x86_64
libstdc++-devel-4.4.7-4.el6.x86_64

Do you need to know anything else?

Comment by markus makela [ 2015-04-27 ]

I followed the "Building Form Source" document and while it worked with 5.5 it did fail with 10.0. This leads me to believe there is a missing dependency for CentOS 6 when using MariaDB 10.0 server.

For example on Fedora 20, which has a more recent GCC version, the build works fine. Based on this I would say that using MariaDB 10.0 requires GCC 4.8 or newer since Fedora upgraded to it in Fedora 19.

I will confirm which version is the minimum required for MariaDB 10.0.

Comment by Simon J Mudd [ 2015-04-27 ]

Well your MariaDB rpms which I'm using in production on CentOS 6 work fine. I assume you build these rpms using a "clean" setup, as otherwise people who might want to build original or patched MariaDB rpms from the .src.rpm would not be able to do this. Again thanks for checking this and clarifying what may be missing.

Also note: I'm aware that WebScaleSQL does require a newer compiler toolset. This is specified in their documentation and when I've built some of their rpms on CentOS 6 I did have to install devtoolset-1.1 (GCC 4.7) or devtoolset-2 (GCC 4.8) for the build to work. See: https://github.com/sjmudd/webscalesql-rpm for reference. I know that MariaDB has pulled in various WebScaleSQL patches and hope that they haven't inadvertently pulled in compiler dependencies without making this clear, as that may "bleed through" to the MaxScale dependencies.

Comment by markus makela [ 2015-05-10 ]

I found this link on the GCC Bugzilla: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43882

Based on those comments I would believe the symbols were introduced in GCC 4.5.0 thus it is the minimum required version if MaxScale is built with MariaDB 10 from source.

Comment by Dipti Joshi (Inactive) [ 2015-06-02 ]

markus makela Can we clarify this in our how to build from source code guide ?

Comment by markus makela [ 2015-06-03 ]

The source building guide now mentions the MariaDB 10.0 dependency on GCC version 4.7 or newer: https://github.com/mariadb-corporation/MaxScale/blob/develop/Documentation/Getting-Started/Building-MaxScale-from-Source-Code.md

Generated at Thu Feb 08 03:56:53 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.