{"id":1112,"date":"2022-05-26T14:48:50","date_gmt":"2022-05-26T14:48:50","guid":{"rendered":"https:\/\/www.hammerdb.com\/blog\/?p=1112"},"modified":"2022-06-23T15:09:04","modified_gmt":"2022-06-23T15:09:04","slug":"how-to-build-hammerdb-from-source","status":"publish","type":"post","link":"https:\/\/www.hammerdb.com\/blog\/uncategorized\/how-to-build-hammerdb-from-source\/","title":{"rendered":"How to build HammerDB from source"},"content":{"rendered":"<p>With pull requests <a href=\"https:\/\/github.com\/TPC-Council\/HammerDB\/pull\/323\">Dependency build automation for Linux #323<\/a> and <a href=\"https:\/\/github.com\/TPC-Council\/HammerDB\/pull\/362\">Dependency build automation for Windows #362<\/a> HammerDB has enabled the user to build their own full distribution of HammerDB from source on Linux x64 and Windows x64 with a single command. This post explains how you can build your own distribution.<\/p>\n<h5>Do you need to build from source?<\/h5>\n<p>Before building from source, the first question should be, do you need to?\u00a0 HammerDB already provides pre-compiled packages from the <a href=\"https:\/\/www.hammerdb.com\/download.html\">download page<\/a> so if you want to run HammerDB without building it then these packages are all you need.<\/p>\n<h5>WHY build from source?<\/h5>\n<p>If you are not already familiar with the programming languages that HammerDB uses, then this earlier post serves as an ideal introduction to what makes up the highest performing <a href=\"https:\/\/en.wikipedia.org\/wiki\/Global_interpreter_lock\">GIL<\/a> free database benchmarking application.<\/p>\n<blockquote class=\"wp-embedded-content\" data-secret=\"YFlAroPb2C\"><p><a href=\"https:\/\/www.hammerdb.com\/blog\/uncategorized\/what-programming-languages-does-hammerdb-use-and-why-does-it-matter\/\">What programming languages does HammerDB use and why does it matter?<\/a><\/p><\/blockquote>\n<p><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&#8220;What programming languages does HammerDB use and why does it matter?&#8221; &#8212; HammerDB Blog\" src=\"https:\/\/www.hammerdb.com\/blog\/uncategorized\/what-programming-languages-does-hammerdb-use-and-why-does-it-matter\/embed\/#?secret=JI9QBIHhpG#?secret=YFlAroPb2C\" data-secret=\"YFlAroPb2C\" width=\"525\" height=\"296\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n<p>You may want to become familiar with all the underlying source code in C or wish to build a distribution where you can verify every single line of source code that goes into HammerDB. All of the source code and dependencies in HammerDB are\u00a0 open source right down to the layer above any 3rd party commercial database drivers for Oracle, SQL Server and Db2.\u00a0 Building from source also enables you to build a distribution right up to date with any of the latest pull requests not yet included in the most recent HammerDB release.<\/p>\n<h5>BAWT by Paul Obermeier<\/h5>\n<p>HammerDB build automation uses an adapted version of the <a href=\"http:\/\/www.bawt.tcl3d.org\/\">BAWT<\/a> package by Paul Obermeier . BAWT is copyrighted by Paul Obermeier and distributed under the 3-clause BSD license.<\/p>\n<h5>GETTING STARTED ON LINUX<\/h5>\n<p>If you have read what programming languages HammerDB uses, then you will not be too surprised that you will firstly need to install a development environment using the gcc compiler for Linux. You will also need the p7zip tool as well as the Xft font library development packages.\u00a0 The build has been tested on x64 Red Hat 8.X and Ubuntu 20.04.X Linux, with the following example from Red Hat Linux.<\/p>\n<pre class=\"notranslate\"><code>yum install p7zip-16.02-20.el8.x86_64.rpm\r\nsudo yum install libXft-devel\r\nyum group install \"Development Tools\"<\/code><\/pre>\n<p dir=\"auto\">The HammerDB Oracle and ODBC for SQL Server client libraries will build without the respective Oracle and SQL Server client libraries, but will need them at runtime.\u00a0 However, the client or server must be installed for all of Db2, MariaDB, PostgreSQL and MySQL for the HammerDB build to be successful. The database installation must include both the include and lib directories.<\/p>\n<p dir=\"auto\">For Db2 either the server or client can be installed, for example v11.5.7_linuxx64_server_dec.tar.gz.<\/p>\n<p dir=\"auto\">HammerDB build automation will look for the Db2 installation in the location of the environment variable IBM_DB_DIR set using db2profile tool. Verify that this has been set as follows:<\/p>\n<div class=\"snippet-clipboard-content notranslate position-relative overflow-auto\">\n<pre class=\"notranslate\"><code>$ echo $IBM_DB_DIR\r\n\/home\/ibm\/sqllib\r\n<\/code><\/pre>\n<\/div>\n<p dir=\"auto\">On Linux MariaDB, PostgreSQL and MySQL include a config command in the bin directory that returns details of the configuration. HammerDB uses these commands to find the headers and libraries needed for the build.<\/p>\n<p dir=\"auto\">Before running the build, environment variables MARIADB_CONFIG, PG_CONFIG and MYSQL_CONFIG must be set to the location of the respective config commands for each database in the terminal running the build.<\/p>\n<div class=\"snippet-clipboard-content notranslate position-relative overflow-auto\">\n<pre class=\"notranslate\"><code>$ export MARIADB_CONFIG=\/opt\/mariadb\/mariadb-10.6.7-linux-systemd-x86_64\/bin\r\n$ export PG_CONFIG=\/opt\/postgresql\/bin\r\n$ export MYSQL_CONFIG=\/opt\/mysql\/mysql-8.0.28-linux-glibc2.12-x86_64\/bin\r\n<\/code><\/pre>\n<\/div>\n<h5>GETTING STARTED ON WINDOWS<\/h5>\n<p>On Windows, download and install <a href=\"https:\/\/visualstudio.microsoft.com\/vs\/community\/\">Visual Studio 2022<\/a> , Visual Studio is free for open source developers.\u00a0 An additional gcc compiler will be downloaded and installed locally during the build. The build has been tested on x64 Windows 10 and 11.<\/p>\n<p>As with Linux it is also mandatory to install a database server or client including the development environment of headers and libraries for MariaDB, Db2, MySQL and PostgreSQL.<\/p>\n<p>For Db2 on Windows, there is no db2profile that sets the environment therefore the IBM_DB_DIR environment variable must be set to the location of the Db2 install.\u00a0 Similarly, the MariaDB and MySQL config commands are not available on Windows either and should also be set to the database or client installation directory rather than the bin directory. PostgreSQL for Windows does include the config command and therefore the environment configuration is the same as Linux.<\/p>\n<pre class=\"notranslate\"><code>set MARIADB_CONFIG=C:\\Program Files\\MariaDB\\MariaDB Connector C 64-bit\r\nset MYSQL_CONFIG=C:\\Program Files\\MySQL\\MySQL Server 8.0\r\nset PG_CONFIG=C:\\Program Files\\PostgreSQL\\pgsql\\bin\r\nset IBM_DB_DIR=C:\\Program Files\\IBM\\SQLLIB<\/code><\/pre>\n<p>For all database installations on Windows whether client or server verify that the installation has the include, bin and lib directories. On Windows in particular, some installations may not include all the required files for development.<\/p>\n<h5>Download HAMMERDB SOURCE<\/h5>\n<p>At this stage you will have installed the compiler you need and database client\/server installations for MariaDB, Db2, MySQL and PostgreSQL. To reiterate, HammerDB will not build correctly unless you have installed ALL the required database environments.<\/p>\n<p>Next download HammerDB from gitHub by either cloning or downloading. From the main HammerDB GitHub page use the clone URL or the Download Zip link from the master branch.<\/p>\n<p><a href=\"https:\/\/www.hammerdb.com\/blog\/wp-content\/uploads\/2022\/05\/clonedownload.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-1129 aligncenter\" src=\"https:\/\/www.hammerdb.com\/blog\/wp-content\/uploads\/2022\/05\/clonedownload.png\" alt=\"\" width=\"373\" height=\"321\" srcset=\"https:\/\/www.hammerdb.com\/blog\/wp-content\/uploads\/2022\/05\/clonedownload.png 373w, https:\/\/www.hammerdb.com\/blog\/wp-content\/uploads\/2022\/05\/clonedownload-300x258.png 300w\" sizes=\"auto, (max-width: 373px) 100vw, 373px\" \/><\/a><code><\/code><\/p>\n<pre class=\"notranslate\"><code><span id=\"container-1453-outerCt\" role=\"presentation\">$ git clone <a href=\"https:\/\/github.com\/TPC-Council\/HammerDB.git\" target=\"_blank\" rel=\"noopener\" data-qtip=\"https:\/\/github.com\/TPC-Council\/HammerDB.git\">https:\/\/github.com\/TPC-Council\/HammerDB.git<\/a>\r\nCloning into 'HammerDB'...\r\nremote: Enumerating objects: 8099, done.\r\nremote: Total 8099 (delta 0), reused 0 (delta 0), pack-reused 8099\r\nReceiving objects: 100% (8099\/8099), 40.41 MiB | 8.39 MiB\/s, done.\r\nResolving deltas: 100% (2564\/2564), done.<\/span><\/code><\/pre>\n<p>If cloning you will have a directory called &#8220;HammerDB&#8221; or extracting the zipfile a directory called &#8220;HammerDB-master&#8221;.<\/p>\n<h5>RUNNING THE BUILD<\/h5>\n<p>Navigate to the Build\\Bawt-2.1.0 directory with the command line for both Linux and Windows. Note that during the build an InputLibs directory will be created and all HammerDB libraries downloaded and under the Build directory a BawtBuild directory will be created where the installation will take place. Therefore, sufficient disk space and permissions must be available for the build to take place.<\/p>\n<p>Within the command line you are running the build make sure that you have correctly set all the MARIADB_CONFIG, MYSQL_CONFIG, PG_CONFIG, and IBM_DB_DIR environment variables used during the build and run the Build-Linux.sh command for Linux <code class=\"notranslate\">.\/Build-Linux.sh x64 Setup\/HammerDB-Linux.bawt update<\/code> and Build-Windows.bat commands for Windows <code class=\"notranslate\">.\/Build-Windows.bat x64 vs2022+gcc Setup\/HammerDB-Windows.bawt update<\/code>,<code class=\"notranslate\"><\/code> the command sequence will look similar to the following on Linux:<\/p>\n<pre><span id=\"container-1453-outerCt\" role=\"presentation\">$ export MYSQL_CONFIG=\/opt\/mysql-8.0.20-linux-glibc2.12-x86_64\/bin\r\n$ export MARIADB_CONFIG=\/opt\/mariadb-10.8.1-linux-x86_64\/bin\/\r\n$ export PG_CONFIG=\/opt\/postgresql-14.1\/bin\r\n$ echo $IBM_DB_DIR\r\n\/opt\/ibm\/sqllib\r\n$ .\/Build-Linux.sh x64 Setup\/HammerDB-Linux.bawt update<\/span><\/pre>\n<p>and the following on Windows:<\/p>\n<div class=\"auto-created-dir-div\" dir=\"auto\">\n<pre>set MARIADB_CONFIG=C:\\Program Files\\MariaDB\\MariaDB Connector C 64-bit\r\nset MYSQL_CONFIG=C:\\Program Files\\MySQL\\MySQL Server 8.0\r\nset PG_CONFIG=C:\\Program Files\\PostgreSQL\\pgsql\\bin\r\nset IBM_DB_DIR=C:\\Program Files\\IBM\\SQLLIB\r\nBuild-Windows.bat x64 vs2022+gcc Setup\\HammerDB-Windows.bawt update<\/pre>\n<\/div>\n<p>The first step the build will take is to download the required packages and build instructions from www.hammerdb.com, On Windows the MYSYS\/MinGW package will also be downloaded.\u00a0 These will be stored in the Bawt-2.1.0\/InputLibs directory. Both checksums and modification times are verified with the remote packages. If a package is already present with the same checksum and modification time, it will not be downloaded again if already present. Also some packages such as Tcl have been modified from the original and therefore only the packages from www.hammerdb.com should be used.<\/p>\n<pre><span id=\"container-1453-outerCt\" role=\"presentation\">awthemes-9.3.1.7z\u00a0 libressl-2.6.4.7z\u00a0 pgtcl-2.1.1.7z Tk-8.6.12.7z\r\nawthemes.bawt\u00a0\u00a0\u00a0\u00a0\u00a0 libressl.bawt\u00a0\u00a0\u00a0\u00a0\u00a0 pgtcl.bawt\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Tk.bawt\r\nclearlooks-1.0.7z\u00a0 mariatcl-0.1.7z\u00a0\u00a0\u00a0 redis-0.1.7z tkblt-3.2.23.7z\r\nclearlooks.bawt\u00a0\u00a0\u00a0 mariatcl.bawt\u00a0\u00a0\u00a0\u00a0\u00a0 redis.bawt\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 tkblt.bawt\r\ndb2tcl-2.0.1.7z\u00a0\u00a0\u00a0 mysqltcl-3.052.7z\u00a0 Tcl-8.6.12.7z tksvg-0.5.7z\r\ndb2tcl.bawt\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 mysqltcl.bawt\u00a0\u00a0\u00a0\u00a0\u00a0 Tcl.bawt\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 tksvg.bawt\r\nexpect-5.45.4.7z\u00a0\u00a0 oratcl-4.6.7z\u00a0\u00a0\u00a0\u00a0\u00a0 tcltls-1.7.22.7z\r\nexpect.bawt\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 oratcl.bawt\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 tcltls.bawt<\/span><\/pre>\n<p>Allow the build to complete. A summary will be given of the packages built and the location of the build given, for example for Linux as follows:<\/p>\n<pre><span id=\"container-1453-outerCt\" role=\"presentation\">14:27:08 &gt; Creating Distribution tar.gz in \/opt\/HammerDB\/Build\/BawtBuild\/Linux\/x64\/Release\/Distribution\r\n14:27:08 &gt;\u00a0\u00a0 TarGzip\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Source directory: \/opt\/HammerDB\/Build\/BawtBuild\/Linux\/x64\/Release\/Distribution\/HammerDB-4.4\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Tar file\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 : \/opt\/HammerDB\/Build\/BawtBuild\/Linux\/x64\/Release\/Distribution\/HammerDB-4.4-Linux.tar.gz\r\n14:27:09 &gt; End FinalizeStage\r\n\r\n14:27:09 &gt; Summary\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Setup file\u00a0\u00a0\u00a0\u00a0 : \/opt\/HammerDB\/Build\/Bawt-2.1.0\/Setup\/HammerDB-Linux.bawt\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Build directory: \/opt\/HammerDB\/Build\/BawtBuild\/Linux\/x64\/Release\/Build\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Architecture\u00a0\u00a0 : x64\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Compilers\u00a0\u00a0\u00a0\u00a0\u00a0 : gcc\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Global stages\u00a0 : Finalize\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 #\u00a0 : Library Name\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Version\u00a0\u00a0\u00a0 Build time Stages\r\n----------------------------------------------------------------------\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 1: Tcl\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 8.6.12\u00a0\u00a0\u00a0\u00a0 1.52 minutes Clean Extract Configure Compile Distribute\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2: Tk\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 8.6.12\u00a0\u00a0\u00a0\u00a0 0.36 minutes Clean Extract Configure Compile Distribute\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 3: awthemes\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 9.3.1\u00a0\u00a0\u00a0\u00a0\u00a0 0.00 minutes Clean Extract Configure Compile Distribute\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 4: clearlooks\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 1.0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0.00 minutes Clean Extract Configure Compile Distribute\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 5: db2tcl\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2.0.1\u00a0\u00a0\u00a0\u00a0\u00a0 0.10 minutes Clean Extract Configure Compile Distribute\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 6: expect\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 5.45.4\u00a0\u00a0\u00a0\u00a0 0.12 minutes Clean Extract Configure Compile Distribute\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 7: libressl\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2.6.4\u00a0\u00a0\u00a0\u00a0\u00a0 0.99 minutes Clean Extract Configure Compile Distribute\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 8: mariatcl\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0.1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0.04 minutes Clean Extract Configure Compile Distribute\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 9: mysqltcl\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 3.052\u00a0\u00a0\u00a0\u00a0\u00a0 0.04 minutes Clean Extract Configure Compile Distribute\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 10: oratcl\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 4.6\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0.05 minutes Clean Extract Configure Compile Distribute\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 11: pgtcl\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2.1.1\u00a0\u00a0\u00a0\u00a0\u00a0 0.05 minutes Clean Extract Configure Compile Distribute\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 12: redis\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0.1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0.00 minutes Clean Extract Configure Compile Distribute\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 13: tcltls\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 1.7.22\u00a0\u00a0\u00a0\u00a0 0.14 minutes Clean Extract Configure Compile Distribute\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 14: tkblt\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 3.2.23\u00a0\u00a0\u00a0\u00a0 0.21 minutes Clean Extract Configure Compile Distribute\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 15: tksvg\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0.5\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0.06 minutes Clean Extract Configure Compile Distribute\r\n----------------------------------------------------------------------\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Total: 3.70 minutes\r\n<\/span><\/pre>\n<p>and for Windows:<\/p>\n<p style=\"text-align: center;\"><span id=\"container-1453-outerCt\" role=\"presentation\"><a href=\"https:\/\/www.hammerdb.com\/blog\/wp-content\/uploads\/2022\/05\/winbuild.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1136\" src=\"https:\/\/www.hammerdb.com\/blog\/wp-content\/uploads\/2022\/05\/winbuild.png\" alt=\"\" width=\"1438\" height=\"1142\" srcset=\"https:\/\/www.hammerdb.com\/blog\/wp-content\/uploads\/2022\/05\/winbuild.png 1438w, https:\/\/www.hammerdb.com\/blog\/wp-content\/uploads\/2022\/05\/winbuild-300x238.png 300w, https:\/\/www.hammerdb.com\/blog\/wp-content\/uploads\/2022\/05\/winbuild-1024x813.png 1024w, https:\/\/www.hammerdb.com\/blog\/wp-content\/uploads\/2022\/05\/winbuild-768x610.png 768w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/a><\/span><\/p>\n<p>You now have your own distribution of HammerDB with the latest source code.\u00a0 You can run the hammerdbcli librarycheck command to verify that the libraries built correctly.<\/p>\n<pre><span id=\"container-1453-outerCt\" role=\"presentation\">\/opt\/HammerDB\/Build\/BawtBuild\/Linux\/x64\/Release\/Distribution$ ls\r\nHammerDB-4.4\u00a0 HammerDB-4.4-Linux.tar.gz\r\n$ cd HammerDB-4.4\r\n\/opt\/HammerDB\/Build\/BawtBuild\/Linux\/x64\/Release\/Distribution\/HammerDB-4.4$ .\/hammerdbcli\r\nHammerDB CLI v4.4\r\nCopyright (C) 2003-2022 Steve Shaw\r\nType \"help\" for a list of commands\r\nhammerdb&gt;librarycheck\r\nChecking database library for Oracle\r\nSuccess ... loaded library Oratcl for Oracle\r\nChecking database library for MSSQLServer\r\nSuccess ... loaded library tdbc::odbc for MSSQLServer\r\nChecking database library for Db2\r\nSuccess ... loaded library db2tcl for Db2\r\nChecking database library for MySQL\r\nSuccess ... loaded library mysqltcl for MySQL\r\nChecking database library for PostgreSQL\r\nSuccess ... loaded library Pgtcl for PostgreSQL\r\nChecking database library for MariaDB\r\nSuccess ... loaded library mariatcl for MariaDB\r\n<\/span><\/pre>\n<p>You can also browse all of the C source code for the libraries you have built in the Build directory.<\/p>\n<pre><span id=\"container-1453-outerCt\" role=\"presentation\">\/opt\/HammerDB\/Build\/BawtBuild\/Linux\/x64\/Release\/Build<\/span><\/pre>\n<h5>VERIFYING DEPENDENT LIBRARIES<\/h5>\n<p>Having built the distribution yourself it should be clear that as the database libraries are dynamically linked when you install the distribution on another system you will\u00a0 also need to install the database clients on that system.<\/p>\n<p>For example on Linux we have a check that fails because the MariaDB libraries cannot be found and we can verify this with the ldd command.<\/p>\n<pre><span id=\"container-1453-outerCt\" role=\"presentation\">hammerdb&gt;librarycheck\r\n...\r\nChecking database library for MariaDB\r\nError: failed to load mariatcl - couldn't load file \"\/opt\/HammerDB\/Build\/BawtBuild\/Linux\/x64\/Release\/Distribution\/HammerDB-4.4\/lib\/mariatcl0.1\/libmariatcl0.1.so\": libmariadb.so.3: cannot open shared object file: No such file or directory\r\nEnsure that MariaDB client libraries are installed and the location in the LD_LIBRARY_PATH environment variable\r\n\r\n$ ldd libmariatcl0.1.so\r\n\u00a0\u00a0 \u00a0linux-vdso.so.1 (0x00007ffd534db000)\r\n\u00a0\u00a0 \u00a0libmariadb.so.3 =&gt; not found\r\n\u00a0\u00a0 \u00a0libc.so.6 =&gt; \/lib\/x86_64-linux-gnu\/libc.so.6 (0x00007f259d2f9000)\r\n\u00a0\u00a0 \u00a0\/lib64\/ld-linux-x86-64.so.2 (0x00007f259d513000)\r\n<\/span><\/pre>\n<p>When we install this dependent library and tell HammerDB where to find it:<\/p>\n<pre><span id=\"container-1453-outerCt\" role=\"presentation\">export LD_LIBRARY_PATH=\/opt\/mariadb-10.2.34-linux-x86_64\/lib:$LD_LIBRARY_PATH<\/span><\/pre>\n<p>HammerDB will correctly load the MariaDB package.<\/p>\n<pre><span id=\"container-1453-outerCt\" role=\"presentation\">\r\n$ ldd libmariatcl0.1.so\r\n\u00a0\u00a0 \u00a0linux-vdso.so.1 (0x00007ffc6214d000)\r\n\u00a0\u00a0 \u00a0libmariadb.so.3 =&gt; \/opt\/mariadb-10.2.34-linux-x86_64\/lib\/libmariadb.so.3 (0x00007f3e028c9000)\r\n\u00a0\u00a0 \u00a0libc.so.6 =&gt; \/lib\/x86_64-linux-gnu\/libc.so.6 (0x00007f3e026bd000)\r\n\u00a0\u00a0 \u00a0libpthread.so.0 =&gt; \/lib\/x86_64-linux-gnu\/libpthread.so.0 (0x00007f3e0269a000)\r\n\u00a0\u00a0 \u00a0libdl.so.2 =&gt; \/lib\/x86_64-linux-gnu\/libdl.so.2 (0x00007f3e02694000)\r\n\u00a0\u00a0 \u00a0libm.so.6 =&gt; \/lib\/x86_64-linux-gnu\/libm.so.6 (0x00007f3e02545000)\r\n\u00a0\u00a0 \u00a0\/lib64\/ld-linux-x86-64.so.2 (0x00007f3e02cd2000)\r\n\r\nhammerdb&gt;librarycheck\r\n...\r\nChecking database library for MariaDB\r\nSuccess ... loaded library mariatcl for MariaDB\r\n<\/span><\/pre>\n<p>For an example Windows this time we cannot load the MySQL library.<\/p>\n<pre>HammerDB CLI v4.4\r\nCopyright (C) 2003-2022 Steve Shaw\r\nType \"help\" for a list of commands\r\nhammerdb&gt;librarycheck\r\n...\r\nChecking database library for MySQL\r\nError: failed to load mysqltcl - couldn't load library \"C:\/HammerDB-master\/Build\/BawtBuild\/vs2022\/x64\/Release\/Distribution\/HammerDB-4.4\/lib\/mysqltcl3.052\/libmysqltcl.dll\": No error\r\nEnsure that MySQL client libraries are installed and the location in the PATH environment variable\r\nhammerdb&gt;<\/pre>\n<p>We run the DependenciesGui from the <a href=\"https:\/\/github.com\/lucasg\/Dependencies\">dependencies tool,\u00a0<\/a> load libmysqltcl.dll and it shows we cannot find libmysql.dll.<\/p>\n<p><a href=\"https:\/\/www.hammerdb.com\/blog\/wp-content\/uploads\/2022\/05\/libmysqlmissing1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1140\" src=\"https:\/\/www.hammerdb.com\/blog\/wp-content\/uploads\/2022\/05\/libmysqlmissing1.png\" alt=\"\" width=\"1363\" height=\"901\" srcset=\"https:\/\/www.hammerdb.com\/blog\/wp-content\/uploads\/2022\/05\/libmysqlmissing1.png 1363w, https:\/\/www.hammerdb.com\/blog\/wp-content\/uploads\/2022\/05\/libmysqlmissing1-300x198.png 300w, https:\/\/www.hammerdb.com\/blog\/wp-content\/uploads\/2022\/05\/libmysqlmissing1-1024x677.png 1024w, https:\/\/www.hammerdb.com\/blog\/wp-content\/uploads\/2022\/05\/libmysqlmissing1-768x508.png 768w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/a><\/p>\n<p>After installing MySQL we set the environment variable to find the library.<\/p>\n<p><a href=\"https:\/\/www.hammerdb.com\/blog\/wp-content\/uploads\/2022\/05\/winenvvars.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1141\" src=\"https:\/\/www.hammerdb.com\/blog\/wp-content\/uploads\/2022\/05\/winenvvars.png\" alt=\"\" width=\"903\" height=\"992\" srcset=\"https:\/\/www.hammerdb.com\/blog\/wp-content\/uploads\/2022\/05\/winenvvars.png 903w, https:\/\/www.hammerdb.com\/blog\/wp-content\/uploads\/2022\/05\/winenvvars-273x300.png 273w, https:\/\/www.hammerdb.com\/blog\/wp-content\/uploads\/2022\/05\/winenvvars-768x844.png 768w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/a><\/p>\n<p>and verify with the Dependencies GUI that now all dependencies can be found.<\/p>\n<p><a href=\"https:\/\/www.hammerdb.com\/blog\/wp-content\/uploads\/2022\/05\/mysqllibfound.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1142\" src=\"https:\/\/www.hammerdb.com\/blog\/wp-content\/uploads\/2022\/05\/mysqllibfound.png\" alt=\"\" width=\"1363\" height=\"901\" srcset=\"https:\/\/www.hammerdb.com\/blog\/wp-content\/uploads\/2022\/05\/mysqllibfound.png 1363w, https:\/\/www.hammerdb.com\/blog\/wp-content\/uploads\/2022\/05\/mysqllibfound-300x198.png 300w, https:\/\/www.hammerdb.com\/blog\/wp-content\/uploads\/2022\/05\/mysqllibfound-1024x677.png 1024w, https:\/\/www.hammerdb.com\/blog\/wp-content\/uploads\/2022\/05\/mysqllibfound-768x508.png 768w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/a><\/p>\n<p>We can now confirm that the MySQL package can be correctly loaded.<\/p>\n<pre>HammerDB CLI v4.4\r\nCopyright (C) 2003-2022 Steve Shaw\r\nType \"help\" for a list of commands\r\nhammerdb&gt;librarycheck\r\nChecking database library for Oracle\r\nSuccess ... loaded library Oratcl for Oracle\r\nChecking database library for MSSQLServer\r\nSuccess ... loaded library tdbc::odbc for MSSQLServer\r\nChecking database library for Db2\r\nSuccess ... loaded library db2tcl for Db2\r\nChecking database library for MySQL\r\nSuccess ... loaded library mysqltcl for MySQL\r\nChecking database library for PostgreSQL\r\nSuccess ... loaded library Pgtcl for PostgreSQL\r\nChecking database library for MariaDB\r\nSuccess ... loaded library mariatcl for MariaDB\r\nhammerdb&gt;<\/pre>\n<h5>SUMMARY<\/h5>\n<p>You have now learnt how to build your own HammerDB from source. This gives you access to all of the source code and see how HammerDB is built for a released distribution to enable you to build your own.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>With pull requests Dependency build automation for Linux #323 and Dependency build automation for Windows #362 HammerDB has enabled the user to build their own full distribution of HammerDB from source on Linux x64 and Windows x64 with a single command. This post explains how you can build your own distribution. Do you need to &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.hammerdb.com\/blog\/uncategorized\/how-to-build-hammerdb-from-source\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;How to build HammerDB from source&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"ppma_author":[5],"class_list":["post-1112","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"authors":[{"term_id":5,"user_id":2,"is_guest":0,"slug":"hammerdb","display_name":"HammerDB","avatar_url":{"url":"https:\/\/www.hammerdb.com\/blog\/wp-content\/uploads\/2018\/10\/logo-white.png","url2x":"https:\/\/www.hammerdb.com\/blog\/wp-content\/uploads\/2018\/10\/logo-white.png"},"author_category":"","user_url":"http:\/\/www.hammerdb.com","last_name":"","first_name":"","job_title":"","description":""}],"_links":{"self":[{"href":"https:\/\/www.hammerdb.com\/blog\/wp-json\/wp\/v2\/posts\/1112","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hammerdb.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hammerdb.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hammerdb.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hammerdb.com\/blog\/wp-json\/wp\/v2\/comments?post=1112"}],"version-history":[{"count":32,"href":"https:\/\/www.hammerdb.com\/blog\/wp-json\/wp\/v2\/posts\/1112\/revisions"}],"predecessor-version":[{"id":1150,"href":"https:\/\/www.hammerdb.com\/blog\/wp-json\/wp\/v2\/posts\/1112\/revisions\/1150"}],"wp:attachment":[{"href":"https:\/\/www.hammerdb.com\/blog\/wp-json\/wp\/v2\/media?parent=1112"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hammerdb.com\/blog\/wp-json\/wp\/v2\/categories?post=1112"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hammerdb.com\/blog\/wp-json\/wp\/v2\/tags?post=1112"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.hammerdb.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=1112"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}