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:
krishnamyneni@bellsouth.net
The kForth source package is distributed as compressed tar (Unix Tape
Archive) files:
- kforth-x86-linux-x.y.z.tar.gz (Linux version)
- kforth-x86-cygwin-x.y.z.tar.gz (Windows version)
- kforth-ppc-osx-x.y.z.tar.gz (Mac OS X version)
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:
- binutils
- gcc
- gcc-c++
- glibc
- glibc-devel
- libstdc++-devel
- make
- readline
- readline-devel
- ncurses
- ncurses-devel
- patchutils
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
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
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), additional packages are needed to
provide the 32-bit versions of the C/C++ libraries. The following additional
package names are given for 64-bit Ubuntu Linux (7.10), and they may be different
on other systems:
- ia32-libs
- lib32gcc1
- lib32stdc++6
- gcc-multilib
- lib32readline5
- lib32readline5-dev
- lib32ncurses5
- lib32ncurses5-dev
Build and Configuration
Assuming your Linux system has the required packages, follow these
steps to unpack, build, and install kForth:
- Create a directory for the kForth source files, typically
in your home directory, e.g.
mkdir ~/kforth
- Move the kForth archive file into this directory:
mv kforth-x86-linux-x.y.z.tar.gz ~/kforth
- 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.
- Change to the kforth-x.y.z directory:
cd kforth-x.y.z
- 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.
- 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.
Typically you must have root access to do this. Login as
root or superuser:
su
Next, move the executables to an appropriate directory
(/usr/local/bin/ is recommended):
mv kforth /usr/local/bin/
mv kforth-fast /usr/local/bin/
Any user should then be able to execute kforth or kforth-fast.
Return to normal user mode (exit from superuser mode).
- Sample source code files are included in the archive. These
files have extension
.4th. Users may copy the
example programs to their own directories.
- 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
- 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.
Installation under Windows
The Cygwin development tools must be
installed on your Windows system in order to build or rebuild the executables
from its source package. Windows users should note that kForth programs
(text files having the extension .4th) must be stored in
Unix text format rather than DOS text format. Many capable third-party
text editors for Windows provide the option of saving text files in Unix text
format. The Notepad editor does not have this option; however, one may use
the WordPad program bundled with Windows to view and save text files
in Unix text format. We recommend the
Emacs
editor for creating and editing .4th files. Follow these steps to build kForth
from its source files on your Windows system:
- Install Cygwin on
your system. The following packages, from the
Devel category, are needed to build
and maintain kForth:
- binutils
- gcc-core
- gcc-g++
- libncurses-devel
- make
- patchutils
- readline
Note that the above list of packages is not installed by
default in a Cygwin installation, so be sure to specifically
select them from Devel when prompted by the Cygwin
Setup program to select packages for installation. You
may run the Setup program multiple times if you forget to
select all of the packages.
- Download the kforth distribution file
kforth-x86-cygwin-x.y.z.tar.gz into the user's cygwin home directory.
- Start the Cygwin BASH shell.
- Create a directory for the kForth source files, typically
in the user's home directory, e.g.
mkdir kforth
- Move the kForth archive file
kforth-x86-cygwin-x.y.z.tar.gz
into this directory:
mv kforth-x86-cygwin-x.y.z.tar.gz kforth/
- Change to the
kforth/ directory
and extract the files:
cd kforth/
tar -zxvf kforth-x86-cygwin-x.y.z.tar.gz
After this step, a new directory called kforth-x.y.z will
be created. This directory and its subdirectories contain all of the kforth
source files, the Makefile(s), and a README
file containing these instructions. Change to the source directory:
cd kforth-x.y.z
- 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 the
executable files, named kforth.exe and
kforth-fast.exe, will be generated.
- Move the executables to the desired directory, typically
into /usr/local/bin if you want to run them from
any location within the bash shell.
- Sample source code files, with the extension
.4th,
are included in the archive file. These files are inteded to
serve as programming examples for kForth.
- If you will be running kForth from the Cygwin BASH shell,
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=$HOME/kforth/kforth-x.y.z
export KFORTH_DIR
- The file
kforth.ico may be used to create a
desktop icon for kforth under Windows.
Installation under Mac OS X
- Create a directory for the kforth source files, typically
in your home directory, e.g.
mkdir ~/kforth
- Move the kforth archive file into this directory:
mv kforth-ppc-osx-x.y.z.tar.gz ~/kforth
- Change to the ~/kforth directory and extract the files:
cd ~/kforth
tar -zxvf kforth-ppc-osx-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), and this README file.
- Change to the kforth-x.y.z directory:
cd kforth-x.y.z
- 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.
- 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.
Typically you must have root access to do this. Login as
root or superuser:
su
Next, move the executables to an appropriate directory
(/usr/local/bin/ is recommended):
mv kforth /usr/local/bin/
mv kforth-fast /usr/local/bin/
Any user should then be able to execute kforth or kforth-fast.
Return to normal user mode (exit from superuser mode).
- Sample source code files, with the extension
.4th, are
included in the archive file. These files are intended to
serve as programming examples for kforth.
- 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
your
~/kforth/kforth-x.y.z directory, add the following
lines to your .bash_profile file:
KFORTH_DIR=~/kforth/kforth-x.y.z
export KFORTH_DIR