SPAWK Download & Installation

To use SPAWK you have to download SPAWK tarball and install SPAWK components to your local Linux system. You must know how to download files, how to extract files from tar archives, how to compile and link programs and, finally, you must have administrative permissions to install the SPAWK files. That's not a big deal, but if you are not a programmer or you don't have administrative permissions, you may find it difficult to do so.

Fast track

This is for the lazy. Good luck!

# Check for gawk version 3.1 or later
gawk --version

# Check for MySQL/MariaDB version 5.7 or later
mysql_config --version

# Download
tar zxf spawk.tar.gz
cd spawk

# Install
sudo make uninstall
make cleanup
make spawk
sudo make install

# Create and populate "chat" database
make database

# Cleanup
cd ..
rm -rf spawk spawk.tar.gz

If you are lucky, you must now have SPAWK installed in your local system. Have fun!


You must be able to compile and link MySQL/MariaDB client programs in your local system, so the MySQL/MariaDB C API header files, the MySQL/MariaDB client libraries, the C compiler, the linker and the make utility program must be installed to your local system.

Download the SPAWK tarball

You can download the SPAWK tarball either by clicking the following link tab:

Download ]

or by hand using CLI at your terminal:


Extract files from SPAWK tarball

After downloading the SPAWK tarball file to your local system, you have to decompress, extract, compile and install the spawk files. Either use you GUI to extract files by clicking the Extract here option, or use CLI instead:

tar zxf spawk.tar.gz

After decompression and extraction of the SPAWK files a spawk directory must have been created. You can now remove the tarball from your local system, but it's safer to keep the file until you can finally manage to have SPAWK up and running. Now move yourself to the spawk directory:

cd spawk

Compile and link SPAWK extension library

To compile and link the SPAWK extension library use CLI:

make spawk
make[1]: Entering directory… gcc -fPIC -shared -c -O -g `mysql_config --cflags` spawk.c gcc -o -shared spawk.o `mysql_config --libs` make[1]: Leaving directory… make [ check | database | cleanup | install (as root) | uninstall ]

Unless you have missing programs or libraries in you local system, you must see something like the above output at your terminal's screen.

Create and populate the chat database

It's time to test SPAWK. For this you have to create and populate the chat database. The database schema and enough data for testing SPAWK are provided in the SPAWK tarball and have already been downloaded, so return to your terminal once again, ensure that you are still located at the spawk directory and run the following command:

make database

After prompting for the database root password, an empty database will be created. Then SPAWK will load 2000 users and 30000 relatioships into the newly created database. The chat database can be used for SPAWK testing and learning. The whole tutorial is based on the chat database. Later on, you can use SPAWK at any time to drop the database and the related database users:

@load "spawk"

	spawk_sesami["dbuser"] = "root"
	spawk_sesami["dbpassword"] = spawk_getpass()

	spawk_submit("DROP DATABASE chat")
	spawk_submit("DROP USER 'chat'@'localhost', 'chatdql'@'localhost', 'chatadmin'@'localhost'")


Install SPAWK

Provided that there were no errors encountered, you are now ready to install the SPAWK files to your local system directories. This must be done with administrative permissions, so you have to run either:

sudo make install


su -c "make install"

That's it! You have now SPAWK installed in your local system. Have fun!

Uninstall SPAWK

If you don't need SPAWK anymore, you can uninstall the SPAWK files from your local system. This must be done with administrative permissions, so you have to run either:

sudo make uninstall


su -c "make uninstall"

Sep 05, 2022