Here's what installing Golf looks like


The installation script is "gginst.sh". It installs Golf in a location folder ".golf" (under home directory), so a base installation does not require sudo. However, some external components do. For instance, if you want to access a database you'll need a database access library, or to use regex expressions you'll need PCRE2 library etc. These are industry-standard tried-and-true Free Open Source libraries; using them helps with reliability and safety. These libraries are called "toolkit" libraries for obvious reasons. You don't have to install them immediately, but rather only when you need them. When you build an application that needs one of them, Golf will ask you to install it, along with the instructions on how to do it.

Golf is installed as source code only and then compiled during the install. The reason is safety, usability and performance:
Golf uses gcc toolchain, and if it's not installed, it will need to be, for which you'll need sudo privilege.

And finally if you use SELinux (such as on Fedora-based distributions), you'll need sudo, which is a system requirement to make SELinux modules. If you don't want to, you can use "permissive" SELinux mode, or develop on a different distribution, and you won't be asked.

Here's the output from a typical "gginst.sh" run. It's all a single installation, and the output is broken into multiples just for clarity.

This is done on a "bare bone" server Linux system, which doesn't have the gcc toolchain or any of the toolkit libraries. It's a Fedora system, so you can see how's SELinux installation handled too. First you'll be asked to install the gcc toolchain. If you don't want gginst.sh to do it, you can copy and paste the instructions below (i.e. the sudo dnf ...) and execute them yourself first, and then come back and run installation again. Since it checks if those are installed, you won't be asked again to install them:
$ ./gginst.sh
*** Some required base packages are not installed. Here is how to install them:

sudo dnf -y install  gcc
sudo dnf -y install  make
sudo dnf -y install  pkgconf
sudo dnf -y install  tar
sudo dnf -y install  policycoreutils policycoreutils-devel libselinux-utils

Do you want to install them now (you will need sudo privilege)? (y/N)y
sudo dnf -y install  gcc
Installing [gcc]...
[sudo] password for dasoftver:
sudo dnf -y install  tar
Installing [tar]...
sudo dnf -y install  policycoreutils policycoreutils-devel libselinux-utils
Installing [SELinux-devel]...

Now gginst.sh will ask you if you wish to install the toolkit libraries. You can say no (by pressing N) and install them when you need them. Golf will alert you when they are needed, and show you the instructions like below (i.e. the sudo dnf ...). You can also cancel the installation (by pressing Ctrl-C) and copy and paste those instructions and install them yourself, and then run installation again, so you won't be asked this. Finally, you can let gginst.sh to install these for you, which is what's shown below:
*** Some toolkit packages are not installed. Here is how to install them:

sudo dnf -y install  libpq-devel
sudo dnf -y install  mariadb-connector-c-devel
sudo dnf -y install  sqlite-devel
sudo dnf -y install  openssl-devel
sudo dnf -y install  libxml2-devel
sudo dnf -y install  libcurl-devel
sudo dnf -y install  pcre2-devel

If you will use features provided by these toolkits, you will need to install them. You can also install them later; Golf will let you know and show the installation instructions when you compile a program that needs such a feature. If you are not sure, or do not want interruptions later, you can install the toolkit packages now.
Do you want to install them now (you will need sudo privilege)? (y/N)y
sudo dnf -y install  libpq-devel
Installing [libpq-devel]...
sudo dnf -y install  mariadb-connector-c-devel
Installing [mariadb-connector-c-devel]...
sudo dnf -y install  sqlite-devel
Installing [sqlite-devel]...
sudo dnf -y install  libxml2-devel
Installing [libxml2-devel]...
sudo dnf -y install  libcurl-devel
Installing [libcurl-devel]...
sudo dnf -y install  pcre2-devel
Installing [pcre2-devel]...

Next, Golf will build itself. It will create LTO modules, which allow Golf code to link with your application in a way that increases performance, as I described above (with LTO):
Making Golf binaries and libraries, please wait...
..............................................................Built Golf binaries (devel)
Creating Golf directories (devel)
Copying Golf binaries (devel)
..............................................................Built Golf binaries (release)
Creating Golf directories (release)
Copying Golf binaries (release)

Next, the SELinux modules are compiled (they are distributed as source too, see files below):
Setting up SELinux...
Since you have SELinux enabled, you must setup SELinux for Golf. sudo privilege is required by the Operating System to complete this. The script [sudo /home/dasoftver/.golf/lib/selinux/selinux.setup] will run next. Press Enter to continue.
Compiling targeted gg module
Creating targeted gg.pp policy package
rm tmp/gg.mod tmp/gg.mod.fc
Setting environment variables...
Setting permissions...

Finally, help man pages are installed, so you can get help (i.e. "man read-file" from command line to get help on statement read-file). Of course, you can always use the Golf's web site and it's documentation (it's the same documentation), but in a pinch it's useful to quickly get help from command line:
/usr/bin/mandb
Setting man pages...
mandb: warning: $MANPATH set, appending /etc/man_db.conf
Processing manual pages under /home/dasoftver/.golf/man...
Updating index cache for path `/home/dasoftver/.golf/man/man2'. Wait...done.
Checking for stray cats under /home/dasoftver/.golf/man...
Processing manual pages under /home/dasoftver/.golf/man/cat2...
1 man subdirectory contained newer manual pages.
245 manual pages were added.
0 stray cats were added.

Next, just run .bashrc to set up Golf's PATH variables:
$ . $HOME/.bashrc

And you have installed Golf! You can now try the examples, or start writing your applications!

To install Golf takes only a few minutes. Go to install-rimstone for instructions.


Copyright (c) 2019-2025 Gliim LLC. All contents on this web site is "AS IS" without warranties or guarantees of any kind.