Difference between revisions of "Installing Lazarus"

From Lazarus wiki
Jump to navigationJump to search
(Added original changes)
(Made all heading a level lower (= is for page title headings))
Line 1: Line 1:
=Overview=
+
==Overview==
  
 
For people who simply want to install Lazarus and start using it for programming, the easiest approach is to download and install a recent, reasonably stable binary release (such as a linux ".rpm" package or a Windows ".exe" package). You can read the sections under linux or windows entitled "fpc binaries" or the first paragraphs in the sections on installing Lazarus in linux or windows; most of the remaining information can be safely ignored.
 
For people who simply want to install Lazarus and start using it for programming, the easiest approach is to download and install a recent, reasonably stable binary release (such as a linux ".rpm" package or a Windows ".exe" package). You can read the sections under linux or windows entitled "fpc binaries" or the first paragraphs in the sections on installing Lazarus in linux or windows; most of the remaining information can be safely ignored.
Line 13: Line 13:
 
* FCL - the FreePascal Component library, containing most of the non-graphic components used by Lazarus
 
* FCL - the FreePascal Component library, containing most of the non-graphic components used by Lazarus
  
==Lazarus System Requirements==
+
===Lazarus System Requirements===
  
 
# FreePascal compiler, packages, and sources. (*important*: of the same version/date)
 
# FreePascal compiler, packages, and sources. (*important*: of the same version/date)
Line 26: Line 26:
 
The following sections will describe how to get FreePascal and how to install lazarus properly.
 
The following sections will describe how to get FreePascal and how to install lazarus properly.
  
=Installing The Free Pascal Compiler=
+
==Installing The Free Pascal Compiler==
  
 
There is an extensive discussion of how to install and build Free Pascal compilers available here - it may be a little too detailed for some users, but is very comprehensive.
 
There is an extensive discussion of how to install and build Free Pascal compilers available here - it may be a little too detailed for some users, but is very comprehensive.
Line 32: Line 32:
 
Lazarus requires fpc (FreePascal) version 1.9.x and it requires both the compiled fpc libs (binaries) and the fpc sources and of the same version. fpc 1.0.6 is too buggy and fpc 1.0.10 has problems opening forms created with fpc 1.9.x.
 
Lazarus requires fpc (FreePascal) version 1.9.x and it requires both the compiled fpc libs (binaries) and the fpc sources and of the same version. fpc 1.0.6 is too buggy and fpc 1.0.10 has problems opening forms created with fpc 1.9.x.
  
==Installing Free Pascal under Linux==
+
===Installing Free Pascal under Linux===
  
