Difference between revisions of "Getting Lazarus"

From Lazarus wiki
Jump to navigationJump to search
 
(77 intermediate revisions by 14 users not shown)
Line 7: Line 7:
 
Binary releases for various platforms are available via the [https://sourceforge.net/projects/lazarus/files/ Lazarus Sourceforge download area].
 
Binary releases for various platforms are available via the [https://sourceforge.net/projects/lazarus/files/ Lazarus Sourceforge download area].
  
For people who are blocked by SF, the Lazarus releases from sourceforge are mirrored at:
+
For people who are blocked by SF, the Lazarus releases from Sourceforge are mirrored at:
*ftp://freepascal.dfmk.hu/pub/lazarus/releases/
+
*ftp://ftp.freepascal.org/pub/lazarus/releases/
*and later at (after some time for syncronization) http://michael-ep3.physik.uni-halle.de/Lazarus/releases/
+
*and later at (after some time for synchronization) http://michael-ep3.physik.uni-halle.de/Lazarus/releases/
 
*and http://mirrors.iwi.me/lazarus/
 
*and http://mirrors.iwi.me/lazarus/
  
Line 15: Line 15:
  
 
Get Lazarus for Windows - use the Sourceforge link above.
 
Get Lazarus for Windows - use the Sourceforge link above.
 +
 +
[[ReactOS|Get Lazarus for ReactOS]]
  
 
[[Lazarus release version for Ubuntu|Get Lazarus for Ubuntu]]
 
[[Lazarus release version for Ubuntu|Get Lazarus for Ubuntu]]
  
[[Lazarus release version for Fedora|Get Lazarus for Fedora]]
+
[[Install_on_Fedora|Get Lazarus for Fedora]]
  
 
[[Lazarus release version for Suse|Get Lazarus for Suse]]
 
[[Lazarus release version for Suse|Get Lazarus for Suse]]
  
[[Lazarus release version for Mandriva|Get Lazarus for Mandriva]]
+
[[Scientific Linux|Get Lazarus for Scientific Linux]]
  
 
[[Lazarus on Raspberry Pi|Get Lazarus for Raspberry Pi (Raspbian)]]
 
[[Lazarus on Raspberry Pi|Get Lazarus for Raspberry Pi (Raspbian)]]
  
[[Lazarus release version for Mac|Get Lazarus for Mac]]
+
[[Installing Lazarus on macOS|Get Lazarus for Mac]]
  
 
[[Lazarus on Solaris]]
 
[[Lazarus on Solaris]]
  
== Getting SVN ==
+
== Getting a Git client ==
  
=== TortoiseSVN client ===
+
=== TortoiseGit client ===
  
TortoiseSVN Client is for Windows only. You may download it from http://tortoisesvn.tigris.org/.
+
TortoiseGit Client is for Windows only. You may download it from https://tortoisegit.org/
  
[[TortoiseSvn|This page]] demonstrates how to download and update Lazarus SVN source, but it can be used for FPC source in the same way.
+
=== Git for Windows ===
  
=== Other clients ===
+
Command line clients:
  
A SVN command line client is available from the official SVN [http://subversion.tigris.org/ website] for many platforms.
+
https://gitforwindows.org/
 +
https://git-scm.com/download/win
  
On Linux, it is recommended to install ''subversion'' using the package management system offered by your distribution. For example:
+
=== Other clients ===
  
sudo apt-get install subversion
+
A GIT command line client is available from https://git-scm.com/downloads for many platforms.
  
==Getting Lazarus SVN development version==
+
On Linux, it is recommended to install ''git'' using the package management system offered by your distribution. For example:
  
=== Using the command line ===
+
sudo apt-get install git
  
To get Lazarus for the first time:
+
==Getting Lazarus from the GitLab server==
  
Open a terminal/command prompt, change to the directory you wish the Lazarus folder to be created in and type:
+
===Development version of Lazarus===
   <nowiki>svn co http://svn.freepascal.org/svn/lazarus/trunk lazarus</nowiki>
+
To get Lazarus for the first time, using command line:
 +
   <nowiki>git clone https://gitlab.com/freepascal.org/lazarus/lazarus.git lazarus</nowiki>
 +
A new directory "lazarus" is then created under the current directory.
  
To update Lazarus sources:
+
===Fixes branch of latest Lazarus release===
  
Open a terminal/command prompt, change to the lazarus directory and type:
+
Change into the directory created by the above '''git clone''' command and run
   svn update
+
   <nowiki>git switch  fixes_2_2</nowiki>
  
For compiling see [[#Compiling_and_installing_Lazarus|here]].
+
Amending the name of the branch according to what fixes version you want.
 +
Get a list with
 +
  <nowiki>git branch --all</nowiki>
 +
The output will contain lines similar to
 +
  <nowiki>remote/origin/fixes_2_2</nowiki>
 +
The name of the branch is just the last part.
  
=== Alternative URLs ===
 
Sometimes the URL of repository given above does not work, because between the svn server there is a http-proxy server. That server usually claims to be a 'transparent' proxy, but still doesn't pass your svn commands correctly to the svn.freepascal.org server.
 
  
The svn.freepascal.org server also listens on port 8080. Maybe the proxy doesn't interfere with http trafic on that port, so you can try:
+
===Update the sources later===
<nowiki>svn co http://svn.freepascal.org:8080/svn/lazarus/trunk lazarus</nowiki>
 
  
The Lazarus svn repostory is mirrored on sourceforge with a delay of 3 minutes using svnsync. The sourceforge repository uses the https protocol. Proxy servers usually don't interfere with that protocol. You can check out form sourceforge using the following command
+
Open a terminal/command prompt, change to the lazarus directory and type:
<nowiki>svn co https://lazarus.svn.sourceforge.net/svnroot/lazarus/trunk lazarus</nowiki>
+
  git switch main
 +
  git pull
  
The FPC and Lazarus svn repostories are also mirrored to svn2.freepascal.org. You can check out from svn2.freepascal.org with
+
instead of main, you may want to specify a fixes branch.
<nowiki>svn co http://svn2.freepascal.org/svn/lazarus/trunk lazarus</nowiki>
 
  
If you own the proxy server, or are friends with the person who does, there are details of setting up a proxy to pass svn commands here: http://subversion.tigris.org/faq.html#proxy This contains an example for squid.  Remember to set up the client to use the proxy !  (For TortoiseSVN, see settings/network).
+
For compiling see [[#Compiling_and_running_Lazarus|this]].
  
=== Scripts ===
+
==Scripts==
  
 
There are scripts for Windows and Linux to automate downloading and building Lazarus: [[LazarusScripts|Scripts for Lazarus]]
 
There are scripts for Windows and Linux to automate downloading and building Lazarus: [[LazarusScripts|Scripts for Lazarus]]
  
==Compiling and installing Lazarus==
+
==Compiling and running Lazarus==
  
See [[Installing Lazarus]] - a detailed installation guide, or http://www.stack.nl/~marcov/buildfaq.pdf - still more detailed guide.
+
See [[Installing Lazarus]] - a detailed installation guide.
  
 
===Using the command-line===
 
===Using the command-line===
  
Lazarus is shipped with Makefile for gnu make util. (Be warned, if you also have Codegear (or Borland) tools installed, it might conflict with gnu "make" util).
+
Lazarus is shipped with an autogenerated '''Makefile''' (of the name "Makefile") for the gnu "'''make'''" utility.
 +
{{Warning|If you also have Embarcadero (or Borland) tools installed, their "make" might conflict with gnu "make". In that case you can either delete or rename the conflicting Embarcadero binary, or remove its directory from Windows PATH, or set the path in the console before calling ''make'':
 +
<pre>
 +
set path=c:\pascal\3.2.0\bin\i386-win32;%path%
 +
</pre>
 +
}}
 +
 
 +
{{Warning|"make" may also fail, if you have a shell (such as sh.exe) in your path. It depends on how this shell interprets quotes and backslashes.
 +
}}
  
The tool allows you to compile the lazarus from command-line easily.  
+
'''make''' allows you to compile Lazarus from command-line easily. You need to have fpc and fpc-packages installed and configured first.
You need to have fpc and fpc-packages installed and configured first.
 
  
 
To compile go to Lazarus directory in your terminal and type
 
To compile go to Lazarus directory in your terminal and type
   make
+
   '''make'''
  
This should rebuild LCL and Lazarus IDE (with basic packages installed).
+
This should rebuild LCL and Lazarus IDE with basic packages installed.  
  
 +
Another useful command is
 +
  '''make bigide'''
 +
which adds the same packages that the release version has.
  
===Using a batch script in Windows===
+
Then you can run Lazarus from within the same source directory with command "lazarus" (in Unix systems "./lazarus").
  
In Windows one convenient way to compile Lazarus SVN is to first install a Lazarus release version, and then create and run the following batch script from your directory where lazarus trunk is:
+
In case you want to run several versions, you can direct lazarus to use use specific configuration directories via the --pcp option, e.g. :
 +
lazarus --pcp=/home/YOU/myLaz19
  
SET PATH=C:\Programas\lazarus31\fpc\2.6.1\bin\i386-win32\
+
===Make targets===
make bigide
+
====make help====
pause
 
 
 
Adapt the script to the path of your installed Lazarus and the FPC that comes inside it.
 
  
Remember to then run Lazarus from SVN only with the option --pcp=lazarusconf because you will have multiple Lazarus installed in this solution.
+
To see a list of available targets for '''''make''''' type [[make help]]. Note: "'''make help'''" exists since 1.0. Here is the output of "'''make help'''":
  
===Make targets===
 
  
To see a list of available targets for ''make'' type ''make help''. Note: "make help" exists since 1.0. Here is the output of "make help":
+
<syntaxhighlight  lang="bash">
 +
make help  
  
<pre>
 
 
  Main targets
 
  Main targets
 
                   Without any target, target 'all' will be invoked.
 
                   Without any target, target 'all' will be invoked.
   all            build minimal IDE, lazbuild, startlazarus.
+
   all            build all needed, i.e. minimal IDE, lazbuild, startlazarus.
   clean          deletes files that 'all' creates
+
   clean          deletes files that 'bigide' creates. It does not clean up all possible
 +
                  targets. Clean other target: make clean LCL_PLATFORM=qt
 +
  distclean      Clean all targets and common leftovers.
 
   lazbuild      build lazbuild and lcl with nogui widgetset
 
   lazbuild      build lazbuild and lcl with nogui widgetset
 
   bigide        as all, except that the IDE is built with a lot of extra packages
 
   bigide        as all, except that the IDE is built with a lot of extra packages
 
   useride        calls lazbuild to build an IDE with your active profile, requires lazbuild
 
   useride        calls lazbuild to build an IDE with your active profile, requires lazbuild
 +
  install        installs Lazarus under /usr/local/share/lazarus
 +
                  You can change the directory by appending INSTALL_PREFIX=/some/path
  
 
  Sub targets
 
  Sub targets
Line 126: Line 144:
 
   lazutils      build package LazUtils, requires registration
 
   lazutils      build package LazUtils, requires registration
 
   codetools      build package CodeTools, requires lazutils
 
   codetools      build package CodeTools, requires lazutils
   lcl            build package LCL, requires lazutils
+
   lcl            build package LCLBase and LCL, requires lazutils
   tools          build lazres, svn2revisioninc, updatepofiles, lrstolfm, requires LCL with nogui widgetset
+
   tools          build lazres, svn2revisioninc, updatepofiles, lrstolfm,
   ideintf        build package IDEIntf, requires lcl
+
                  requires LCL with nogui widgetset
  basecomponents build synedit and lazcontrols for the LCL_PLATFORM, requires ideintf
+
   basecomponents build debuggerintf, lazdebuggergdbmi, lazcontrols, synedit, ideintf
 +
                  for the LCL_PLATFORM, requires lcl
 
   bigidecomponents build many extra packages for the LCL_PLATFORM, requires basecomponents
 
   bigidecomponents build many extra packages for the LCL_PLATFORM, requires basecomponents
 +
  lhelp          build lhelp, requires bigidecomponents
 
   starter        build startlazarus, requires basecomponents
 
   starter        build startlazarus, requires basecomponents
   examples      build basic examples, requires basecomponents
+
   examples      build basic examples, requires basecomponents                                                                                                      
                   Note: There are more examples having their own directory
+
                   Note: There are more examples having their own directory                                                                                            
 +
                                                                                                                                                                     
 +
Flags:                                                                                                                                                               
 +
  PP=/path/to/fpc        use another compiler                                                                                                                       
 +
  USESVN2REVISIONINC=0  do not update ide/revision.inc                                                                                                             
 +
  INSTALL_PREFIX=/usr    used by 'install' as path prefix                                                                                                           
 +
  FPC_DIR=/usr/share/fpcsrc/3.0.4  used by fpcmake when regenerating Makefiles                                                                                     
 +
  OPT='-vwnbq -gh'      append these options when calling the compiler                                                                                             
 +
                                                                                                                                                                     
 +
Usage examples:                                                                                                                                                     
 +
                                                                                                                                                                     
 +
Update svn and build a minimal IDE, startlazarus and lazbuild:                                                                                                     
 +
  make clean                                                                                                                                                         
 +
  svn up                                                                                                                                                             
 +
  make clean all                                                                                                                                                     
 +
                                                                                                                                                                     
 +
Note: You can start lazarus with 'startlazarus'                                                                                                                     
 +
Note: Use the IDE or lazbuild to compile your projects/packages.                                                                                                     
 +
                                                                                                                                                                     
 +
Update svn and build an IDE with your last set of packages:                                                                                                       
 +
  make clean                                                                                                                                                         
 +
  svn up                                                                                                                                                             
 +
  make clean lazbuild useride                                                                                                                                       
 +
                                                                                                                                                                     
 +
Clean up:                                                                                                                                                           
 +
  There is no command to clean up a svn repository completely, but                                                                                                   
 +
  you can use the following command under Linux/OS X:                                                                                                                 
 +
  svn status | grep '\?' | sed -e 's/\? *//' | xargs rm -r                                                                                                           
 +
                                                                                                                                                                     
 +
  Another possibility is to create a clean copy via the svn export command.                                                                                           
 +
                                                                                                                                                                     
 +
Install:                                                                                                                                                             
 +
  Note: You can use Lazarus without installing. Just start the lazarus executable.                                                                                   
 +
  1. Build Lazarus as normal user with one of the above commands.                                                                                                   
 +
  2. Install as root into /usr                                                                                                                                       
 +
          sudo make install
 +
      This installs startlazarus, lazarus-ide, lazbuild under /usr/bin
 +
      and copies the whole lazarus source directory to /usr/share/lazarus
  
Usage examples:
+
</syntaxhighlight>
 
 
Updating svn and build a minimal IDE, startlazarus and lazbuild:
 
  make clean
 
  svn up
 
  make clean all
 
 
 
Note: You can start lazarus with 'startlazarus'
 
Note: Use the IDE or lazbuild to compile your projects/packages.
 
 
 
Updating svn and build an IDE with your last set of packages:
 
  make clean
 
  svn up
 
  make clean lazbuild useride
 
 
 
Clean up:
 
  There is no command to clean up a svn repository completely, but
 
  you can use the following command under Linux/OS X:
 
  svn status | grep '\?' | sed -e 's/\? *//' | xargs rm -r
 
</pre>
 
  
 
===Make parameters===
 
===Make parameters===
There're also additional parameters, can be used for 'making' Lazarus.
+
There are additional parameters which can be used to '''make''' Lazarus. See a fully working example above.
  
 
* '''OPT'''=%compiler_switches
 
* '''OPT'''=%compiler_switches
Line 176: Line 214:
 
or
 
or
 
* '''PP'''=%compiler_path
 
* '''PP'''=%compiler_path
%compiler_path is the path to a custom compiler binary you want to build the target with.
+
%compiler_path is the path+filename to a custom compiler binary you want to build the target with.
  
==Getting FPC SVN development version==
+
such as:
  
Here are some hints how to get and install the development version of FPC (at the moment 2.5.1), which contains new features, bug fixes but is less stable and contains new bugs.
+
  make FPC="~/Pfad/fpc"
The compiler is not included in the Lazarus SVN, but has its own FPC SVN. You ''must'' install first the latest released FPC. Download it from here http://sourceforge.net/projects/freepascal/ and install, or see more details here: [[Installing_Lazarus#Installing_The_Free_Pascal_Compiler|Installing the Free Pascal Compiler]].
 
 
 
Then create a directory and download FPC from SVN:
 
 
 
  mkdir -p ~/freepascal
 
cd ~/freepascal
 
svn co http://svn.freepascal.org/svn/fpc/trunk fpc
 
 
 
This will take some time.
 
 
 
You can also use TortoiseSVN client on Windows as explained earlier.
 
 
 
==Compiling and installing FPC==
 
 
 
There are many ways to compile and install FPC.
 
 
 
* Use plain ''make''.
 
* Build a FPC package for your Linux distribution (.deb or .rpm file). The package allows to easily uninstall, upgrade and downgrade FPC and makes sure that all files are installed at the common places. So if something goes wrong, other users know how to help you.
 
 
 
In either case Lazarus must finally be configured for the new FPC.
 
 
 
===Building and installing Free Pascal in UNIXe===
 
 
 
The following instructions work in UNIX platforms, such as Linux, but also Mac OS X.
 
 
 
Building Free Pascal from source code can be useful in a number of situations. One example is when debugging a problem in the compiler, in the RTL or in the FCL. The distributed FPC installs come without debug info, but the install created from the makefiles constains debug info by default. Another use is testing the development version of the compiler, although often there are also snapshots available for that.
 
 
 
<b>Step 1 - Make sure you have a compatible starting compiler installed.</b>
 
 
 
Usually this will mean having installed the latest stable release.
 
 
 
<b>Step 2 - Download the source of the new compiler</b>
 
 
 
The first thing to do is downloading the Free Pascal source code for the version you desire to build. For example, to download the latest fixes 2.4 branch do:
 
 
 
svn checkout http://svn.freepascal.org/svn/fpc/branches/fixes_2_4 fpcfixes2_4
 
 
 
<b>Step 3 - Build the compiler</b>
 
 
 
Now enter the newly created directory and build and install Free Pascal:
 
 
 
  cd fpcfixes2_4
 
  make clean all install INSTALL_PREFIX=~
 
 
 
This will compile the compiler in 3 cycles, first using the already installed compiler and then using the newly compiled compiler.
 
 
 
It install all needed files in the specified directory. You can install to any other directory if needed. You just have to use the root account if the directory does not allow writing with your normal user account.
 
 
 
<b>Step 4 - Update your fpc.cfg file</b>
 
 
 
Then create a file
 
  ~/.fpc.cfg
 
 
 
It is a hidden file (note the first dot). Enter the following contents to the file. If you installed to another directory, use that instead of your home dir.
 
 
 
  #include /etc/fpc.cfg
 
  -Fu~/lib/fpc/$fpcversion/units/$fpctarget
 
  -Fu~/lib/fpc/$fpcversion/units/$fpctarget/*
 
  -Fu~/lib/fpc/$fpcversion/units/$fpctarget/rtl
 
 
 
This allows installing any future fpc versions into PREFIX=~ without touching that config file.
 
 
 
To run fpc, ~/bin must be in PATH environment variable. Usually it is there by default.
 
You also must add path ~/lib/fpc/2.7.1 to PATH because the actual compiler binary is located there.
 
Most Linux systems now use bash shell and this configuration can be added to ~/.bashrc (a hidden file again) :
 
  export PATH=~/lib/fpc/2.7.1:$PATH
 
 
 
Note that path separator is ":" under Linux (";" under Windows). Now see "Configure Lazarus for the new fpc" below for the next step.
 
 
 
===Build a debian/ubuntu package===
 
 
 
'''Important''': This script does not create the official debian/ubuntu packages. It creates a fpc package that contains the compiler and all packages.
 
 
 
To build the package you need to install some packages:
 
 
 
sudo apt-get install libgpmg1-dev fakeroot libncurses5-dev build-essential
 
 
 
Go into your lazarus source directory. The directory must be writable.
 
 
 
cd ~/freepascal/lazarus/tools/install
 
./create_fpc_deb.sh fpc ~/freepascal/fpc
 
 
 
If you get an error about a missing file or tool you may have to install a missing package. If you get a compilation error your installed fpc is not the released compiler or you were unlucky and fetched a fpc svn reversion that contains a bug. Search help on the mailing list, forum or chat.
 
If it ran through you now have a deb file, which you can install:
 
 
 
  sudo dpkg -i fpc_2.5.1-091121_i386.deb
 
 
 
The file name is different for you.
 
 
 
===Build a RPM package===
 
 
 
ToDo...
 
 
 
===Configure Lazarus for the new FPC===
 
 
 
Now fpc is installed either by "make install" or by using a distro specific package.
 
The next step is to compile lazarus svn with the new compiler and tell the IDE to use the directory ''/home/username/freepascal/fpc'' as ''FPC source directory''.
 
 
 
If you have not yet downloaded the lazarus svn, do it now: [[Getting_Lazarus#Development_versions_from_SVN|Development versions from SVN]]. For example:
 
 
 
cd ~/freepascal
 
svn co http://svn.freepascal.org/svn/lazarus/trunk lazarus
 
 
 
This will take some time, continue with:
 
cd ~/freepascal/lazarus
 
make clean all
 
 
 
If this gives linker errors, you have to install some packages (build-essential, libgtk2.0-dev,libgdk-pixbuf-dev).
 
Start the IDE:
 
cd ~/freepascal/lazarus
 
./lazarus
 
 
 
This is a minimal IDE without any extra packages. Now the IDE must be setup and can be built with packages:
 
 
 
* Go to Tools -> Options -> Environment
 
* Set lazarus directory to ''/home/username/freepascal/lazarus''
 
* Set ''FPC source directory'' to ''/home/username/freepascal/fpc''
 
* Click ''Ok'' to close the dialog
 
* Tools -> Configure Build Lazarus
 
* Click ''Build''.
 
* Restart the IDE
 
* Now you have the latest and greatest IDE built with the latest and greatest FPC.
 
 
 
== Development versions from Git ==
 
There is a [[git mirrors|Git mirror]] of the official SubVersion repository being maintained on [http://github.com/ GitHub]. This mirror gets sync'ed every 15 minutes with the SubVersion repository. For more information on getting [http://git-scm.com/ Git] and cloning the Lazarus repository, follow this link:  [[git mirrors|Git Mirrors]].
 
You can also use git directly with SubVersion server using git-svn link. See  [[Lazarus git-svn|Lazarus git-svn]] for details.
 
 
 
== Development versions from Mercurial ==
 
<s>There is a Hg mirror of the official SubVersion repository being maintained on [http://florianklaempfl.de:8000/lazarustrunk/ florianklaempfl.de].</s>
 
 
 
This mirror does not exist any more. See the [http://lists.freepascal.org/lists/fpc-devel/2010-June/020442.html message] from Florian Klämpfl.
 
 
 
== Daily Snapshot method ==
 
If you don't want to use svn directly, you can try a daily snapshot. For a list of mirrors see the [[Lazarus Snapshots Downloads]] page.
 
  
 
==Browse the Source Repository with a Web Browser==
 
==Browse the Source Repository with a Web Browser==
  
The contents of the SVN archive can also be browsed with your web-browser through [http://www.freepascal.org/cgi-bin/viewcvs.cgi/?root=lazarus this viewcvs] interface.
+
The contents of the GIT repro can also be browsed with your web-browser through [https://gitlab.com/freepascal.org/lazarus/lazarus/-/tree/main interface].
  
 
==Lazarus Distributions==
 
==Lazarus Distributions==
Line 324: Line 228:
 
There are some unofficial sites where you can find Lazarus and Free Pascal too:
 
There are some unofficial sites where you can find Lazarus and Free Pascal too:
  
 +
*[http://newpascal.org NewPascal] is a curated distribution for Windows, which doesn't require an installer and implements some new features. (Is very out-of-date)
 +
*The [http://www.getlazarus.org getlazarus] distribution bundles cutting-edge versions of Lazarus with easy-to-use setup scripts for several platforms and additional components.
 +
*[https://freesparta.com/ FreeSparta] is a commercial distribution of Lazarus for Windows.
 
*You can get a Ubuntu LiveCD from Austrian University of Applied Sciences hosting http://www.sigma-server.com/liveCD/Ubuntu-7.10-NTC-Lazarus.iso and md5sum file is here http://www.sigma-server.com/liveCD/Ubuntu-7.10-NTC-Lazarus.iso.md5.
 
*You can get a Ubuntu LiveCD from Austrian University of Applied Sciences hosting http://www.sigma-server.com/liveCD/Ubuntu-7.10-NTC-Lazarus.iso and md5sum file is here http://www.sigma-server.com/liveCD/Ubuntu-7.10-NTC-Lazarus.iso.md5.
 
*The [http://www.pilotlogic.com CodeTyphon] distribution bundles Lazarus with additional packages and components.
 
*The [http://www.pilotlogic.com CodeTyphon] distribution bundles Lazarus with additional packages and components.
 +
*[https://github.com/x2nie/LiteZarus LiteZarus] is a Lazarus distro intended for designing creating non-LCL projects.
 
*Lazarus is available on CDs and USB sticks from the [http://www.blaisepascal.eu Blaise Pascal Magazine] store.
 
*Lazarus is available on CDs and USB sticks from the [http://www.blaisepascal.eu Blaise Pascal Magazine] store.
  
==Original contributors and changes==
+
== See also ==
 +
 
 +
* [http://forum.lazarus.freepascal.org/index.php/topic,36347.msg242123.html#msg242123 Forum: Explanation of trunk installation in Windows]
  
This page has been converted from the epikwiki [http://lazarus-ccr.sourceforge.net/index.php?wiki=GettingLazarus version].
 
  
 
[[Category:Lazarus]]
 
[[Category:Lazarus]]
 
[[Category:Install]]
 
[[Category:Install]]

Latest revision as of 06:08, 4 August 2021

Deutsch (de) English (en) español (es) français (fr) 日本語 (ja) polski (pl) português (pt) русский (ru) slovenčina (sk)

Download and install Lazarus release version

From SourceForge

Binary releases for various platforms are available via the Lazarus Sourceforge download area.

For people who are blocked by SF, the Lazarus releases from Sourceforge are mirrored at:

Specific for platform

Get Lazarus for Windows - use the Sourceforge link above.

Get Lazarus for ReactOS

Get Lazarus for Ubuntu

Get Lazarus for Fedora

Get Lazarus for Suse

Get Lazarus for Scientific Linux

Get Lazarus for Raspberry Pi (Raspbian)

Get Lazarus for Mac

Lazarus on Solaris

Getting a Git client

TortoiseGit client

TortoiseGit Client is for Windows only. You may download it from https://tortoisegit.org/

Git for Windows

Command line clients:

https://gitforwindows.org/ https://git-scm.com/download/win

Other clients

A GIT command line client is available from https://git-scm.com/downloads for many platforms.

On Linux, it is recommended to install git using the package management system offered by your distribution. For example:

sudo apt-get install git

Getting Lazarus from the GitLab server

Development version of Lazarus

To get Lazarus for the first time, using command line:

 git clone https://gitlab.com/freepascal.org/lazarus/lazarus.git lazarus

A new directory "lazarus" is then created under the current directory.

Fixes branch of latest Lazarus release

Change into the directory created by the above git clone command and run

 git switch  fixes_2_2

Amending the name of the branch according to what fixes version you want. Get a list with

 git branch --all

The output will contain lines similar to

 remote/origin/fixes_2_2

The name of the branch is just the last part.


Update the sources later

Open a terminal/command prompt, change to the lazarus directory and type:

 git switch main
 git pull 

instead of main, you may want to specify a fixes branch.

For compiling see this.

Scripts

There are scripts for Windows and Linux to automate downloading and building Lazarus: Scripts for Lazarus

Compiling and running Lazarus

See Installing Lazarus - a detailed installation guide.

Using the command-line

Lazarus is shipped with an autogenerated Makefile (of the name "Makefile") for the gnu "make" utility.

Warning-icon.png

Warning: If you also have Embarcadero (or Borland) tools installed, their "make" might conflict with gnu "make". In that case you can either delete or rename the conflicting Embarcadero binary, or remove its directory from Windows PATH, or set the path in the console before calling make:

 set path=c:\pascal\3.2.0\bin\i386-win32;%path%

Warning-icon.png

Warning: "make" may also fail, if you have a shell (such as sh.exe) in your path. It depends on how this shell interprets quotes and backslashes.

make allows you to compile Lazarus from command-line easily. You need to have fpc and fpc-packages installed and configured first.

To compile go to Lazarus directory in your terminal and type

 make

This should rebuild LCL and Lazarus IDE with basic packages installed.

Another useful command is

 make bigide

which adds the same packages that the release version has.

Then you can run Lazarus from within the same source directory with command "lazarus" (in Unix systems "./lazarus").

In case you want to run several versions, you can direct lazarus to use use specific configuration directories via the --pcp option, e.g. :

lazarus --pcp=/home/YOU/myLaz19

Make targets

make help

To see a list of available targets for make type make help. Note: "make help" exists since 1.0. Here is the output of "make help":


 
make help 

 Main targets
                  Without any target, target 'all' will be invoked.
   all            build all needed, i.e. minimal IDE, lazbuild, startlazarus.
   clean          deletes files that 'bigide' creates. It does not clean up all possible
                  targets. Clean other target: make clean LCL_PLATFORM=qt
   distclean      Clean all targets and common leftovers.
   lazbuild       build lazbuild and lcl with nogui widgetset
   bigide         as all, except that the IDE is built with a lot of extra packages
   useride        calls lazbuild to build an IDE with your active profile, requires lazbuild
   install        installs Lazarus under /usr/local/share/lazarus
                  You can change the directory by appending INSTALL_PREFIX=/some/path

 Sub targets
   registration   build package FCL
   lazutils       build package LazUtils, requires registration
   codetools      build package CodeTools, requires lazutils
   lcl            build package LCLBase and LCL, requires lazutils
   tools          build lazres, svn2revisioninc, updatepofiles, lrstolfm,
                  requires LCL with nogui widgetset
   basecomponents build debuggerintf, lazdebuggergdbmi, lazcontrols, synedit, ideintf
                  for the LCL_PLATFORM, requires lcl
   bigidecomponents build many extra packages for the LCL_PLATFORM, requires basecomponents
   lhelp          build lhelp, requires bigidecomponents
   starter        build startlazarus, requires basecomponents
   examples       build basic examples, requires basecomponents                                                                                                        
                  Note: There are more examples having their own directory                                                                                             
                                                                                                                                                                       
 Flags:                                                                                                                                                                
   PP=/path/to/fpc        use another compiler                                                                                                                         
   USESVN2REVISIONINC=0   do not update ide/revision.inc                                                                                                               
   INSTALL_PREFIX=/usr    used by 'install' as path prefix                                                                                                             
   FPC_DIR=/usr/share/fpcsrc/3.0.4   used by fpcmake when regenerating Makefiles                                                                                       
   OPT='-vwnbq -gh'       append these options when calling the compiler                                                                                               
                                                                                                                                                                       
 Usage examples:                                                                                                                                                       
                                                                                                                                                                       
 Update svn and build a minimal IDE, startlazarus and lazbuild:                                                                                                      
   make clean                                                                                                                                                          
   svn up                                                                                                                                                               
   make clean all                                                                                                                                                      
                                                                                                                                                                       
 Note: You can start lazarus with 'startlazarus'                                                                                                                       
 Note: Use the IDE or lazbuild to compile your projects/packages.                                                                                                      
                                                                                                                                                                       
 Update svn and build an IDE with your last set of packages:                                                                                                         
   make clean                                                                                                                                                          
   svn up                                                                                                                                                              
   make clean lazbuild useride                                                                                                                                         
                                                                                                                                                                       
 Clean up:                                                                                                                                                             
  There is no command to clean up a svn repository completely, but                                                                                                     
  you can use the following command under Linux/OS X:                                                                                                                  
  svn status | grep '\?' | sed -e 's/\? *//' | xargs rm -r                                                                                                             
                                                                                                                                                                       
  Another possibility is to create a clean copy via the svn export command.                                                                                            
                                                                                                                                                                       
 Install:                                                                                                                                                              
   Note: You can use Lazarus without installing. Just start the lazarus executable.                                                                                    
   1. Build Lazarus as normal user with one of the above commands.                                                                                                     
   2. Install as root into /usr                                                                                                                                        
          sudo make install
      This installs startlazarus, lazarus-ide, lazbuild under /usr/bin
      and copies the whole lazarus source directory to /usr/share/lazarus

Make parameters

There are additional parameters which can be used to make Lazarus. See a fully working example above.

  • OPT=%compiler_switches

the %compiler_switches is passed to each fpc call. The option is useful for specifying defines

For example:

 make bigide OPT="-dNoGdkPixBufLib -gw2" 

makes LCL and ide with NoGdkPixBufLib defined and dwarf2 debug info.

  • LCL_PLATFORM=%platform

%platform is the target widgetset. It can be win32,wince,gtk,gtk2,qt,carbon,cocoa,customdrawn.

For example:

 make LCL_PLATFORM=gtk2

Rebuilds LCL and IDE for gtk2 widgetset

  • FPC=%compiler_path

or

  • PP=%compiler_path

%compiler_path is the path+filename to a custom compiler binary you want to build the target with.

such as:

make FPC="~/Pfad/fpc"

Browse the Source Repository with a Web Browser

The contents of the GIT repro can also be browsed with your web-browser through interface.

Lazarus Distributions

There are some unofficial sites where you can find Lazarus and Free Pascal too:

See also