Installation



kForth is provided under the terms of the GNU General Public License. New releases of this software will be posted at the CCRE website, as they become available. Online documentation is also available at the website. Difficulties with installation should be reported to: krishna.myneni@ccreweb.org

The kForth source package is distributed as compressed tar (Unix Tape Archive) files:

where x.y.z is the current version number,such as 1.3.2. The source package unpacks to a directory of source files and a Makefile for building the executable(s).

Installation under Linux

Required Packages

The following packages are required to build and maintain kForth from its source package, on a Linux system:


Note that some of the package names may be slightly different, depending on your Linux distribution. Some or all of these packages may already be installed on your Linux system, but if they are not, you should be able to install them manually for your Linux distribution. You may use your system's graphical package manager to check for installation of the required packages, or use a command line query. For example, if your Linux system is rpm-based, you may verify that these packages have been installed by using the rpm command in the following way:

rpm -q package-name

The above command will return the version number of the package if it has been installed. The version of GNU C/C++ should be 3.2 or higher. On a Debian package-based system, the following command line query may be used:

aptitude search package-name


While it may be tedious to determine the necessary package names and install any needed packages on your system, this is a one-time procedure which will enable your system to be used for building software from its source code, and for software development.

64-bit Linux Systems

kForth is always built as a 32-bit application, even on 64-bit systems. If you are building on a 64-bit system (x86_64), the 32-bit versions of of the C/C++ libraries and other libraries (ncurses, readline) must be installed. On a system such as CentOS 7, and other Red Hat Enterprise Linux 7 derived systems, additional packages are installed using

sudo yum install package-name


Installing the following additional packages will provide the needed libraries to build kForth on these systems:


Build and Configuration

Assuming your Linux system has the required packages, follow these steps to unpack, build, and install kForth:

  1. Create a directory for the kForth source files, typically in your home directory, e.g.

    mkdir ~/kforth


  2. Move the kForth archive file into this directory:

    mv kforth-x86-linux-x.y.z.tar.gz ~/kforth


  3. Change to the ~/kforth directory and extract the files:

    cd ~/kforth

    tar -zxvf kforth-x86-linux-x.y.z.tar.gz


    After this step, a subdirectory will be created with the name kforth-x.y.z. This directory will contain all of the kForth source files, the Makefile(s), as well as a README file with these same instructions.

  4. Change to the kforth-x.y.z directory:

    cd kforth-x.y.z


  5. Build the kForth executable. There are several options for building kForth, but the simplest is to type:

    make


    All of the source files will be compiled/assembled and two executable files, named "kforth" and "kforth-fast", will be generated.

  6. At this point you should be able to run the executables from your ~/kforth/kforth-x.y.z directory. If you wish to make kforth available to all users or to place the programs in the default search path, move the executables to a suitable directory (/usr/local/bin/ is recommended) using:

    sudo mv kforth /usr/local/bin/
    sudo mv kforth-fast /usr/local/bin/


    Any user should then be able to execute kforth or kforth-fast. Note you must have superuser privilege to do this last step.

  7. Sample source code files are included in the archive. These files have extension .4th. Users may copy the example programs to their own directories.

  8. You may specify a default directory in which kforth will search for .4th files not found in the current directory. The environment variable KFORTH_DIR must be set to this directory. For example, under the BASH shell, if you want the default directory to be ~/kforth/kforth-x.y.z, add the following lines to your .bash_profile file:

    	KFORTH_DIR=~/kforth/kforth-x.y.z
    	export KFORTH_DIR
    


  9. The file kforth.xpm may be used to create a desktop icon for kForth under X Windows. For example, if you are using the KDE environment, copy kforth.xpm to the /usr/share/icons directory.