===FPC Binaries===
+
====FPC Binaries====
  
 
At the lazarus downloads section (http://www.lazarus.freepascal.org) you can get the RPM of the Free Pascal compiler (compiler / linux) and its packages. If you don't have an RPM-based distribution, you can download and install the tarballs from http://www.freepascal.org. If you want to compile the binaries for yourself, see the BSD section.
 
At the lazarus downloads section (http://www.lazarus.freepascal.org) you can get the RPM of the Free Pascal compiler (compiler / linux) and its packages. If you don't have an RPM-based distribution, you can download and install the tarballs from http://www.freepascal.org. If you want to compile the binaries for yourself, see the BSD section.
Line 52: Line 52:
 
Daily snapshot Debian packages can be downloaded from http://cYcnus.de/deb/. At present this contains only the compiled fpc components, but not the sources, which would be needed for most Lazarus programming.
 
Daily snapshot Debian packages can be downloaded from http://cYcnus.de/deb/. At present this contains only the compiled fpc components, but not the sources, which would be needed for most Lazarus programming.
  
===FPC Sources===
+
====FPC Sources====
  
 
The easiest way to get the freepascal sources is via cvs. You can also download it as whole; see http://www.freepascal.org/develop.html for the daily snapshot of the 1.9.x release tree.
 
The easiest way to get the freepascal sources is via cvs. You can also download it as whole; see http://www.freepascal.org/develop.html for the daily snapshot of the 1.9.x release tree.
Line 67: Line 67:
 
  []$ cvs -z3 update -dP
 
  []$ cvs -z3 update -dP
  
==Installing Free Pascal under Windows==
+
===Installing Free Pascal under Windows===
  
===FPC Binaries for Windows===
+
====FPC Binaries for Windows====
  
 
By far the easiest way to get a working installation of Free Pascal is to download the current binary Windows release of Lazarus from the SourceForge repository - the release contains the current versions of the FreePascal compiler and the FreePascal libraries as well as the lazarus IDE. If you want to install from sources, read on!
 
By far the easiest way to get a working installation of Free Pascal is to download the current binary Windows release of Lazarus from the SourceForge repository - the release contains the current versions of the FreePascal compiler and the FreePascal libraries as well as the lazarus IDE. If you want to install from sources, read on!
Line 75: Line 75:
 
You can get the installer zip for fpc 1.9.3 at Free Pascal's download section. Installing from the sources -- see the next section to know how to get them -- is not for novices, since you need a starting compiler as well.
 
You can get the installer zip for fpc 1.9.3 at Free Pascal's download section. Installing from the sources -- see the next section to know how to get them -- is not for novices, since you need a starting compiler as well.
  
===FPC Sources for Windows===
+
====FPC Sources for Windows====
  
 
The easiest way to get the Free Pascal sources is via CVS; see the next section for more on that. You can also download the package as a whole -- see http://www.freepascal.org/develop.html for the daily snapshot of the 1.9.x release tree.
 
The easiest way to get the Free Pascal sources is via CVS; see the next section for more on that. You can also download the package as a whole -- see http://www.freepascal.org/develop.html for the daily snapshot of the 1.9.x release tree.
Line 106: Line 106:
 
   ToDo: Explain how to download fpc sources and build the compiler
 
   ToDo: Explain how to download fpc sources and build the compiler
  
==Installing Free Pascal under BSD/manually==
+
===Installing Free Pascal under BSD/manually===
  
 
     Effectively, you need
 
     Effectively, you need
Line 145: Line 145:
 
             * BSDHIER=1 on all make commands forces BSD hierarchy conventions.
 
             * BSDHIER=1 on all make commands forces BSD hierarchy conventions.
  
==Installing Free Pascal under Mac OS X==
+
===Installing Free Pascal under Mac OS X===
  
 
     You need the Apple Developer-tools, X11, gtk1.2:
 
     You need the Apple Developer-tools, X11, gtk1.2:
Line 192: Line 192:
 
  []$ cvs -z3 update -dP
 
  []$ cvs -z3 update -dP
  
=Installing Lazarus=
+
==Installing Lazarus==
  
==Installing Lazarus under Linux==
+
===Installing Lazarus under Linux===
  
 
         The easiest way to get a current working installation of Lazarus is to download the RPMs for FreePascal and Lazarus from the SourceForge repository.
 
         The easiest way to get a current working installation of Lazarus is to download the RPMs for FreePascal and Lazarus from the SourceForge repository.
Line 247: Line 247:
 
  []$ make idepkg
 
  []$ make idepkg
  
===Installing Lazarus under Debian GNU/Linux===
+
====Installing Lazarus under Debian GNU/Linux====
  
 
         There are preliminary Debian packages for lazarus available for download.
 
         There are preliminary Debian packages for lazarus available for download.
Line 300: Line 300:
 
             Works pretty much the same as under Linux. But you need to install first the apple developer tools and X11:
 
             Works pretty much the same as under Linux. But you need to install first the apple developer tools and X11:
  
==Installing Lazarus under Windows==
+
===Installing Lazarus under Windows===
  
 
             The current releases of the Windows Lazarus binary packages install very easily, and should work 'out-of-the-box'. The binary package is available for Linux and Windows from
 
             The current releases of the Windows Lazarus binary packages install very easily, and should work 'out-of-the-box'. The binary package is available for Linux and Windows from
Line 376: Line 376:
 
             Once you have got the environment and PATHS correct, it is worth saving the settings to a file, otherwise you will have to go through this process for each new project. In the Run -> Compiler options dialog there is a Load/Save button; select this and then save the setings to the filename of your choice: mine is ~/FreePascal/default.cfg. Then each time I start a new project, I can go to the Run -> Compiler Options dialog (or Project -> Compiler Options), select Load/Save, and load my default.cfg file to the new project. You can, of course, modify the options for each new project if you so desire.
 
             Once you have got the environment and PATHS correct, it is worth saving the settings to a file, otherwise you will have to go through this process for each new project. In the Run -> Compiler options dialog there is a Load/Save button; select this and then save the setings to the filename of your choice: mine is ~/FreePascal/default.cfg. Then each time I start a new project, I can go to the Run -> Compiler Options dialog (or Project -> Compiler Options), select Load/Save, and load my default.cfg file to the new project. You can, of course, modify the options for each new project if you so desire.
  
==Installing Lazarus under BSD==
+
===Installing Lazarus under BSD===
  
 
   Please write me!
 
   Please write me!
Line 384: Line 384:
 
Please see the SiteUpdateLog for a history of changes to this page
 
Please see the SiteUpdateLog for a history of changes to this page
  
=User Comments=
+
==User Comments==
 +
Maybe move those to the talk page? [[User:Vincent|Vincent]] 14:16, 18 Feb 2005 (PST)
  
==Posted by Claude Rieth on October 31, 2003 at 00:58:59 PST==
+
===Posted by Claude Rieth on October 31, 2003 at 00:58:59 PST===
  
 
Installing on a Debian Woody:
 
Installing on a Debian Woody:
Line 413: Line 414:
 
Claude
 
Claude
  
==Posted by Installing on Debian on July 8, 2004 at 10:28:35 PDT==
+
===Posted by Installing on Debian on July 8, 2004 at 10:28:35 PDT===
  
 
This is my version how I successfully installed Lazarus on Debian.
 
This is my version how I successfully installed Lazarus on Debian.
Line 441: Line 442:
 
Malte
 
Malte
  
==Posted by Olivier Garet on August 17, 2004 at 01:43:21 PDT==
+
===Posted by Olivier Garet on August 17, 2004 at 01:43:21 PDT===
  
 
Installing on debian
 
Installing on debian
Line 465: Line 466:
 
Hope this helps.
 
Hope this helps.
  
==Posted by ridz on October 2, 2004 at 00:45:38 PDT==
+
===Posted by ridz on October 2, 2004 at 00:45:38 PDT===
  
 
Installing on Slackware 10.0
 
Installing on Slackware 10.0
Line 496: Line 497:
 
(dunno why anyone would want to un-install it!)
 
(dunno why anyone would want to un-install it!)
  
==Posted by Giuseppe Ridinò (pepecito AT email.it) on October 6, 2004 at 00:51:32 PDT==
+
===Posted by Giuseppe Ridinò (pepecito AT email.it) on October 6, 2004 at 00:51:32 PDT===
 
     Installing in WINDOWS using Lazarus IDE:
 
     Installing in WINDOWS using Lazarus IDE:
 
     As windows it is not possible to modify an executable (lazarus.exe) while it is running, the "build Lazarus" command in the IDE will terminate with an error while trying to link the lazarus.exe file.
 
     As windows it is not possible to modify an executable (lazarus.exe) while it is running, the "build Lazarus" command in the IDE will terminate with an error while trying to link the lazarus.exe file.
Line 506: Line 507:
 
     5. you can then remove the lazold.exe.
 
     5. you can then remove the lazold.exe.
  
==Posted by amiso (Alain.Michaud AT nrc-cnrc.gc.ca) on December 1, 2004 at 19:10:39 PST==
+
===Posted by amiso (Alain.Michaud AT nrc-cnrc.gc.ca) on December 1, 2004 at 19:10:39 PST===
 
     Install Lazarus 0.9.4 on Mandrake 10.1
 
     Install Lazarus 0.9.4 on Mandrake 10.1
  
Line 717: Line 718:
  
 
==Original contributors and changes==
 
==Original contributors and changes==
This page has been converted from the epikwiki [http://lazarus-ccr.sourceforge.net/index.php?wiki=InstallingLazarus version].
 
 
This page has been converted from the epikwiki [http://lazarus-ccr.sourceforge.net/index.php?wiki=InstallingLazarus version].
 
This page has been converted from the epikwiki [http://lazarus-ccr.sourceforge.net/index.php?wiki=InstallingLazarus version].
 
* Initially imported and formatted. [[User:Tom | VlxAdmin]] 9/22/2003
 
* Initially imported and formatted. [[User:Tom | VlxAdmin]] 9/22/2003
Line 723: Line 723:
 
* Updated "What is required for lazarus". AndrewJohnson 10/1/2003
 
* Updated "What is required for lazarus". AndrewJohnson 10/1/2003
 
* Finished formatted the InstallingLazarus page [[User:Tom | VlxAdmin]] 2/22/2004
 
* Finished formatted the InstallingLazarus page [[User:Tom | VlxAdmin]] 2/22/2004
* Posted some notes about Installing FPC and Lazarus: mostly reflecting experiences in trying to get the PATHS right in Linux. 3/11/2004 [[User:Krikpatc]]
+
* Posted some notes about Installing FPC and Lazarus: mostly reflecting experiences in trying to get the PATHS right in Linux. 3/11/2004 [[User:Kirkpatc]]
* Copied the contents of my note into the main InstallingLazarus section, edited it slightly. I don't know how to remove the original note. 3/12/2004 [[User:Krikpatc]]
+
* Copied the contents of my note into the main InstallingLazarus section, edited it slightly. I don't know how to remove the original note. 3/12/2004 [[User:Kirkpatc]]
 
* Removed the original note. Tidied the wiki and formatting a bit. [[User:Tom | VlxAdmin]]
 
* Removed the original note. Tidied the wiki and formatting a bit. [[User:Tom | VlxAdmin]]
* Corrected a couple of typos - 3/12/2004 [[User:Krikpatc]]
+
* Corrected a couple of typos - 3/12/2004 [[User:Kirkpatc]]
 
* Added link for daily snapshot deb packages - 3/27/2004 [[User:Vincent | Vincent]]
 
* Added link for daily snapshot deb packages - 3/27/2004 [[User:Vincent | Vincent]]
* Fixed links in GettingLazarus (downloading binaries) and several other pages. 22 July 2004 [[User:Krikpatc]]
+
* Fixed links in GettingLazarus (downloading binaries) and several other pages. 22 July 2004 [[User:Kirkpatc]]
 
* Added link for lazarus deb packages - 19 August 2004 VincentSnijders
 
* Added link for lazarus deb packages - 19 August 2004 VincentSnijders
* Added a short note on installing in Debian - 23 Nov 2004 [[User:Krikpatc]]
+
* Added a short note on installing in Debian - 23 Nov 2004 [[User:Kirkpatc]]
* Considerable re-write and re-organization of installation section - 11 Dec 2004 [[User:Krikpatc]]
+
* Considerable re-write and re-organization of installation section - 11 Dec 2004 [[User:Kirkpatc]]

Revision as of 23:16, 18 February 2005

Overview

For people who simply want to install Lazarus and start using it for programming, the easiest approach is to download and install a recent, reasonably stable binary release (such as a linux ".rpm" package or a Windows ".exe" package). You can read the sections under linux or windows entitled "fpc binaries" or the first paragraphs in the sections on installing Lazarus in linux or windows; most of the remaining information can be safely ignored.

For those who want to participate in the development of the compiler or the IDE, or for those who want the most up-to-date tools, an installation from source files is necessary, and much of the rest of this information is relevant.

Lazarus provides two main parts:

  • LCL - the Lazarus Component Library
  • IDE - the RAD tool

These in turn are dependent on

  • FPC - the freePascal compiler
  • FCL - the FreePascal Component library, containing most of the non-graphic components used by Lazarus

Lazarus System Requirements

  1. FreePascal compiler, packages, and sources. (*important*: of the same version/date)
  2. A supported Widget tool-kit
    Win32
    : The native Win32 API can be used
    Linux/xxxBSD
    GTK+ 1.2.x : Most Linux distributions and *BSDs already install the GTK+ 1.2.x libraries. You can also find them at http://www.gtk.org.
    You'll also want gdk-pixbuf, 0.13 or newer (preferably 0.18 or newer), which is also found in most recent distributions from the past 2 years. The source is available from ftp://ftp.gnome.org/pub/GNOME/sources/gdk-pixbuf/
    Mac OS X
    GTK+ 1.2.x : You need the apple developer tools, X11 and GTK1.2. See below Installing under Mac OS X.
    GTK+ 2.x
    WARNING : The GTK2 interface is not yet complete and is only for testing purposes.
    It's found in most recent distributions. For the source see http://www.gtk.org.

The FAQ - Frequently Asked Questions file is available at http://www.lazarus.freepascal.org . Some of the questions can be found in the local file 'FAQ'.

The following sections will describe how to get FreePascal and how to install lazarus properly.

Installing The Free Pascal Compiler

There is an extensive discussion of how to install and build Free Pascal compilers available here - it may be a little too detailed for some users, but is very comprehensive.

Lazarus requires fpc (FreePascal) version 1.9.x and it requires both the compiled fpc libs (binaries) and the fpc sources and of the same version. fpc 1.0.6 is too buggy and fpc 1.0.10 has problems opening forms created with fpc 1.9.x.

Installing Free Pascal under Linux

FPC Binaries

At the lazarus downloads section (http://www.lazarus.freepascal.org) you can get the RPM of the Free Pascal compiler (compiler / linux) and its packages. If you don't have an RPM-based distribution, you can download and install the tarballs from http://www.freepascal.org. If you want to compile the binaries for yourself, see the BSD section.

Instructions:

Download lastest files from http://sourceforge.net/project/showfiles.php?group_id=89339. As example:

  • fpc-1.9.5-040808.i386.rpm
  • fpcsrc-1.9.5-040808.i386.rpm
  • lazarus-0.9.2.1-fpc_1.9.5_040808.i386.rpm

and install them with:

  • rpm -Uvh fpc-1.9.5-040808.i386.rpm
  • rpm -Uvh fpcsrc-1.9.5-040808.i386.rpm
  • rpm -Uvh lazarus-0.9.2.1-fpc_1.9.5_040808.i386.rpm

Daily snapshot Debian packages can be downloaded from http://cYcnus.de/deb/. At present this contains only the compiled fpc components, but not the sources, which would be needed for most Lazarus programming.

FPC Sources

The easiest way to get the freepascal sources is via cvs. You can also download it as whole; see http://www.freepascal.org/develop.html for the daily snapshot of the 1.9.x release tree.

Getting Last FPC Sources via CVS

Create a directory, where you would like to put the sources. You don't need to be root to do this. Any normal user can do this. First create a directory for fpc (e.g. /home/username/freepascal) then do the following:

[]$ bash
[]$ export CVSROOT=:pserver:cvs@cvs.freepascal.org:/FPC/CVS
[]$ cvs login   // password is 'cvs' without the commas.
[]$ cvs -z3 co fpc   // This will create a directory called 'fpc', which can be later used in the IDE.

Hint: To download/update the latest changes you can simply do

[]$ cd /home/username/freepascal/fpc
[]$ cvs -z3 update -dP

Installing Free Pascal under Windows

FPC Binaries for Windows

By far the easiest way to get a working installation of Free Pascal is to download the current binary Windows release of Lazarus from the SourceForge repository - the release contains the current versions of the FreePascal compiler and the FreePascal libraries as well as the lazarus IDE. If you want to install from sources, read on!

You can get the installer zip for fpc 1.9.3 at Free Pascal's download section. Installing from the sources -- see the next section to know how to get them -- is not for novices, since you need a starting compiler as well.

FPC Sources for Windows

The easiest way to get the Free Pascal sources is via CVS; see the next section for more on that. You can also download the package as a whole -- see http://www.freepascal.org/develop.html for the daily snapshot of the 1.9.x release tree.

Windows FPC Sources via CVS

You will need to have a CVS client such as TortoiseCVS or WinCVS installed in order to perform the steps below. The exact commands vary between CVS clients; the ones given below are to be used under CVS home's client, which is available for download here.

First create a directory in which you'd like to put the sources. Any normal user can do this. Create a directory for fpc (e.g. C:\Source), then do the following at the command prompt:

 C:\Source> set CVSROOT=:pserver:cvs@cvs.freepascal.org:/FPC/CVS
 C:\Source> cvs login      // password is 'cvs' without the commas
 C:\source> cvs -z3 co fpc // This will create a directory fpc, which can be later used in the IDE.
 Hint: To download/update the latest changes you can simply do
 C:\> cd Source\FPC
 C:\Source\FPC> cvs -z3 update -dP
 ToDo: Write me.

See: http://www.freepascal.org/down-win32.html . You can find a list of mirrors at http://www.freepascal.org/sdown.html. Download FPC as one big file, unzip it and run the install.exe.

Extending your PATH variable to the fpc directory:

  • Win98: Edit autoexec.bat and add the line: PATH=%PATH%;C:\pp\bin\bin\win32
  • WinXP/2k: My Computer (Right Click) -> Properties -> Advanced (Page) -> Enviroment Variables -> System Variables -> Edit "PATH", Add "C:\pp\bin\bin\win32" there.

Then restart windows.

 ToDo: Explain how to download fpc sources and build the compiler

Installing Free Pascal under BSD/manually

    Effectively, you need
       A file with all sources, or two (fpc and lazarus)
          1. e.g. for fpc ftp://ftp.freepascal.org/fpc/dist/Linux/separate/sources.tar preferably an export (no CVS/ dirs). The above file misses this
          2. Lazarus source snapshot.
                 * _any_ starting compiler from the 1.9 branch) You can do a check by parsing the output of ppc386 -i if it is 1.9.3 .. 2.0.x it is ok.
                 * - dependant packages. (for FreeBSD that is gtk12, glib12 and gdk_pixbuf and GNU make, iconv and gettext)
    FPC build:
       1. (fetch) necessary files (FPC source, starting compiler)
       2. (extract) Then de-tgz in work directory,
       3. (build) enter work/fpc/ and run
$MAKE all OPT='-gl -O3p3'  PP=/path/to/startingcompiler-name-ppc386
(/path/to/ can be omitted when ppc386 is in the path)
($MAKE is make on linux and gmake on BSD)
       4. (install) then, again in work/fpc, run
$MAKE install PP=compiler/ppc386 PREFIX=$THEPREFIX
(THEPREFIX= usually is /usr/lcoal, but e.g. on NetBSD it is /usr/pkg for ports)
Create a symlink:
  ln -s $THEPREFIX/lib/fpc/1.0.8/ppc386 $THEPREFIX/bin/ppc386
     install sourceinstall PREFIX=$THEPREFIX
       5. (configure) run compiler/utils/samplecfg $THEPREFIX/lib/fpc/1.9.3 $ETCDIR
       6. (optional, test), see if ppc386 -i gives output, else give a warning that user need to add $PREFIX/bin to his current path. Try to compiler a program with -viwn, and see if that gives errors.
        Notes:
           * If you need fpcmake package lists, you need to generate or supply them yourself, (in the port, or in an extra archive) either way, do a dummy install to /tmp/pack and determine the files installed with find . >ll
           * $THEPREFIX and $ETCDIR should be user configurable. Otherwise local installs aren't possible.
           * BSDHIER=1 on all make commands forces BSD hierarchy conventions.

Installing Free Pascal under Mac OS X

    You need the Apple Developer-tools, X11, gtk1.2:
       Downloading packages and installing them properly can be a time consuming task. Therefore there are various package managers. One of them is fink:
       Download fink from
       http://fink.sourceforge.net/download/index.php?phpLang=en; follow the
       install instructions
       Developer-tools: Are included on the original OSX installation-CDs, or download at ADC (free registration required)
       http://developer.apple.com/.
       Apple X11: On a fresh system: choose "Customize" in the install-dialogue, check "X11".
       On an already installed system: download at
       http://www.apple.com/downloads/macosx/apple/x11formacosx.html
       In the Terminal, run
       'sudo fink install gtk-pixbuf gtk+ gtk+-data gtk+-shlibs gtk-doc 1.2-13 gtkglarea gtk-engines'
       The X11-Application is in /Applications/Utilities/X11.
       Hint:
       Most X11 programs, including lazarus expect to receive focus, when the users clicks on a window. Under MacOSX this deactivated. You can activate it for all X11 applications by typing in the terminal:
       defaults write com.apple.x11 wm_click_through -bool true
       Free Pascal Compiler:
       Then download and install the Free Pascal Compiler (at least 1.9.5 from 16th Aughust 2004) from
       https://sourceforge.net/project/showfiles.php?group_id=89339
       For lazarus you need the fpc sources as well:
       Create a directory, where you would like to put the sources. You don't need to be root to do this. Any normal user can do this. First create a directory for fpc (e.g. /Users/username/freepascal) then open a terminal and do the following:
[]$ bash
[]$ export CVSROOT=:pserver:cvs@cvs.freepascal.org:/FPC/CVS
[]$ cvs login
           password is 'cvs' without the 
[]$ cvs -z3 co fpc
       This will create a directory called 'fpc', which can be later used in the IDE.
       Hint: To download/update the latest changes you can simply do
[]$ cd /Users/username/freepascal/fpc
[]$ cvs -z3 update -dP

Installing Lazarus

Installing Lazarus under Linux

       The easiest way to get a current working installation of Lazarus is to download the RPMs for FreePascal and Lazarus from the SourceForge repository.
       You need to download the selected version of
       the compiler (eg fpc-1.9.5-041207.i386.rpm),
       the pascal source library (eg fpcsrc-1.9.5-041207.i386.rpm)
       and the Lazarus package (eg lazarus-0.9.2.4-fpc_1.9.5_041207.i386.rpm).
       You then issue the following commands (you need to have root privileges - use su or sudo)
       rpm -Uvh fpc-1.9.5-041207.i386.rpm
       rpm -Uvh fpcsrc-1.9.5-041207.i386.rpm
       rpm -Uvh lazarus-0.9.2.4-fpc_1.9.5_041207.i386.rpm
       If you prefer to install from source and compile the files yourself, follow these instructions. Because the whole lazarus stuff is installed into one directory, uninstall is very easy and you don't need to be root to install lazarus. You can get tgz files for fpc, fpcsrc and lazarus from the downloads section or you can download it directly via cvs.
       Downloading lazarus cvs: cvs provides an easy way to update your sources by only downloading the changes. This is the recommended way and saves you a lot of time. A connection to the internet is needed for this: You don't to be root. Lazarus does not need any special permissions, neither during installation nor at runtime. First create a directory for lazarus (e.g. /home/username/freepascal) then do the following:
connect to the cvs server (note: lazarus and freepascal use the same server)
[]$ export CVSROOT=:pserver:cvs@cvs.freepascal.org:/FPC/CVS
[]$ cvs login
password is 'cvs' without the 
download the lazarus sources:
[]$ cvs -z3 co lazarus
compile lazarus:
[]$ cd lazarus
[]$ make  (gmake on BSD)
       If fpc is installed correctly, the compilation should work without problems. If not, see FAQ.
Start lazarus
[]$ ./lazarus
       The IDE should start. If you started lazarus in a terminal, you can see some notes about missing settings. This is normal at first start. The IDE automatically tries to find out where the freepascal compiler and its sources are installed by searching in the most common directories.
Check the paths:
  Use the IDE menu to go to
    Environment -> Environment Options -> Files
       The 'FPC Source directory' should point to your fpc source directory. This directory normally ends with /fpc/ or /fpcsrc/ (e.g. /usr/src/fpcsrc or /home/username/freepascal/fpc) and contains directories like 'compiler', 'docs', 'fcl', 'rtl' and 'packages'.
       ToDo: explain the other paths
Hint:
To update lazarus you can use
[]$ cd /home/username/freepascal/lazarus
[]$ cvs -z3 update -dP
[]$ make clean all   (gmake on BSD)
This will rebuild lazarus and create an IDE without lazarus packages. To
link your installed packages do *after* the above:

[]$ make idepkg

Installing Lazarus under Debian GNU/Linux

       There are preliminary Debian packages for lazarus available for download.
       Make sure you read /usr/share/doc/lazarus/README.Debian carefully before you start using it.
       Feedback is needed and appreciated; please send your comments to Carlos Laviola <claviola@debian.org>.
        Another (?easier) way to install Lazarus under Debian.
       Added by ChrisKirk
           Simple Lazarus Installation in Debian
           (assume new Debian installation, without development libraries loaded)
           From sourceforge repository, download latest fpc, fpclib and lazarus releases; follow links from http://lazarus.freepascal.org, click the "downloads" button on the left, then click on "binaries" then "linux" then "Current Lazarus RPM". This will bring you to
http://sourceforge.net/project/showfiles.php?group_id=89339


           then download the following files (or more recent, if available)
fpc-1.9.5-041001.i386.rpm
fpcsrc-1.9.5-041001.i386.rpm
lazarus-0.9.2.2-fpc_1.9.5_041001.i386.rpm
           cd to the directory where these files are stored, then become root (su) and type:
alien fpc*     //this will convert both the fpc and fpcsrc files to debian format
alien laz*


           then use kpackage or a similar utility to install the fpc, fpcsrc and lazarus
           **.rpm.deb files
           You need to produce a configuration file, which will reside in /etc/fpc.cfg
           Still as root, cd to the main fpc directory /usr/lib/fpc/1.9.5 and then type
sh ./samplecfg /usr/lib/fpc/1.9.5 /etc


           Check the contents of your new configuration file (cat /etc/fpc.cfg) and make any changes you want using vi or another text editor.
           You need to install the development packages of the GTK and pixbuf libraries, so
apt-get install libgtk2.0-dev
apt-get install libgdk-pixbuf-dev


           Then you should be ready to start programming!
        Installing Lazarus under Mac OS X
           Works pretty much the same as under Linux. But you need to install first the apple developer tools and X11:

Installing Lazarus under Windows

           The current releases of the Windows Lazarus binary packages install very easily, and should work 'out-of-the-box'. The binary package is available for Linux and Windows from
           http://sourceforge.net/project/showfiles.php?group_id=89339
           Download the latest release (currently Lazarus-0.9.2.4-20041210-win32.exe) and launch the application. You will be taken through a typical Windows installation, in which the FPC compiler and source libraries are installed within the same directory structure as Lazarus, and the IDE should launch and operate without significant problems, provided you have uninstalled any previous version of Lazarus and/or FPC (often found in the C:\pp directory).
           If you prefer to install from sources, then follow these instructions (Thanks to Joe for this Step-by-step description)
           You have to download the lazarus source:
ftp://ftp.freepascal.org/pub/fpc/source/lazarus.zip
           Then unzip it to c:\lazarus for example. You have to install at least fpc-1.9.3. It compiles for me, and lazarus.exe works. The path to my fpc is: c:\pp\bin\win32. In this directory you can find a lot of exe (make, grep, ppc386, and so on).
           Open a command line. Start->Run...>command or choose MS-DOS icon.
Type:
cd c:\lazarus
set path=c:\pp\bin\win32;c:\lazarus  //of course change the first to
                                     //the path of yours
windres -i lazarus.rc -o lazarus.res
make
           If you are lucky then you can type: lazarus.exe. The source editor, dialogs and the property editor work, but not perfectly... Look and you will see.
           You can compile examples also:
cd examples
make
           If you extracted lazarus to another drive, eg.: d:\lazarus. It can happen that you need the gnu utility to make it. If you have it, you can take its path to set path=...;<gmakepath> but it is simpler not to choose drive d:\
           That's all.
        Additional experiences and advice on installing FPC and Lazarus


           On linux, getting Lazarus to work can be complicated. If you have already installed earlier versions of FPC and/or Lazarus, you have to take great care that the PATHS are adjusted so that only your new versions are called.
           Pitfalls that I have experienced in various attempts with SuSE linux include:
           The rpm versions often install FPC in /bin or /usr/bin, with the libraries in /lib or /usr/lib.
           If you perform a make install on a source version or use a .tar.gz, the compiler is usually installed in /usr/local/bin with the libraries in /usr/local/lib.
           So if earlier versions have been installed from rpm, make sure all links are changed to reflect the directory structure of your new compiler. The place to make the changes is in /etc/fpc.cfg ; make sure there are no remnant configuration files in your home directory or in your FPC download directory. Typically they are found in ~/.fpc.cfg
           Make sure the links in /etc/fpc.cfg point to the correct versions of the libraries (particularly if you have older versions still lurking around).
           In /usr/local/bin or /usr/bin there is a file called fpc ; this is the executable that is called when you invoke the compiler. One of the first things it does is to open ppc386 in the same directory. This has to be the same version as the fpc file, or can be a link pointing to the true ppc386 in some other directory (such as a library directory, or the fpc directory in your own development space); be sure to update your link if you install a newer version of the compiler.
           Try running the compiler from the command line using one of the simple example programs or one which you wrote yourself.
           Turning to Lazarus:
           If you use a downloaded snapshot (.tar.gz) or get the source from CVS, enter your lazarus directory and type
make
./lazarus 
           and hopefully the IDE should load. There may be a message saying it can't find the sources; if so, go to the menu at the top and select Environment -> Environment options and insert the name of the directory where you expect to find your lazarus files (eg ~/FreePascal/lazarus), your compiler (eg /usr/local/bin/ppc386), the FreePascal source directory (eg /usr/local/lib/fpc/$version/fpc or a directory in your own space eg ~/FreePascal/fpc). Then close the dialog and start programming.
           You may find further problems when you start programming or compiling; most of these will be related to PATH selection.
           Many of the difficulties are dealt with in the Lazarus FAQ, found either on this WiKi site, or a more complete list on the main Lazarus site

http://www.lazarus.freepascal.org/modules.php?op=modload&name=FAQ&file=index

           From the top menu select Run -> Compiler Options (or Project -> Compiler Options in more recent releases of Lazarus) and select the Paths tab on the resulting dialog. There are several boxes for entry of paths for Unit files, Include files, Other source files, Libraries etc. For each of these, it is worth pressing the ... (ellipsis) button on the right, and you will be given a blank window for inserting path information, and a lower window giving some suggestions. Select as many as you like (or ALL!) and press the ADD button to transfer the selections to the upper window. When your selection is complete, press OK and move on to the next box. If you know of other paths which need to be followed, press the Browse button associated with each box, and insert the additional paths.
           When you think you have got your paths right, try to compile your application. If there are further path-related errors ('can't find unit .......') then go back and check your paths, both in /etc/fpc.cfg and in your Run -> Compiler Options dialog (or Project -> Compiler Options depending on your version).
           Once you have got the environment and PATHS correct, it is worth saving the settings to a file, otherwise you will have to go through this process for each new project. In the Run -> Compiler options dialog there is a Load/Save button; select this and then save the setings to the filename of your choice: mine is ~/FreePascal/default.cfg. Then each time I start a new project, I can go to the Run -> Compiler Options dialog (or Project -> Compiler Options), select Load/Save, and load my default.cfg file to the new project. You can, of course, modify the options for each new project if you so desire.

Installing Lazarus under BSD

 Please write me!

Contributors and Changes

Please see the SiteUpdateLog for a history of changes to this page

User Comments

Maybe move those to the talk page? Vincent 14:16, 18 Feb 2005 (PST)

Posted by Claude Rieth on October 31, 2003 at 00:58:59 PST

Installing on a Debian Woody:

As it is RPM packages I installed them using

rpm -i --nodep

needed to create a directory first to get rpm running but then it went okay.

To be able to use the compiler, I had to manually simlink

libX11.so -> libX11.so.6 libgtk.so -> libgtk-1.2.so.0.9.1 libgdk.so -> libgdk-1.2.so.0.9.1 libXi.so -> libXi.so.6.o libXext.so -> libXext.so libglib.so -> libglib-1.2.so.0.0.10

And then it worked. Actually coding my usual NEW ENVIRONMENT PROJECT, a RPN calculator, will post it when ready.

BTW: To the maintainer of TPanel, TCustomPanel, with the VCL, if I set the Borderwidth to 2 (ex.), the caption of the panel is moved that far away from the border (at least in Delphi 6), so it becomes more readable, this can easily be done in the LCL by adding another inflateRect(...,-BorderWidth,-BorderWidth) just before the Textout(...) that does the caption, but as I do not know yet how to add this to the offical LCL source codes, I just put it here.

Regards,

Claude

Posted by Installing on Debian on July 8, 2004 at 10:28:35 PDT

This is my version how I successfully installed Lazarus on Debian.

Installing FPC:

Download fpc-1.9.x.i386.tar (in my case x was 4) and unpack the archive. Go into the folder in which you had unpacked FPC and type (as root if needed) "./sh install.sh". Follow the instructions of the script (I simply install all packages). You have now successfully installed FPC.

Installing gtk+: type as root: "apt-get install libgtk1.2-dev" this will install gtk+. then install gdk-pixbuf with the command: "apt-get install libgdk-pixbuf-dev"

Installing Lazarus:

First download lazarus-040529.tgz (or a file with a newer version number) and unpack the archive. Go to the folder with the unpacked files and enter "make clean all" (you do not need to be root). Compiling will need a good minute on a 1GHZ PC. If all works well you can start lazarus with ./lazarus.

If you get errors at the end of the compiling, possibly you have not all needed packages installed. Try to find out how to install the missing packages and try to compile again. At my first try libgtk1.2-dev was missing, at the second try it was libgdk-pixbuf-dev, the third try successfully build Lazarus.

Wine:

If this was too difficult to you, you could try out the Windows version of Lazarus with wine. It works (without a Windows installation), I've wrote and started a "Hello World" program within three minutes after downloading the Windows version.

Happy programming :-)

Malte

Posted by Olivier Garet on August 17, 2004 at 01:43:21 PDT

Installing on debian

In fact, it seems that the current CVS is ready for building a debian package.

=> dowload lazarus.zip , unzip it, cd to the directory lazarus.

Verify that the fpc-* packages are installed.

Now

chmod +x debian/rules touch fpcdebug.txt dpkg-buildpackage

You should now get a package lazarus_0.9.1beta-0_i386.deb

Verify that the package tct is NOT installed (it has a /usr/bin/lazarus file !)

Now, dpkg -i ../lazarus_0.9.1beta-0_i386.deb should install the package.

Hope this helps.

Posted by ridz on October 2, 2004 at 00:45:38 PDT

Installing on Slackware 10.0

1) Download the rpm version of the required binaries, eg:

fpc-1.9.5-040808.i386.rpm fpcsrc-1.9.5-040808.i386.rpm lazarus-0.9.2.2-fpc_1.9.5_041001.i386.rpm

2) Convert the 'rpm' files to Slackware 'tgz' format using

the rpm2tgz utility (usually installed as standard): rpm2tgz fpc-1.9.5-040808.i386.rpm rpm2tgz fpcsrc-1.9.5-040808.i386.rpm rpm2tgz lazarus-0.9.2.2-fpc_1.9.5_041001.i386.rpm

3) Rename the resulting 'tgz' files as follows in order

to satisfy Slackware package manager naming convention: fpc-1.9.5.040808-i386.tgz fpcsrc-1.9.5.040808-i386.tgz lazarus-0.9.2.2fpc195.041001-i386.tgz

4) Install all 3 using the 'installpkg' utility.

Enjoy! :)

