The screen of the installation program looks like figure .
The DOS install program screeninstall1 install2
The program allows you to select:
C:\PP
).
In order to run Free Pascal from any directory on your system, you must extend
your path variable to contain the C:\PP\BIN
directory.
Usually this is done in the AUTOEXEC.BAT file.
It should look something like this :
SET PATH=%PATH%;C:\PP\BIN\GO32V2for DOS or
SET PATH=%PATH%;C:\PP\BIN\WIN32for WINDOWS and finally
SET PATH=%PATH%;C:\PP\BIN\OS2for OS/2. (Again, assuming that you installed in the default location).
On OS/2, Free Pascal installs some libraries from the EMX package if they were not yet installed (the installer will notify you if they should be installed). They are located in the
C:\PP\DLLdirectory. The name of this directory should be added to the LIBPATH directive in the config.sys file:
LIBPATH=XXX;C:\PP\DLLObviously, any existing directories in the LIBPATH directive (indicated by XXX in the above example) should be preserved.
The installation of the coprocessor emulation is handled by the installation program (INSTALL.EXE) under DOS and WINDOWS.
If you use the .rpm format, installation is limited to
rpm -i fpc-pascal-XXX.rpm(XXX is the version number of the .rpm file)
If you use Debian, installation is limited to
dpkg -i fpc-XXX.debHere again, XXX is the version number of the .deb file.
You need root access to install these packages. The .tar file allows you to do an installation if you don't have root permissions.
When downloading the .tar file, or the separate files, installation is more interactive.
In case you downloaded the .tar file, you should first untar the file, in some directory where you have write permission, using the following command:
tar -xvf fpc.tarWe supposed here that you downloaded the file fpc.tar somewhere from the Internet. (The real filename will have some version number in it, which we omit here for clarity.)
When the file is untarred, you will be left with more archive files, and an install program: an installation shell script.
If you downloaded the files as separate files, you should at least download the install.sh script, and the libraries (in libs.tar.gz).
To install Free Pascal, all that you need to do now is give the following command:
./install.shAnd then you must answer some questions. They're very simple, they're mainly concerned with 2 things :
If you run the installation script as the root user, you can just accept all installation defaults. If you don't run as root, you must take care to supply the installation program with directory names where you have write permission, as it will attempt to create the directories you specify. In principle, you can install it wherever you want, though.
At the end of installation, the installation program will generate a configuration file (fpc.cfg) for the Free Pascal compiler which reflects the settings that you chose. It will install this file in the /etc directory or in your home directory (with name .fpc.cfg) if you do not have write permission in the /etc directory. It will make a copy in the directory where you installed the libraries.
The compiler will first look for a file .fpc.cfg in your home directory before looking in the /etc directory.
PPC_EXEC_PATH
contains the directory where support files for
the compiler can be found.
PPC_CONFIG_PATH
specifies an alternate path to find the fpc.cfg.
PPC_ERROR_FILE
specifies the path and name of the error-definition file.
FPCDIR
specifies the root directory of the Free Pascal installation.
(e.g : C:\PP\BIN
)
These locations are, however, set in the sample configuration file which is
built at the end of the installation process, except for the
PPC_CONFIG_PATH
variable, which you must set if you didn't install
things in the default places.
Also distributed in Free Pascal is a README file. It contains the latest instructions for installing Free Pascal, and should always be read first.
Furthermore, platform-specific information and common questions are addressed in the FAQ. It should be read before reporting any bug.
After the installation is completed and the optional environment variables are set as described above, your first program can be compiled.
Included in the Free Pascal distribution are some demonstration programs, showing what the compiler can do. You can test if the compiler functions correctly by trying to compile these programs.
The compiler is called
demo\hello.pp
) simply type :
fpc helloat the command prompt. If you don't have a configuration file, then you may need to tell the compiler where it can find the units, for instance as follows:
fpc -Fuc:\pp\units\go32v2\rtl hellounder DOS, and under LINUX you could type
fpc -Fu/usr/lib/fpc/NNN/units/linux/rtl hello(replace NNN with the version number of Free Pascal that you are using). This is, of course, assuming that you installed under
C:\PP
or
/usr/lib/fpc/NNN, respectively.
If you got no error messages, the compiler has generated an executable called hello.exe under DOS, OS/2 or WINDOWS, or hello (no extension) under UNIX and most other operating systems.
To execute the program, simply type :
helloIf all went well, you should see the following friendly greeting:
Hello world