Some initial rough notes on building HammerDB on NetBSD. It has quite a unique build system - I don’t know if it’ll be possible to make a Pkgsrc package of this. For now I just wanted to see if I could get it to build at all.

  1. See github changes
  2. Need to install 7-zip: sudo pkgin install 7-zip
  3. Need to install tcl 9 (just for the header file; Since HammerDB is actually building tcl this step feels superfluous, maybe the header is available locally when building and I just haven’t found it yet?): sudo pkgin install tcl90
  4. To build the pgtcl package need:

     export PG_CONFIG=/usr/pkg/bin
    
  5. I had to set this to get it to find my include files:

     export C_INCLUDE_PATH=/usr/pkg/include/python3.12/:/usr/pkg/tcl/9.0/include/:/usr/include/
    

    The last /usr/include/ isn’t actually required, but I chucked it on there for good measure

  6. And for the pty.h requirement somewhere along the way, we actually need util.h so I had to symlink:

     sudo ln -s /usr/include/util.h /usr/include/pty.h
    
  7. To actually build:

     cd /home/simon/Code/github/TPC-Council/HammerDB/Build/Bawt-2.1.0
     ./Build-Linux.sh x64 Setup/HammerDB-Linux.bawt update
    

    For now I’m just stealing/tweaking the Linux files instead of adding BSD ones.


At some point whilst trying to get things to build I did this:

    sudo ln -s /usr/pkg/bin/python3.12-config /usr/pkg/bin/python3-config

But on a recent rebuild to check through this post this step wasn’t required (I deleted the symlink before rebuilding) and I can’t recall why I did this in the first place. But leaving this as a note just in case


Running the builds

Basically you need to copy and extract the build somewhere:

cd ../BawtBuild/Linux/x64/Release/Distribution
cp HammerDB-5.0-Dev-Linux.tar.gz /to/somewhere/else
cd /to/somewhere/else
tar xvzf HammerDB-5.0-Dev-Linux.tar.gz
cd HammerDB-5.0-Dev-Linux
./hammerdb

I haven’t been able to get the prod one to work yet - for sure it’s got to be linked to “linking” and something has been stripped that shouldn’t have. Not too bothered about figuring this out yet because the Dev build does run!

HammerDB running on NetBSD

For the cli the (default) tcl one works, but the Python one (./hammerdbcli py) doesn’t - I’ve done some initial debugging (editing and putting print statements in; another benefit of the Dev build is you can just edit the “built”scripts) and it’s something to do with not being able to find tclpys even though it is there.


Before going down the building route I did have a brief play with the pre-built binaries and NetBSD’s Linux emulation, but:

/home/simo...-ubuntu-22  $ ./hammerdbcli
./hammerdbcli: /lib64/libc.so.6: version `GLIBC_2.33' not found (required by ./hammerdbcli)
./hammerdbcli: /lib64/libc.so.6: version `GLIBC_2.34' not found (required by ./hammerdbcli)
./hammerdbcli: /lib64/libm.so.6: version `GLIBC_2.35' not found (required by ./hammerdbcli)

I.e. I didn’t have a modern enough glibc available, I only had 2.15 from the Suse Linux Compatibility package. I could, in theory, have tried tracking down a more modern one (because that’s how it works), but it felt easier to try to get the build working.