NOTE: To uninstall 'lazarus' use the removepkg utility (dunno why anyone would want to un-install it!)

Posted by Giuseppe Ridinò (pepecito AT email.it) on October 6, 2004 at 00:51:32 PDT

   Installing in WINDOWS using Lazarus IDE:
   As windows it is not possible to modify an executable (lazarus.exe) while it is running, the "build Lazarus" command in the IDE will terminate with an error while trying to link the lazarus.exe file.
   A valid walk-around is the following:
   1. rename your lazarus.exe to something like lazold.exe and use it instead of lazarus.exe;
   2. (optional) if you need to install more components this is the right moment, then add them now!
   3. Use lazold.exe to build the new lazarus.exe;
   4. if the operation is succesfull you will find a new lazarus.exe file to be used;
   5. you can then remove the lazold.exe.

Posted by amiso (Alain.Michaud AT nrc-cnrc.gc.ca) on December 1, 2004 at 19:10:39 PST

   Install Lazarus 0.9.4 on Mandrake 10.1
      Do the following steps to install your Lazarus Integrated Development
   Tool, with the Free Pascal Compler.
      I am a novice linux user. I find it so difficult to install or upgrade
   software on linux. This time I finally succeeded upgrading lazarus to
   the 0.9.4 version (3 jan 2005 version) and I hope that this sumary could
   be usefull for other novice users.
   IMPORTANT NOTICE: If you are more than 6 month experienced with linux or
   lazarus or if you do not use linux Mandrake version 10.1 then STOP
   READING NOW.
   SECOND IMPORTANT NOTICE: Keep in mind that this was written by someone
   who knows next to nothing! If anything is wrong then I deeply apologize.
   The purpose of this note is to help the user that has tried everything
   else and is stalled. I have used the procedure on 3 computers and it
   works.
   System: linux "Mandrake 10.1 Official" on a Pentium III (or II) type
   computer.
   Lazarus: Version 0.9.4 (built: 3 january 2005).
   FPC: Version 1.9.6 (built: 2 january 2005).
   File names:
   File_1 = "fpc-1.0.10i386.tar" from:
   http://www.freepascal.org/down-linux-1386.html
   File_2 = "fpc-1.9.6-050102.i386-linux.tar" from:
   http://www.lazarus.freepascal.org
   then follow the links: "binaries" / "linux" / "Current Lazarus Binary
   RPM"
   File_3 = "lazarus-050103.tgz" (from the lazarus site)
   System modules: Lazarus uses the GTK+ library (version 1 only, not
   version2). Go the "Mandrake Control Center" and install the modules:
      libgdk-pixbuf-xlib2-0.22.0-5mdk 
      libgdk-pixbuf2-devel-0.220.-5mdk 
 
   There are 3 steps:
   Step A - Install the stable compiler (V1.0.10)
   Step B - Install the current compiler (V1.9.6)
   Step C - Install the Integrated Development Environment (Lazarus)
   Step A - Install the stable compiler (FPC Version 1.0.10)
      In order to compile the compiler, you need a compiler! We use the
   "stable compiler", (Free Pascal Compiler version 1.0.10) for that. It
   used to be included on the "Mandrake Install disk" but I did not find it
   in the Mandrake 10.1 distribution! However, it is available on the web
   (see the address above):
   A.1- In user mode ("myself") type:
   mkdir /home/myself/freepascal/V1.0.10
   A.2- copy File_1 to /home/myself/freepascal/V1.0.10
   A.3- type: tar -xvf File_1 (of course you type the actual file name
   given above)
   A.4- type: cd fpc
   A.5- go to the superuser mode (type: "su" then your password)
   A.6- type: sh install.sh
   A.7- you want to install it in the [/usr/local folder] then just press:
   return
   A.8- anwser "Y" to all the 11 questions, and answer "return" to the last
   question.
   At this point you shoud have the first "stable" compiler installed! It
   will be used to compile the "current" compiler: The command: "fpc" shows
   a help message that shows the "1.0.10" version number. Also, check that
   now you have the folder:
   /usr/local/lib/fpc/1.0.10/
   Step B - Install the current compiler (FPC Version 1.9.6)


      This is very similar to the previous section: 
   B.1- In user mode ("myself") type: mkdir /home/myself/freepascal/V1.9.6
   B.2- move File_2 to: /home/myself/freepascal/V1.9.6
   B.3- type: tar -xvf File_2 (actual name given above)
   B.4- type: cd fpc
   B.5- go to the superuser mode ("su")
   B.6- type: sh install.shl (takes about 10 minutes)
   B.7- anwser "Y" to all the 12 questions, and answer "return" to the last
   question.
   At this point check that you have a directory:
   /usr/local/lib/fpc/1.9.6/units/i386-linux/
   filled with the libraries. There are all sort of folders in there. Now
   check that the file fpc.cfg has the lines:

