Bug #78600 Compiling group replication plugin will fail because of boost_1_58_0 package
Submitted: 28 Sep 2015 9:44 Modified: 11 Dec 2015 15:22
Reporter: Shahriyar Rzayev (OCA) Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: Group Replication Severity:S1 (Critical)
Version:0.5.0-dmr OS:Ubuntu (14.04)
Assigned to: CPU Architecture:Any

[28 Sep 2015 9:44] Shahriyar Rzayev
Description:
Hi dear experts,

Related to, 
http://mysqlhighavailability.com/mysql-group-replication-0-4-0-labs-plugin-packages/ 

If we try to compile mysql group replication plugin from source with MySQL 5.7.8-rc it will fail due to dependency issue:

-- MySQL currently requires boost_1_58_0

CMake Error at cmake/boost.cmake:76 (MESSAGE):
  You can download it with -DDOWNLOAD_BOOST=1 -DWITH_BOOST=<directory>

Even after appending to -DMYSQL_SERVER_CMAKE_ARGS it will fail:

cmake ..  -DMYSQL_SERVER_SRC_DIR="/home/sh/Sandboxes/mysql-5.7.8-rc" -DMYSQL_SERVER_CMAKE_ARGS="-DCMAKE_INSTALL_PREFIX=/opt/mysql-5.7.8-grouprepl; -DMYSQL_DATADIR=/opt/mysql-5.7.8-grouprepl/datadir; -DSYSCONFDIR=/opt/mysql-5.7.8-grouprepl; -DWITH_SSL=system; -DMYSQL_TCP_PORT=3307; -DMYSQL_UNIX_ADDR=/opt/mysql-5.7.8-grouprepl/mysqld.sock; -DDEFAULT_CHARSET=utf8; -DDEFAULT_COLLATION=utf8_general_ci; -DWITH_DEBUG=1; -DCOMPILATION_COMMENT='Group Replication enabled MySQL-5.7.8'; -DOPTIMIZER_TRACE=1; -DWITH_ZLIB=system; -DWITH_VALGRIND=1; -DCMAKE_C_FLAGS=-DHAVE_purify; -DCMAKE_CXX_FLAGS=-DHAVE_purify; -DDOWNLOAD_BOOST=1; -DWITH_BOOST=/home/sh/Sandboxes"

If you type -DDOWNLOAD_BOOST=1 -DWITH_BOOST=/home/sh/Sandboxes outside:

cmake ..  -DMYSQL_SERVER_SRC_DIR="/home/sh/Sandboxes/mysql-5.7.8-rc" -DMYSQL_SERVER_CMAKE_ARGS="-DCMAKE_INSTALL_PREFIX=/opt/mysql-5.7.8-grouprepl; -DMYSQL_DATADIR=/opt/mysql-5.7.8-grouprepl/datadir; -DSYSCONFDIR=/opt/mysql-5.7.8-grouprepl; -DWITH_SSL=system; -DMYSQL_TCP_PORT=3307; -DMYSQL_UNIX_ADDR=/opt/mysql-5.7.8-grouprepl/mysqld.sock; -DDEFAULT_CHARSET=utf8; -DDEFAULT_COLLATION=utf8_general_ci; -DWITH_DEBUG=1; -DCOMPILATION_COMMENT='Group Replication enabled MySQL-5.7.8'; -DOPTIMIZER_TRACE=1; -DWITH_ZLIB=system; -DWITH_VALGRIND=1; -DCMAKE_C_FLAGS=-DHAVE_purify; -DCMAKE_CXX_FLAGS=-DHAVE_purify"  -DDOWNLOAD_BOOST=1 -DWITH_BOOST=/home/sh/Sandboxes

CMake Warning:
  Manually-specified variables were not used by the project:

    DOWNLOAD_BOOST
    WITH_BOOST

How to repeat:
Try to compile plugin with MySQL 5.7.8-rc2 using cmake options provided in Description.

Suggested fix:
looking for workaround to get this plugin in Ubuntu.
[28 Sep 2015 12:20] Umesh Shastry
Hello Shahriyar Rzayev,

Thank you for the report.

