Bug #86245 How to build under Debian 8. Have I done it correctly?
Submitted: 9 May 2017 14:38 Modified: 19 Nov 2017 7:53
Reporter: Yurii Korotia Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Workbench Severity:S3 (Non-critical)
Version:6.3.9-src OS:Debian (Linux developer 3.16.0-4-amd64 #1 SMP Debian 3.16.39-1+deb8u2 (2017-03-07) x86_64 GNU/Linux)
Assigned to: CPU Architecture:Any
Tags: build, swig

[9 May 2017 14:38] Yurii Korotia
Description:
steps in INSTALL are not updated to proper needs.
It fails to be installed with MySQL 5.7, because gdal depends on mysql 5.5 components, which creates comflict.

It also lacks some deps as unixodbc-dev and so on.
In the end, it is impossible to build on Debian 8, and because of old mysqlcppconn and deps I guess it is not possible to build even on other OSes (I didn't try though)

BUT

I was able to build Workbench on Debian 8 successfully with some custom steps and builds, you can check it below.

My questions mostly is - to fix build issues I had to wrap some functions with #ifndef SWIG ... #endif 
in file mysql-workbench-community-6.3.9-src/library/forms/mforms/widgets.h

QUESTIONS:

Can you explain side effects of my actions? regads

1. I had to disable BOOST_ERROR_CODE_HEADER_ONLY because of bug in boost.
2. I had to wrap some new functions for SWIG. https://gist.github.com/yurii-github/5adfc874767e19a370c855d9593dd5a3
3. I see some notifications as "-Wmissing-field-initializers"

regards

How to repeat:
just try to install as suggested in INSTALL file

Suggested fix:
========== Build Workbench 6.3 on Debian 8 with MySQL 5.7 ==========

1. set APT repository 
  get https://dev.mysql.com/downloads/repo/apt/ 
  sudo dpkg -i mysql-apt-config_0.8.5-1_all.deb
  Select desired config and then press 'Ok'

2. install Mysql 5.7 Server and client
	
2. just in case
sudo apt-get remove iodbc libmysqlcppconn-dev libgdal-dev

3. install
sudo apt-get -s install build-essential cmake cmake-data autoconf automake pkg-config libtool \
libsigc++-2.0-dev libglade2-dev libgtkmm-2.4-dev libglu1-mesa-dev libgl1-mesa-glx \
libzip-dev libxml2-dev mesa-common-dev uuid-dev libpixman-1-dev libpcre3-dev \
libgnome2-dev libgnome-keyring-dev libgtk2.0-dev libpango1.0-dev libcairo2-dev python-dev libboost-dev libctemplate-dev \
swig libsqlite3-dev libvsqlitepp-dev libproj0 python-pysqlite2 unixodbc-dev \
libmysqlclient-dev mysql-client python-paramiko libgtk-3-dev libgtkmm-3.0-dev

3. install fresh Gdal (because 1.5 depends on mysql 5.5)
  get http://download.osgeo.org/gdal/2.1.3/gdal-2.1.3.tar.gz
  cd gdal-2.1.3
./configure \
--with-png=internal --with-libtiff=internal --with-geotiff=internal --with-jpeg=internal --with-gif=internal --with-ecw=no \
--with-expat=yes --with-sqlite3=yes --with-geos=yes --with-python --with-libz=internal --with-netcdf \
--with-threads=yes --without-grass --without-ogdi --with-mysql=/usr/bin/mysql_config --with-xerces=yes
  make -j8
  sudo make install
  su
  cd /usr/local/include && mkdir gdal && cp gdal*.h gdal && cp ogr*.h gdal && cp memdataset.h gdal

4. get Antlr http://www.antlr3.org/download/
 download http://www.antlr3.org/download/antlr-3.4-complete.jar
 set env to point that file like
     ANTLR_JAR_PATH="/home/yurii/Downloads/mysql-workbench-community-6.3.9-src/antlr-3.4-complete.jar"

	 
5. get cpp connector 1.1.8
  download source https://dev.mysql.com/downloads/connector/cpp/ 
  cd mysql-connector-c++-1.1.8 && cmake . && make && sudo make install
  
  
6. don't use BOOST_ERROR_CODE_HEADER_ONLY in boost
  comment code in file mysql-workbench-community-6.3.9-src/library/base/boost_fix.cpp

  
7. modify/force mysqlcppconn dir (somehow it fails)
  edit file mysql-workbench-community-6.3.9-src/build/cmake/Modules/FindMySQLCppConn.cmake
  at line 32 add: SET(MySQLCppConn_INCLUDE_DIR /usr/local/include)

  
8. modify mysql-workbench-community-6.3.9-src/library/forms/mforms/widgets.h
  wrap some failing functions with #ifndef SWIG .. #endif
  see MYWRAP comment https://gist.github.com/yurii-github/5adfc874767e19a370c855d9593dd5a3
  (5 new wraps)

  
9. share libs
   sudo ln -s /usr/local/lib/libmysqlcppconn.so /usr/lib/libmysqlcppconn.so
   sudo ln -s /usr/local/lib/libgdal.so /usr/lib/libgdal.so
   
   
10. Now, we can compile workbench
  mkdir wb-build
  cd wb-build
  cmake [-DCMAKE_INSTALL_PREFIX=/usr] ..
  make
  sudo make install
[19 Oct 2017 7:53] Marcin Szalowicz
Hi Yurii, 
First let's try to isolate the Swig issue, 
for this let us know which version do you have.
[20 Nov 2017 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".