-Fu/usr/local/lib/fpc/1.9.6/units/$fpctarget -Fu/usr/local/lib/fpc/1.9.6/units/$fpctarget/* -Fu/usr/local/lib/fpc/1.9.6/units/$fpctarget/rlt

   Note that you see the word: $fpctarget NOT $target.
   Note that you see: 1.9.6 NOT 1.0.10.
   If the lines do not match then edit and change the file. Use any editor
   you like of course. In VI (type: "vim") you type:
   B.7.a - "I" to go to the "insert" mode
   B.7.b - type in your lines as shown above
   B.7.c - press "ESCAPE" to go back to the command mode
   B.7.d - type ":wq" to save and exit. (":q!" exit without save!)
   The last "trick" is to check (and change, if necessary) that the
   symbolic link "ppc386" points to the good compiler. Type:
   B.8.a- cd /usr/local/bin
   B.8.b- ls -al
   The displayed line should show:
   ppc386 --> /usr/local/lib/fpc/1.9.6/ppc386
   If if does, then skip to step B9, otherwise type :
   B.8.c- rm ppc386 (then "y")
   B.8.d- type: ln -s /usr/local/lib/fpc/1.9.6/ppc386
   B.9 - Go back to the user mode (type: "exit").
   B.10- type: fpc
   Wonderfull! Now you see from the help message that you have the version
   1.9.6 compiler. The last step is to load the IDE.
   Step C - Install the Integrated Development Environment (Lazarus)
      The Lazarus can installed in your own user account ("myself"). That can
   be done in the user mode:
   C.1- type: cd ~
   C.2- Copy File_3 to: /home/myself/
   C.3- cd ~
   C.4- tar -xvzf File_3 this will create the lazarus folder
   C.5- cd lazarus
   C.6- make clean all (takes about 10 minutes)
   C.7- type: ./lazarus
   This should bring up the IDE. The first time you run lazarus, you get an
   error message about a bad "Free pascal Source Directory". Click:
   "ignore", then go to the menu: "Enviromnment/Environment Options" and
   set the "FPC source directory" to /usr/local/share/src/fpc-1.9.6/.
   C.8- In order to check that the application is working properly, create
   the simplest application. Just drag and drop a button on the form and
   press F9.
   C.9- Finally, create a shortcut icon on your desktop that executes
   lazarus in the /home/myself/lazarus/ directory. Enjoy.
      Finally, I would like to make a few comments: 
      
   - I do not know how to install the .rpm files. For that reason I always
   use the .tar files. Most people commented to me that the RPM file is a
   prefered method.
   - There is a stable version 1.0.11 but there was no .tar file available
   for this one. The version 1.10 is available and works well, so I used
   it.
   - If you get an error message about some files "missing" this is because
   you have not installed some modules. Instaling modules is an art (and a
   hobby)! Try to install the followings modules. I do not know if they are
   nessary but they were already installed on my system:
      kernel-source-2.6-2.6.8.1-12mdk  
      libgdk-pixbuf2.0-0-devel-2.4.9-9mdk  
   - Beware of the files "ppc386" "ppc396.cfg" "fpc.cfg" "fpc" when your
   instalation fails. After a while, you see them everywhere. Some of them
   are hidden sometimes! Remove all those files before you start the
   instalation again. Only /etc/fpc.cfg and /user/lib/ppc386 are necessary.
   - FPC can be installed in the cross-compiler (multi-platform) mode. The
   file to use for that has the name structure "fpcsrc-...-.tar". I could
   install it, but more difficult to install. In this this procedure
   however, the "linux-only" file ("fpc-...-linux.tar") is very easy to
   install.


      I hope that this was not too pedantic and could be usefull to someone.
   I wish you a good luck.
   Sincerely
   Alain Michaud
   rubidium
   31 january 2005

Original contributors and changes

This page has been converted from the epikwiki version.

  • Initially imported and formatted. VlxAdmin 9/22/2003
  • Changed Joe's part for Windows to require fpc 1.0.10. Vincent 9/25/2003
  • Updated "What is required for lazarus". AndrewJohnson 10/1/2003
  • Finished formatted the InstallingLazarus page VlxAdmin 2/22/2004
  • Posted some notes about Installing FPC and Lazarus: mostly reflecting experiences in trying to get the PATHS right in Linux. 3/11/2004 User:Kirkpatc
  • Copied the contents of my note into the main InstallingLazarus section, edited it slightly. I don't know how to remove the original note. 3/12/2004 User:Kirkpatc
  • Removed the original note. Tidied the wiki and formatting a bit. VlxAdmin
  • Corrected a couple of typos - 3/12/2004 User:Kirkpatc
  • Added link for daily snapshot deb packages - 3/27/2004 Vincent
  • Fixed links in GettingLazarus (downloading binaries) and several other pages. 22 July 2004 User:Kirkpatc
  • Added link for lazarus deb packages - 19 August 2004 VincentSnijders
  • Added a short note on installing in Debian - 23 Nov 2004 User:Kirkpatc
  • Considerable re-write and re-organization of installation section - 11 Dec 2004 User:Kirkpatc