Thanks,
Umesh
[30 Sep 2015 22:06] Pedro Gomes
Hi Shahriyar,

Again, thanks for testing Group Replication!

About your problem.

1) You should not use spaces between the options passed to -DMYSQL_SERVER_CMAKE_ARGS

So this:
"-DA=abc; -DB=bcd;
should be
"-DA=abc;-DB=bcd;

I think that is not that case here, but also, if you have spaces you should escape them: 
-DMYSQL_SERVER_CMAKE_ARGS="-DX='a b';-DY='c d';DZ=1"

2) -DCMAKE_INSTALL_PREFIX=/opt/mysql-5.7.8-grouprepl; 

I think this is not the issue here, but this option does not work here. 
The plugin will define it's own server build/install folder inside BIN, and compile the server and the plugin there.

So please test it again and give us some feedback if some other problem remains/emerges.
[2 Oct 2015 6:33] Shahriyar Rzayev
Dear Pedro,

It is clear now after your comment, so the compile command is:

cmake ..  -DMYSQL_SERVER_SRC_DIR="/home/sh/Sandboxes/mysql-5.7.8-rc" -DMYSQL_SERVER_CMAKE_ARGS="-DMYSQL_DATADIR=/opt/mysql-5.7.8-grouprepl/datadir;-DSYSCONFDIR=/opt/mysql-5.7.8-grouprepl;-DWITH_SSL=system;-DMYSQL_TCP_PORT=3307;-DMYSQL_UNIX_ADDR=/opt/mysql-5.7.8-grouprepl/mysqld.sock;-DDEFAULT_CHARSET=utf8;-DDEFAULT_COLLATION=utf8_general_ci;-DWITH_DEBUG=1;-DCOMPILATION_COMMENT='Group Replication enabled MySQL-5.7.8';-DOPTIMIZER_TRACE=1;-DWITH_ZLIB=system;-DWITH_VALGRIND=1;-DCMAKE_C_FLAGS=-DHAVE_purify;-DCMAKE_CXX_FLAGS=-DHAVE_purify;-DDOWNLOAD_BOOST=1;-DWITH_BOOST=/home/sh/Sandboxes"

And:

make package

And here is directory structure:

sh@shrzayev:~$ ls /home/sh/Sandboxes/mysql-group-replication-0.5.0-dmr/BIN/
BUILD           CMakeFiles           CPackConfig.cmake  CPackSourceConfig.cmake  mysql-group-replication-0.5.0-dmr-amd64.tar.gz  SOURCE
CMakeCache.txt  cmake_install.cmake  _CPack_Packages    Makefile                 mysql_server-prefix

As i read mysql-group-replication-0.5.0-dmr-amd64.tar.gz -> is plugin binary package. But it is created as empty archive. any further suggestions? :)
[2 Oct 2015 8:16] Shahriyar Rzayev
I have figured out that if you do not install corosync and corosync-dev package it will compiled successfully but it will create empty binary package.
After installing:

sudo apt-get install corosync corosync-dev libcpg-dev

You will have mysql-group-replication-0.5.0-dmr-amd64.tar.gz binary package with group_replication.so inside:

sh@shrzayev:~/Sandboxes/mysql-group-replication-0.5.0-dmr/BIN$ tar -tf mysql-group-replication-0.5.0-dmr-amd64.tar.gz | grep group_replication.so
mysql-group-replication-0.5.0-dmr-amd64/lib/plugin/group_replication.so

All of these dependencies/steps should be noted in related article.
[7 Oct 2015 11:17] Pedro Gomes
These packages are the ones stated on 

http://mysqlhighavailability.com/mysql-group-replication-a-small-corosync-guide/

libcpg-dev as a dependency should be installed as well. 

About the packaging issue...
If you just compile the plugin without the 'package' it compile correctly without the corosync dev libs?

Anyhow, we are looking into packaging so I will take this into account.
[11 Dec 2015 15:22] Nuno Carvalho
No feedback was provided. The bug is being suspended because we assume that you are no longer experiencing the problem. If this is not the case and you are able to provide the information that was requested earlier, please do so and change the status of the bug back to "Open". Thank you.