[Maria-discuss] MariaDB 5.5 compile error
Hi, I would like some assistance in figuring out a compile error in MariaDB 5.5 series (tested on 5.5.25). I'm trying to create a minimal (client only) build of 5.5.25. This is the cmake configure command used: cmake --no-warn-unused-cli -C /var/tmp/portage/dev-db/mariadb-5.5.25/work/mariadb-5.5.25_build/gentoo_common_config.cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_PREFIX=/usr -DMYSQL_DATADIR=/var/lib/mysql -DSYSCONFDIR=/etc/mysql -DINSTALL_BINDIR=bin -DINSTALL_DOCDIR=share/doc/mariadb-5.5.25 -DINSTALL_DOCREADMEDIR=share/doc/mariadb-5.5.25 -DINSTALL_INCLUDEDIR=include/mysql -DINSTALL_INFODIR=share/info -DINSTALL_LIBDIR=lib64/mysql -DINSTALL_MANDIR=share/man -DINSTALL_MYSQLDATADIR=/var/lib/mysql -DINSTALL_MYSQLSHAREDIR=share/mysql -DINSTALL_MYSQLTESTDIR=share/mysql/mysql-test -DINSTALL_PLUGINDIR=lib64/mysql/plugin -DINSTALL_SBINDIR=sbin -DINSTALL_SCRIPTDIR=share/mysql/scripts -DINSTALL_SQLBENCHDIR=share/mysql -DINSTALL_SUPPORTFILESDIR=/usr/share/mysql -DWITH_COMMENT=Gentoo Linux mariadb-5.5.25 -DWITHOUT_UNIT_TESTS=1 -DNOT_FOR_DISTRIBUTION=1 -DDEFAULT_CHARSET=latin1 -DDEFAULT_COLLATION=latin1_swedish_ci -DWITHOUT_SERVER=1 -DWITHOUT_EMBEDDED_SERVER=1 -DENABLED_LOCAL_INFILE=1 -DINSTALL_SQLBENCHDIR= -DWITH_SSL=system -DWITH_ZLIB=system -DWITHOUT_LIBWRAP=1 -DWITHOUT_READLINE=1 -DWITHOUT_ARCHIVE_STORAGE_ENGINE=1 -DWITHOUT_BLACKHOLE_STORAGE_ENGINE=1 -DWITHOUT_CSV_STORAGE_ENGINE=1 -DWITHOUT_FEDERATED_STORAGE_ENGINE=1 -DWITHOUT_HEAP_STORAGE_ENGINE=1 -DWITHOUT_INNOBASE_STORAGE_ENGINE=1 -DWITHOUT_MYISAMMRG_STORAGE_ENGINE=1 -DWITHOUT_MYISAM_STORAGE_ENGINE=1 -DWITHOUT_PARTITION_STORAGE_ENGINE=1 -DWITHOUT_INNOBASE_STORAGE_ENGINE=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_DO_STRIP=OFF -DCMAKE_USER_MAKE_RULES_OVERRIDE=/var/tmp/portage/dev-db/mariadb-5.5.25/work/mariadb-5.5.25_build/gentoo_rules.cmake /var/tmp/portage/dev-db/mariadb-5.5.25/work/mysql gives the following error during build /var/tmp/portage/dev-db/mariadb-5.5.25/work/mysql/mysys/waiting_threads.c:196:21: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘key_WT_RESOURCE_cond’ make[2]: *** [mysys/CMakeFiles/mysys.dir/waiting_threads.c.o] Error 1 However, if i build the full server, I get no error. cmake configure with no error: cmake --no-warn-unused-cli -C /var/tmp/portage/dev-db/mariadb-5.5.25/work/mariadb-5.5.25_build/gentoo_common_config.cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_PREFIX=/usr -DMYSQL_DATADIR=/var/lib/mysql -DSYSCONFDIR=/etc/mysql -DINSTALL_BINDIR=bin -DINSTALL_DOCDIR=share/doc/mariadb-5.5.25 -DINSTALL_DOCREADMEDIR=share/doc/mariadb-5.5.25 -DINSTALL_INCLUDEDIR=include/mysql -DINSTALL_INFODIR=share/info -DINSTALL_LIBDIR=lib64/mysql -DINSTALL_MANDIR=share/man -DINSTALL_MYSQLDATADIR=/var/lib/mysql -DINSTALL_MYSQLSHAREDIR=share/mysql -DINSTALL_MYSQLTESTDIR=share/mysql/mysql-test -DINSTALL_PLUGINDIR=lib64/mysql/plugin -DINSTALL_SBINDIR=sbin -DINSTALL_SCRIPTDIR=share/mysql/scripts -DINSTALL_SQLBENCHDIR=share/mysql -DINSTALL_SUPPORTFILESDIR=/usr/share/mysql -DWITH_COMMENT=Gentoo Linux mariadb-5.5.25 -DWITHOUT_UNIT_TESTS=1 -DNOT_FOR_DISTRIBUTION=1 -DDEFAULT_CHARSET=latin1 -DDEFAULT_COLLATION=latin1_swedish_ci -DENABLED_LOCAL_INFILE=1 -DEXTRA_CHARSETS=all -DMYSQL_USER=mysql -DMYSQL_UNIX_ADDR=/var/run/mysqld/mysqld.sock -DWITHOUT_READLINE=1 -DWITH_ZLIB=system -DWITHOUT_LIBWRAP=1 -DDISABLE_SHARED=OFF -DWITH_debug=OFF -DWITH_DEBUG=OFF -DWITH_Debug=OFF -DWITH_EMBEDDED_SERVER=OFF -DWITH_profiling=ON -DWITH_PROFILING=ON -DWITH_Profiling=ON -DENABLE_DTRACE=OFF -DWITH_SSL=system -DCMAKE_EXE_LINKER_FLAGS=-ljemalloc -DWITH_SAFEMALLOC=OFF -DWITH_ARCHIVE_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DWITH_CSV_STORAGE_ENGINE=1 -DWITH_HEAP_STORAGE_ENGINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_MYISAMMRG_STORAGE_ENGINE=1 -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_PARTITION_STORAGE_ENGINE=1 -DWITH_FEDERATED_STORAGE_ENGINE=ON -DWITH_PBXT_STORAGE_ENGINE=OFF -DWITH_OQGRAPH_STORAGE_ENGINE=OFF -DWITH_SPHINX_STORAGE_ENGINE=OFF -DWITH_FEDERATEDX_STORAGE_ENGINE=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_DO_STRIP=OFF -DCMAKE_USER_MAKE_RULES_OVERRIDE=/var/tmp/portage/dev-db/mariadb-5.5.25/work/mariadb-5.5.25_build/gentoo_rules.cmake /var/tmp/portage/dev-db/mariadb-5.5.25/work/mysql gentoo_common_config.cmake contains: SET (LIB_SUFFIX 64 CACHE STRING "library path suffix" FORCE) SET (CMAKE_INSTALL_LIBDIR /usr/lib64 CACHE PATH "Output directory for libraries") I'm at a loss why one way works and the the other doesn't. Thank you.
Hi, Brian! On Aug 03, Brian Evans wrote:
Hi,
I would like some assistance in figuring out a compile error in MariaDB 5.5 series (tested on 5.5.25).
I'm trying to create a minimal (client only) build of 5.5.25. This is the cmake configure command used: ... However, if i build the full server, I get no error. ... I'm at a loss why one way works and the the other doesn't.
It fails, precisely, because you're trying to build without clients. Even the original mariadb gentoo ebuild does not compile with USE=minimal. Building with -DWITHOUT_SERVER=1 is broken, it doesn't work. Depending on your needs you have different options: * Give up, install everything :) * Fix the build (and tell us how you did it) * Build everything but _install_ only the client - might be easier than the previous option. Note that RPM builds can already do that - in all INSTALL_FILE/etc cmake commands are tagged with an appropriate category, and depending on the category different files end up in different RPMs. It should be pretty easy to build everything and then install only files from client categories. * submit a bug report (and we will fix it eventually, but we might prefer to fix the installation, not compilation part - see above). Regards, Sergei
On 8/4/2012 5:56 AM, Sergei Golubchik wrote:
Hi, Brian!
It fails, precisely, because you're trying to build without clients. Even the original mariadb gentoo ebuild does not compile with USE=minimal.
Building with -DWITHOUT_SERVER=1 is broken, it doesn't work.
Depending on your needs you have different options:
* Give up, install everything :) * Fix the build (and tell us how you did it) * Build everything but _install_ only the client - might be easier than the previous option. Note that RPM builds can already do that - in all INSTALL_FILE/etc cmake commands are tagged with an appropriate category, and depending on the category different files end up in different RPMs. It should be pretty easy to build everything and then install only files from client categories. * submit a bug report (and we will fix it eventually, but we might prefer to fix the installation, not compilation part - see above).
USE="minimal" has always built only the client and supporting libraries in the autotools versions. This was done without the server, so it's a bit of a regression. I need to mimic this functionality if at all possible. I've patched CMakeLists.txt with the following: @@ -320,6 +320,13 @@ IF(UNIX) ADD_SUBDIRECTORY(man) ENDIF() +ELSE + ADD_SUBDIRECTORY(client) + ADD_SUBDIRECTORY(sql/share) + ADD_SUBDIRECTORY(scripts) + IF(UNIX) + ADD_SUBDIRECTORY(man) + ENDIF() ENDIF() INCLUDE(cmake/abi_check.cmake) This works for MySQL 5.5.25a, but fails in MariaDB 5.5.25 due to that one line. /var/tmp/portage/dev-db/mariadb-5.5.25/work/mysql/mysys/waiting_threads.c:196:21: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘key_WT_RESOURCE_cond’ waiting_threads.c @196 is a simple extern typedef'd declaration: extern PSI_cond_key key_WT_RESOURCE_cond; If I patch PSI_cond_key to "unsigned int" as the .h reference typedef suggests, it will compile. Is there a better way to do this so I don't have to remove the typedef reference? Brian
On 8/6/2012 12:27 PM, Brian Evans wrote:
On 8/4/2012 5:56 AM, Sergei Golubchik wrote:
Hi, Brian!
It fails, precisely, because you're trying to build without clients. Even the original mariadb gentoo ebuild does not compile with USE=minimal.
Building with -DWITHOUT_SERVER=1 is broken, it doesn't work.
Depending on your needs you have different options:
* Give up, install everything :) * Fix the build (and tell us how you did it) * Build everything but _install_ only the client - might be easier than the previous option. Note that RPM builds can already do that - in all INSTALL_FILE/etc cmake commands are tagged with an appropriate category, and depending on the category different files end up in different RPMs. It should be pretty easy to build everything and then install only files from client categories. * submit a bug report (and we will fix it eventually, but we might prefer to fix the installation, not compilation part - see above).
I took a more elegant way in the end: https://github.com/grknight/gentoo-mysql-extras/blob/HEAD/20001_all_fix-mini... I attempted to follow what waiting_threads.c pointed to and it seemed as if the client library/program would ignore its functions. So, I disabled it from the build when WITHOUT_SERVER was enabled. This gives the desired results in the compile. If there is a "better" way, I'd be open to hear it. Brian
Hi, Brian! I've created a ticket for it: https://mariadb.atlassian.net/browse/MDEV-439 Should be fixed in the next release. Thanks! Regards, Sergei On Aug 06, Brian Evans wrote:
On 8/6/2012 12:27 PM, Brian Evans wrote:
On 8/4/2012 5:56 AM, Sergei Golubchik wrote:
Building with -DWITHOUT_SERVER=1 is broken, it doesn't work.
I took a more elegant way in the end: https://github.com/grknight/gentoo-mysql-extras/blob/HEAD/20001_all_fix-mini...
participants (2)
-
Brian Evans
-
Sergei Golubchik