1

I am trying to build the mysql-workbench from source.I followed these steps given in INSTALL file.

Steps:

1- $> cd wb-build

2- $> cmake ..

3- $> make -j4

4- $> sudo make install

AT STEP 2

root@Ahsan:~/Downloads/mysql-workbench-community-8.0.19-src/wb-build# cmake ..

ANTLR4 INCLUDE DIR: /usr/local/include/antlr4-runtime
ANTLR4 LIB DIR: -L/usr/local/lib -lantlr4-runtime
CMake Warning (dev) at /usr/share/cmake-3.16/Modules/FindOpenGL.cmake:275 (message):
  Policy CMP0072 is not set: FindOpenGL prefers GLVND by default when
  available.  Run "cmake --help-policy CMP0072" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.

  FindOpenGL found both a legacy GL library:

    OPENGL_gl_LIBRARY: /usr/lib/x86_64-linux-gnu/libGL.so

  and GLVND libraries for OpenGL and GLX:

    OPENGL_opengl_LIBRARY: /usr/lib/x86_64-linux-gnu/libOpenGL.so
    OPENGL_glx_LIBRARY: /usr/lib/x86_64-linux-gnu/libGLX.so

  OpenGL_GL_PREFERENCE has not been set to "GLVND" or "LEGACY", so for
  compatibility with CMake 3.10 and below the legacy GL library will be used.
Call Stack (most recent call first):
  CMakeLists.txt:77 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

VSQLITE INCLUDE DIR: /usr/include
VSQLITE LIB DIR: -L/usr/lib/x86_64-linux-gnu -lvsqlitepp
Found unixodbc, using it as ODBC library.
CMake Warning at CMakeLists.txt:153 (message):
  antlr-4.7.1-complete.jar or java runtime wasn't found which is required if
  you'd like to rebuild Lexer and Parser files


Found Scintilla Version: 4.1.5
CMake Warning (dev) at /usr/share/cmake-3.16/Modules/UseSWIG.cmake:607 (message):
  Policy CMP0078 is not set: UseSWIG generates standard target names.  Run
  "cmake --help-policy CMP0078" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.

Call Stack (most recent call first):
  library/forms/swig/CMakeLists.txt:64 (swig_add_library)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at /usr/share/cmake-3.16/Modules/UseSWIG.cmake:460 (message):
  Policy CMP0086 is not set: UseSWIG honors SWIG_MODULE_NAME via -module
  flag.  Run "cmake --help-policy CMP0086" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.

Call Stack (most recent call first):
  /usr/share/cmake-3.16/Modules/UseSWIG.cmake:702 (SWIG_ADD_SOURCE_TO_MODULE)
  library/forms/swig/CMakeLists.txt:64 (swig_add_library)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at /usr/share/cmake-3.16/Modules/UseSWIG.cmake:607 (message):
  Policy CMP0078 is not set: UseSWIG generates standard target names.  Run
  "cmake --help-policy CMP0078" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.

Call Stack (most recent call first):
  library/forms/swig/CMakeLists.txt:96 (swig_add_library)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at /usr/share/cmake-3.16/Modules/UseSWIG.cmake:460 (message):
  Policy CMP0086 is not set: UseSWIG honors SWIG_MODULE_NAME via -module
  flag.  Run "cmake --help-policy CMP0086" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.

Call Stack (most recent call first):
  /usr/share/cmake-3.16/Modules/UseSWIG.cmake:702 (SWIG_ADD_SOURCE_TO_MODULE)
  library/forms/swig/CMakeLists.txt:96 (swig_add_library)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Configuring done
-- Generating done
-- Build files have been written to: /root/Downloads/mysql-workbench-community-8.0.19-src/wb-build

AT STEP 3

root@Ahsan:~/Downloads/mysql-workbench-community-8.0.19-src/wb-build# make -j4

[  0%] [mysql] Generating parser files...
Error: Unable to access jarfile ANTLR_JAR_PATH-NOTFOUND
make[2]: *** [library/parsers/CMakeFiles/generate_parser_mysql.dir/build.make:75: ../library/parsers/mysql/MySQLLexer.h] Error 1
make[1]: *** [CMakeFiles/Makefile2:2260: library/parsers/CMakeFiles/generate_parser_mysql.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[  1%] Built target cdbc
[  3%] Built target wbbase
[ 24%] Built target wbscintilla
make: *** [Makefile:130: all] Error 2

Note about ANTLR:

  • ANTLR 4.7 is required to generate the files for the MySQL Parser. Download antlr-4.7.2-complete.jar from http://www.antlr.org/download.html. Then you'll need to pass it as cmake argument: -DWITH_ANTLR_JAR=path_to_your_antlr_complete_file

NOTE: I have downloaded the Antlr-4.7.2-complete.jar file in my /root/Downloads/

Where should i put it.

  • It would appear your CMake did not completely find the ANTLR_JAR_PATH, can you please provide the **full** CMake log in your question post. Can you also provide the steps you are following to build this? Perhaps a tutorial? Where did you download the source? – Kevin Mar 20 '20 at 22:20
  • Note: it is **not** necessary that you generate the parser/lexer files, as they are part of the repository. Only if you want to **re-generate** them (e.g. because you changed the grammars) then you also have to run ANTLR. I know the (re)generation is part of the build project, but as a start you can comment that out as you already have the generated files. – Mike Lischke Mar 21 '20 at 09:02
  • Could you please tell me in which file i need to comment out the Antlr. Regards –  Mar 21 '20 at 11:33

1 Answers1

2

I had the same problem. The sollution for me (it's partly described in INSTALL file):

  1. Add wb-build folder

  2. Open wb-build folder and run cmake command.

cmake [-DCMAKE_INSTALL_PREFIX=/usr] ..

  1. Check which version is need to compile (as You can see is 4.9.1).

WITH_ANTLR_JAR: CMake Warning at CMakeLists.txt:161 (message): antlr-4.9.1-complete.jar or java runtime wasn't found which is required if you'd like to rebuild Lexer and Parser files

  1. Download from https://www.antlr.org/download/antlr-4.9.1-complete.jar
  2. Add path to antlr-4.9.1 file to cmake

cmake [-DCMAKE_INSTALL_PREFIX=/usr -DWITH_ANTLR_JAR=path_to_your_antlr_complete_file] .. 6. If path and version is ok it should be: Found unixodbc, using it as ODBC library. WITH_ANTLR_JAR: /tmp/antlr-4.9.1-complete.jar] -- ANTLR jar: /tmp/antlr-4.9.1-complete.jar 7. Then make (it takes about 30 min.) and make install (or sudo make install)

Tip: I saw its better to run make on one CPU core. If I used many cores (-j FLAG) there were many errors, and compilation was stopped every time.