Sign in Join
Wiki copytemporary

Installation hints for old versions: what changed

Revision 2 to 3. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
11## Installing Lazarus
22
33### Installing Lazarus under Linux
44
55#### Ubuntu / Debian
66
77##### Problems compiling GTK2 apps with FPC 2.2.2
88
99From this [post](http://lists.freepascal.org/lists/fpc-pascal/2009-January/019838.html) by Michalis Kamburelis:
1010
1111In case someone wonders how to workaround this [bug](http://mantis.freepascal.org/view.php?id=11837) (occurs with GTK \>= 2.13.4, e.g. on Ubuntu 8.10 we have GTK 2.14):
1212
1313I found that the quick workaround that works is to pass --noinhibit-exec to ld, that is "-k--noinhibit-exec" to FPC command-line. The ld will then treat unresolved references as mere warnings, and will produce working executable (assuming your program doesn't actually call obsoleted GTK2 functions).
1414
1515Of course, you can also upgrade to the lastest FPC release 2.2.4. Above workaround is useful only if you have to stick to old released FPC 2.2.2.
1616
1717#### Installing 0.9.28 using rpms
1818
1919The next easiest way is to the RPMs for FreePascal and Lazarus from the SourceForge repository.
2020
2121You need to download the selected version of
2222
2323- the compiler (eg fpc-2.2.4-0.i386.rpm)
2424- the pascal source library (eg fpc-src-2.2.4-081004.i386.rpm)
2525- the Lazarus package (eg lazarus-0.9.28-0.i386.rpm).
2626
2727Here is an example of a script to install or update to ver.0.9.28. Save it as something like "InstallLazarus.sh", give it execute permission, and run after getting root privileges using su. Don't mind if you get "not installed" message.
2828
29-` #!/bin/sh`\
30-` URL=`[`http://sourceforge.net/projects/lazarus/files/Lazarus%20Linux%20i386%20RPM/Lazarus%200.9.28`](http://sourceforge.net/projects/lazarus/files/Lazarus%20Linux%20i386%20RPM/Lazarus%200.9.28)\
31-` wget $URL/fpc-2.2.4-0.i386.rpm/download`\
32-` wget $URL/fpc-src-2.2.4-0.i386.rpm/download`\
33-` wget $URL/lazarus-0.9.28-0.i386.rpm/download`\
34-` rpm -ev lazarus`\
35-` rpm -ev fpc`\
36-` rpm -ev fpc-src`\
37-` rpm -ivh fpc-*`\
38-` rpm -ivh lazarus-*`
29+```text
30+ #!/bin/sh
31+ URL=http://sourceforge.net/projects/lazarus/files/Lazarus%20Linux%20i386%20RPM/Lazarus%200.9.28
32+ wget $URL/fpc-2.2.4-0.i386.rpm/download
33+ wget $URL/fpc-src-2.2.4-0.i386.rpm/download
34+ wget $URL/lazarus-0.9.28-0.i386.rpm/download
35+ rpm -ev lazarus
36+ rpm -ev fpc
37+ rpm -ev fpc-src
38+ rpm -ivh fpc-*
39+ rpm -ivh lazarus-*
40+```
3941
4042#### Installing on Mandriva
4143
4244##### Lazarus 0.9.30 on Mandriva 2010
4345
4446Install as given lower down however on compiling a program you may get two error messages telling you that you are missing pixbuf 2.0 and lgtk-x11-2.0. to fix this install from the the software installer libdgk_pixbuf2.0_0-devel and libgtk+2.0_0-devel.
4547
4648##### Lazarus 0.9.28 on Mandriva 2010
4749
4850Install as given lower down however on compiling a program you may get two error messages telling you that you are missing pixbuf 2.0 and lgtk-x11-2.0. to fix this install from the the software installer libdgk_pixbuf2.0_0-devel and libgtk+2.0_0-devel.
4951
5052##### Lazarus 0.9.28 on Mandriva 2009 (2009.0) (i386) (GTK-2)
5153
5254Not much has changed compared to Mandriva 2007. The following instruction shall not differ for an x86_64 architecture.
5355
54561/ Do not install FPC from Drake. If you have done so, desinstall it. Since Mandriva does not provide the complete set of tools (FPC+sources+documentation+Lazarus) it is better, in my opinion, to have complete control on all of them through rpms.
5557
56582/ Collect fresh rpms on sourceforge (http://sourceforge.net/project/showfiles.php?group_id=89339): select the RPM version of the latest lazarus release compatible with your architecture and download fpc, fpc-src, fpc-docs and lazarus RPMs.
5759
58603/ Browse the directory where you downloaded the RPMs (with Nautilus or whatever file browser your using) and double click on the RPMs in this ordrer:
5961
60-`  (a) fpc-<version>-<arch>.rpm`\
61-`  (b) fpc-docs-<version>-<arch>.rmp`\
62-`  (c) fpc-src-<version>-<arch>.rpm`\
63-`  (d) lazarus-<version>-<arch>.rpm`
62+```text
63+ (a) fpc-<version>-<arch>.rpm
64+ (b) fpc-docs-<version>-<arch>.rmp
65+ (c) fpc-src-<version>-<arch>.rpm
66+ (d) lazarus-<version>-<arch>.rpm
67+```
6468
65694/ It is possible that the Drake (the software that will manage your RPMs) will complain about missing libraries or tools. Use Drake to collect them. For instance, you shall have installed developpement tools such as "GNU Make". Search and if necessary install "GNU Make". You might be missing the ld (the linkage utility), you can install for instance the "gcc" package.
6670
67715/ As before, it is possible to search for and install "galaxy-gnome" and "gtk-switch" with Drake. Nonetheless, they are not required for Lazarus to work properly. Gnome Galaxy are a set of cool themes you can use in the System menu-\>Preferences-\>Themes.
6872
69736/ Lazarus might complain about the FPC sources that are not correctly set. Go to Configuration-\>Environement then set the FPC sources directory to your local installation (it should be /usr/local/fpcsrc/\<version\>/).
7074
71757/ When launched, the libcanberra-module-gtk might not be found. I tried to build a symlink (ln -s) but if Lazarus manages to find this library... it crashes. It might be safer to ignore this error.
7276
73778/ Have fun with the coolest RAD of the Free World.
7478
7579##### Lazarus 0.9.26 on Mandriva 2007 (2007.0) (i386) (GTK-1)
7680
7781Installation in Mandriva is very easy. However, there are a few points to check as the installation proceeds. Here is a typical installation using the .tar modules (see the trick for the theme at the end of the procedure!):
7882
7983\- During the Mandriva installation, select the "Gnome desktop" group. Although you will use lazarus in KDE or other desktop, this will install some GTK modules needed by the lazarus environment.
8084
8185\- Install the FPC 2.2.2 compiler using either the .rpm or .tar, modules. Using the .tar modules you would type: "sh install.sh" then RETURN many times. I do this in superuser mode.
8286
8387\- Install the compiler source code. just untar the file "fpc-src-2.2.4.source.tgz" in the folder /usr/local/src/fpc/ then rename the created folder "fpc" to "2.2.2" . When complete, you have the folder /usr/local/src/fpc/2.2.2/ that contains all the source code. The source code is only needed by lazarus editor, but you can recompile FPC and have an optimized version of the libraries, and show that everything is working well:
8488
8589\- If you want to compile FPC (optional), then go to the FPC source directory (/usr/local/src/fpc/2.2.4/) and type "./configure", "make clean","make all","make install","make clean". FPC is now installed. Check the content of "/etc/fpc.cfg". This file has to be modified when the make fails.
8690
8791\- Lazarus can be installed in user mode: just unzip/untar the file "lazarus-0.9.26.0.tar.gz" in your user directory. Then just type "make clean all" in the user mode. The last phase of the process (link) usually fails due to missing library files:
8892
8993\- Check in the directory /usr/lib/ for the following symbolic links:
9094
9195libglib.so -\> libglib-1.2.so.0
9296
9397libgtk.so -\> libgtk-1.2.so.0.9.1
9498
9599libgdk.so -\> libgdk-1.2.so.0.9.1
96100
97101libgdk_pixbuf.so -\> libgdk_pixbuf.so.2.0.0
98102
99103The file "libgdk_pixbuf.so.2.0.0" is included in the module "libgdk_pixbuf-2.0.22.0-10mdv2007.0.rpm" This file name is critical. In particular, DO NOT use "libgdk_pixbuf-2.0.so.0" (misleading isn't!).
100104
101105After all the links have been fixed, the "Linking ../lazarus" stage will not crash any more and the "./lazarus" command should start the program!
102106
103107\- Go to the "environment/environment options" menu and change the "FPC source directory" to /user/local/src/fpc/2.2.4
104108
105109USEFUL TO KNOW:
106110
107111\- The last step is to fix the theme. The package "galaxy-gnome-1.0.4-3mdv2007.0" is available in the Mandriva control center. Install it.
108112
109113\- The package "gtk-theme-switch-1.0.1-4mdv2007.0.i586.rpm" is available on the web! (strangely it did not show in the control center) Install it manually by typing "rpm -iv --test gtk-theme-switch-1.0.1-4mdv2007.0.i586.rpm" then retype the line without the "--test" in my case there was a warning message related to the signature. I decided to ignore it!
110114
111115\- in the USER MODE, type "switch", then chose "galaxy" theme.
112116
113117The Lazarus / FPC tool is now installed!
114118
115119##### Lazarus 0.9.28 on Mandriva 2007/or -2006 32 bit
116120
117121Write this urpmi-command as root:
118122
119123 urpmi http://surfnet.dl.sourceforge.net/sourceforge/lazarus/lazarus-0.9.28-0.i386.rpm http://surfnet.dl.sourceforge.net/sourceforge/lazarus/fpc-2.2.4-0.i386.rpm http://surfnet.dl.sourceforge.net/sourceforge/lazarus/fpc-docs-2.2.4-0.i386.rpm http://surfnet.dl.sourceforge.net/sourceforge/lazarus/fpc-src-2.2.4-0.i386.rpm
120124
121125Lazarus 0.9.28 depends on fpc 2.2.4 and Mandriva 2007 is shipped with fpc-2.1.1-0.2mdk.i586. To prevent your system to upgrade to fpc-2.1.1 or newer in the future, when you run commands as urpmi --auto-select, you can write fpc in /etc/urpmi/skip.list.
122126
123127##### Lazarus 0.9.28 on Mandriva 2009 32 bit
124128
125129Installation needs similar action as above. Because the distribution comes with fpc-2.2.4-1, it is necessary to uninstall this package. Write following commands as root:
126130
127131 rpm -e fpc
128132 urpmi http://surfnet.dl.sourceforge.net/sourceforge/lazarus/lazarus-0.9.28-0.i386.rpm http://surfnet.dl.sourceforge.net/sourceforge/lazarus/fpc-2.2.4-0.i386.rpm http://surfnet.dl.sourceforge.net/sourceforge/lazarus/fpc-docs-2.2.4-0.i386.rpm http://surfnet.dl.sourceforge.net/sourceforge/lazarus/fpc-src-2.2.4-081004.i386.rpm
129133
130134And place fpc in /etc/urpmi/skip.list.
131135
132136##### Lazarus untested snapshot on Mandriva 2007 32 bit
133137
134138 urpmi $(for RPM in $(lynx --source http://michael-ep3.physik.uni-halle.de/Lazarus/ | grep i386.rpm | cut -d '"' -f 4-4) ; do echo -n http://michael-ep3.physik.uni-halle.de/Lazarus/$RPM ' '; done )
135139
136140##### Installing Lazarus + fpc For Mandriva X86_64
137141
138142This was tested on Mandriva 2010.0 X86_64.
139143
140144- Download the X86_64 snapshots from <http://michael-ep3.physik.uni-halle.de/Lazarus/> Lazarus Snapshots
141145- I used these:
142146
143147 http://michael-ep3.physik.uni-halle.de/Lazarus/snapshots/fpc-2.4.0-20100412.x86_64.rpm
144148 http://michael-ep3.physik.uni-halle.de/Lazarus/snapshots/fpc-src-2.4.0-20100412.x86_64.rpm
145149 http://michael-ep3.physik.uni-halle.de/Lazarus/snapshots/lazarus-0.9.29.24591-20100412.x86_64.rpm
146150
147151You can install them with the command urpmi as root, and write all these 3 urls as paramters on the command line.
148152
149153- To download and install the current snapshot:
150154
151155`urpmi $(lynx --source `[`http://michael-ep3.physik.uni-halle.de/Lazarus/`](http://michael-ep3.physik.uni-halle.de/Lazarus/)` |grep -v lazarus-0.9.28.3| grep 64.rpm | cut -d '"' -f 6-6 | awk '{print "`[`http://michael-ep3.physik.uni-halle.de/Lazarus/"$0`](http://michael-ep3.physik.uni-halle.de/Lazarus/%22$0)`}')`\
152156You might have to install lynx and make first:`urpmi lynx make`.
153157
154158- Once the RPMs have been installed. Run lazarus for the first time. It will pop up a dialog complaining that the "/usr/bin/ppc386" and "/usr/lib/lazarus" are not valid. Accept ("OK") the alternate choices it suggests.
155159- When compiling your first project, you may find that lazarus complains of missing libs (e.g. gdk, glib, etc.). Install the necessary libs as needed, I installed these (that I recall, YMMV):
156160
157161 glib-devel
158162 lib64gtk+1.2-devel
159163 lib64gtk+2.0_0-devel
160164 lib64gdk-pixbuf2
161165 lib64gdk-pixbuf2-devel
162166
163167#### Installing on Slackware
164168
165169##### Installing Lazarus on Slackware 13.0
166170
167171There is no real difference from the slackware 12.2 or 12.0 version, therefore the procedure described below should work just as well.
168172
169173Please note that you will NOT be able to install lazarus on gtk, therefore you MUST use the "LCL_PLATFORM=gtk2" statement. Slackware only provides the KDE enviroment, but the gtk2 type panels are fully supported (no extra installation required). At most, there is one or two symbolic link to add!
170174
171175##### Installing Lazarus 0.9.28, for Slackware 12.0 users
172176
173177This have worked in Slackware-12.0 on a Pentium-3 computer:
174178
175179- The Free Pascal Compiler (FPC) is installed in SUPERUSER mode
176180- The lazarus in installed in USER mode
177181- The FPC compiler will be recompiled
178182- The lazarus Integrated Development Environment (IDE) source code is loaded from the SVN server
179183- The GTK-2 widget set is used ("LCL_PLATFORM=gtk2")
180184
181185-- Download "fpc-2.2.4.i386-linux.tar" in a user folder and install it. Go to this folder and type:
182186
183-` bash-3.1$ tar -xvf fpc-2.2.4.i386-linux.tar`\
184-` bash-3.1$ su `\
185-` bash-3.1$ password:xxxxxx`\
186-` bash-3.1# sh install.sh`\
187-` ...`\
188-` (use the default answers for the next 6 questions: press "return" 6 times)`\
189-` ...`\
190-` bash-3.1# exit`\
191-` bash-3.2$ fpc`\
192-` free pascal compiler version 2.2.4 [] for i386 `\
193-` Copyright (c) 2008 ...`\
194-` ...`\
195-` ...`
187+```text
188+ bash-3.1$ tar -xvf fpc-2.2.4.i386-linux.tar
189+ bash-3.1$ su
190+ bash-3.1$ password:xxxxxx
191+ bash-3.1# sh install.sh
192+ ...
193+ (use the default answers for the next 6 questions: press "return" 6 times)
194+ ...
195+ bash-3.1# exit
196+ bash-3.2$ fpc
197+ free pascal compiler version 2.2.4 [] for i386
198+ Copyright (c) 2008 ...
199+ ...
200+ ...
201+```
196202
197203You have installed the compiler. You may want to recompile it or not, but in any case you will need to download the source code as it is required by the lazarus IDE.
198204
199205-- Download "fpc-2.2.4.source.tar.gz" in a temporary folder. If you do not want to recompile the source then just skip this section. If you would like to run your own compiled version of FPC, then just type:
200206
201-` bash-3.1$ tar -xvzf fpc-2.2.4.source.tar.gz`\
202-` bash-3.1$ cd fpc-2.2.4`\
203-` bash-3.1$ make clean all`\
204-` bash-3.1$ su`\
205-` bash-3.1$ password: xxxxxxxx`\
206-` bash-3.1# make install`\
207-` bash-3.1# exit`\
208-` bash-3.1$ fpc`\
209-` free pascal compiler version 2.2.4 [...] for i386 `\
210-` Copyright (c) 2008 ...`\
211-` ...`\
212-` ...`
207+```text
208+ bash-3.1$ tar -xvzf fpc-2.2.4.source.tar.gz
209+ bash-3.1$ cd fpc-2.2.4
210+ bash-3.1$ make clean all
211+ bash-3.1$ su
212+ bash-3.1$ password: xxxxxxxx
213+ bash-3.1# make install
214+ bash-3.1# exit
215+ bash-3.1$ fpc
216+ free pascal compiler version 2.2.4 [...] for i386
217+ Copyright (c) 2008 ...
218+ ...
219+ ...
220+```
213221
214222Now you have your own compiled version working.
215223
216224-- The lazarus IDE editor needs to look at the FPC source code. Even if you do not want to recompile FPC, you need its source code. However, in order to save some space, I only keep a clean (not compiled) copy of the source code. I start from the file "fpc-2.2.4.source.tar.gz" again and I copy it to the /usr/local/src/FPC folder:
217225
218-` bash-3.1$ su`\
219-` bash-3.1$ password: xxxxxxxx`\
220-` bash-3.1# cp fpc-2.2.4.source.tar.gz /usr/local/src/`\
221-` bash-3.1# cd /usr/local/src/`\
222-` bash-3.1# tar -xvzf fpc-2.2.4.source.tar.gz`\
223-` bash-3.1# rm fpc-2.2.4.source.tar.gz`\
224-` bash-3.1# exit`
226+```text
227+ bash-3.1$ su
228+ bash-3.1$ password: xxxxxxxx
229+ bash-3.1# cp fpc-2.2.4.source.tar.gz /usr/local/src/
230+ bash-3.1# cd /usr/local/src/
231+ bash-3.1# tar -xvzf fpc-2.2.4.source.tar.gz
232+ bash-3.1# rm fpc-2.2.4.source.tar.gz
233+ bash-3.1# exit
234+```
225235
226236The version number is included in the folder name "fpc-2.2.4". This way I can keep many versions the the compiler source and eventually switch between them.
227237
228238-- The lazarus IDE is kept in my USER "~/lazarus" folder and always compiled in USER mode. I usually download the "lazarus-0.9.28-0.tar.gz" file, but here we can also get the latest development version from the SVN server:
229239
230-`  bash-3.1$ svn co `[`http://svn.freepascal.org/svn/lazarus/trunk`](http://svn.freepascal.org/svn/lazarus/trunk)` lazarus`
240+```text
241+ bash-3.1$ svn co http://svn.freepascal.org/svn/lazarus/trunk lazarus
242+```
231243
232244This is for the first time you load it. Next time you will only need to type:
233245
234-`  bash-3.1$ svn update`
246+```text
247+ bash-3.1$ svn update
248+```
235249
236250If you do not have SVN installed on your computer, here is how to get it quickly:
237251
238252--Download the two files: "subversion-1.4.6.tar.gz" and "subversion-deps-1.4.5.tar.gz" (or later versions). Type:
239253
240-`  bash-3.1$ tar -xvzf subversion-1.4.6.tar.gz`\
241-`  bash-3.1$ tar -xvzf subversion-deps-1.4.6.tar.gz`\
242-`  bash-3.1$ cd subversion-1.4.6`\
243-`  bash-3.1$ ./configure`\
244-`  bash-3.1$ make`\
245-`  bash-3.1$ su`\
246-`  bash-3.1$ password:xxxxxx`\
247-`  bash-3.1# make install`\
248-`  bash-3.1$ exit`
254+```text
255+ bash-3.1$ tar -xvzf subversion-1.4.6.tar.gz
256+ bash-3.1$ tar -xvzf subversion-deps-1.4.6.tar.gz
257+ bash-3.1$ cd subversion-1.4.6
258+ bash-3.1$ ./configure
259+ bash-3.1$ make
260+ bash-3.1$ su
261+ bash-3.1$ password:xxxxxx
262+ bash-3.1# make install
263+ bash-3.1$ exit
264+```
249265
250266-- At this point you have the folder "~/lazarus" containing the source code. You should compile it very simply:
251267
252-`  bash-3.1$ make clean all LCL_PLATFORM=gtk2`
268+```text
269+ bash-3.1$ make clean all LCL_PLATFORM=gtk2
270+```
253271
254272The "LCL_PLATFORM=gtk2" means of course that you will develop your applications in GTK-2. The default widget set for lazarus is GTK-1 but you will not be able to use it in Slackware 12.0. I strongly recommend that you use the "LCL_PLATFORM=gtk2" option now. After a few minutes, the compiler stops:
255273
256-`  ...`\
257-`  ...`\
258-`  Linking ../Lazbuild`\
259-`  987 linescompiled ...`\
260-`  make [2] leaving ...`\
261-`  make [1] leaving ...`\
262-`  bash-3.1$`
274+```text
275+ ...
276+ ...
277+ Linking ../Lazbuild
278+ 987 linescompiled ...
279+ make [2] leaving ...
280+ make [1] leaving ...
281+ bash-3.1$
282+```
263283
264284-- Just type:
265285
266-`  bash-3.1$ ./lazarus`
286+```text
287+ bash-3.1$ ./lazarus
288+```
267289
268290WOW! You get a message: "Free Pascal sources not found". Just follow the instructions and indicate your Free Pascal Compiler source directory in the panel: "Environment-\>Environment_Options-\>Files". As explained earlier, on my computer this should point to "/usr/local/src/fpc-2.2.4". Note that when you change this folder, you should click on "Environment / Rescan_FPC_source_directory".
269291
270292Voila!
271293
272294#### Installing on openSUSE
273295
274296##### Installing Lazarus 0.9.30. For openSUSE 11.1
275297
276298Free Pascal Compiler requires:\
277299\- Gnu binutils (gnu as, gnu ld, gnu make)
278300
279301These utils can be installed by:
280302
281303``` bash
282304zypper in -t pattern devel_basis
283305```
284306
285307Lazarus also requires these components: 1) glib2 devel 2) gtk2 devel
286308
287309**Important**: The lazarus rpm requires the gtk 2 version, not the version 1.2.
288310
289311These libraries can be installed by:
290312
291313``` bash
292314zypper -n install gtk2 glib2
293315```
294316
295317Download these binary files (RPM)
296318
297319:* fpc-2.4.2-0.i686.rpm (yes i686 and not i386)
298320
299321:* fpc-src-2.4.2-0.i686.rpm
300322
301323:* lazarus-0.9.30-0.i686.rpm
302324
303325install them opening a terminal session (mouse's right button -\> Menu: Open in terminal)
304326
305327``` bash
306328rpm -Uvh fpc-2.4.2-0.i686.rpm
307329rpm -Uvh fpc-src-2.4.2-0.i686.rpm
308330rpm -Uvh lazarus-0.9.30-0.i686.rpm
309331```
310332
311333##### Installing Lazarus 0.9.28. For openSUSE 11.1 users
312334
313335Free Pascal Compiler requires:\
314336\- Gnu binutils (gnu as, gnu ld, gnu make) These utils can be installed by:
315337
316-` zypper in -t pattern devel_basis`
338+```text
339+ zypper in -t pattern devel_basis
340+```
317341
318342Lazarus also requires these components: 1) glib2 devel 2) gtk2 devel
319343
320344**Important**: The lazarus rpm requires the gtk 2 version, not the version 1.2.
321345
322346These libraries can be installed by:
323347
324-` zypper -n install gtk2 glib2`
348+```text
349+ zypper -n install gtk2 glib2
350+```
325351
326352Download these binary files (RPM)
327353
328354:* fpc-2.2.4-0.i386.rpm (yes i586 and not i386)
329355
330356:* fpc-src-2.2.4-0.i386.rpm
331357
332358:* lazarus-0.9.28.2-0.i586.rpm
333359
334360install them opening a terminal session (mouse's right button -\> Menu: Open in terminal)
335361
336-` rpm -Uvh fpc-2.2.4-0.i386.rpm`\
337-` rpm -Uvh fpc-src-2.2.4-0.i386.rpm`\
338-` rpm -Uvh lazarus-0.9.28.2-0.i586.rpm`
362+```text
363+ rpm -Uvh fpc-2.2.4-0.i386.rpm
364+ rpm -Uvh fpc-src-2.2.4-0.i386.rpm
365+ rpm -Uvh lazarus-0.9.28.2-0.i586.rpm
366+```
339367
340368#### Install Lazarus 0.9.4 on Mandrake 10.1
341369
342370Do the following steps to install your Lazarus Integrated Development Tool, with the Free Pascal Compler.
343371
344372I 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.
345373
346374- System: linux "Mandrake 10.1 Official" on a Pentium III (or II) type computer.
347375
348376- Lazarus: Version 0.9.4 (built: 3 january 2005).
349377
350378- FPC: Version 1.9.6 (built: 2 january 2005).
351379
352380- File names:
353381
354-`   File_1 = "fpc-1.0.10i386.tar" from:`\
355-`   `[`http://www.freepascal.org/down-linux-1386.html`](http://www.freepascal.org/down-linux-1386.html)
382+```text
383+ File_1 = "fpc-1.0.10i386.tar" from:
384+ http://www.freepascal.org/down-linux-1386.html
385+```
356386
357-`   File_2 = "fpc-1.9.6-050102.i386-linux.tar" from:`\
358-`   `[`http://www.lazarus.freepascal.org`](http://www.lazarus.freepascal.org)\
359-`   then follow the links: "binaries" / "linux" / "Current Lazarus Binary`\
360-`   RPM"`
387+```text
388+ File_2 = "fpc-1.9.6-050102.i386-linux.tar" from:
389+ http://www.lazarus.freepascal.org
390+ then follow the links: "binaries" / "linux" / "Current Lazarus Binary
391+ RPM"
392+```
361393
362-`   File_3 = "lazarus-050103.tgz" (from the lazarus site)`
394+```text
395+ File_3 = "lazarus-050103.tgz" (from the lazarus site)
396+```
363397
364398- System modules: Lazarus uses the GTK+ library (version 1 only, not version2). Go the "Mandrake Control Center" and install the modules:
365399
366-`      libgdk-pixbuf-xlib2-0.22.0-5mdk `\
367-`      libgdk-pixbuf2-devel-0.220.-5mdk `\
368-` `
400+```text
401+ libgdk-pixbuf-xlib2-0.22.0-5mdk
402+ libgdk-pixbuf2-devel-0.220.-5mdk
403+```
369404
370405There are 3 steps:
371406
372-`   Step A - Install the stable compiler (V1.0.10)`\
373-`   Step B - Install the current compiler (V1.9.6)`\
374-`   Step C - Install the Integrated Development Environment (Lazarus)`\
375-`   Step A - Install the stable compiler (FPC Version 1.0.10)`
407+```text
408+ Step A - Install the stable compiler (V1.0.10)
409+ Step B - Install the current compiler (V1.9.6)
410+ Step C - Install the Integrated Development Environment (Lazarus)
411+ Step A - Install the stable compiler (FPC Version 1.0.10)
412+```
376413
377414##### Step A - Install the stable compiler (FPC Version 1.0.10)
378415
379416In 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):
380417
381-`   A.1- In user mode ("myself") type: mkdir /home/myself/freepascal/V1.0.10`\
382-`   A.2- copy File_1 to /home/myself/freepascal/V1.0.10`\
383-`   A.3- type: tar -xvf File_1 (of course you type the actual `\
384-`   file name given above)`\
385-`   A.4- type: cd fpc`\
386-`   A.5- go to the superuser mode (type: "su" then your password)`\
387-`   A.6- type: sh install.sh`\
388-`   A.7- you want to install it in the [/usr/local folder] then `\
389-`   just press: return`\
390-`   A.8- anwser "Y" to all the 11 questions, and answer "return" `\
391-`   to the last question.`
418+``` pascal
419+ A.1- In user mode ("myself") type: mkdir /home/myself/freepascal/V1.0.10
420+ A.2- copy File_1 to /home/myself/freepascal/V1.0.10
421+ A.3- type: tar -xvf File_1 (of course you type the actual
422+ file name given above)
423+ A.4- type: cd fpc
424+ A.5- go to the superuser mode (type: "su" then your password)
425+ A.6- type: sh install.sh
426+ A.7- you want to install it in the [/usr/local folder] then
427+ just press: return
428+ A.8- anwser "Y" to all the 11 questions, and answer "return"
429+ to the last question.
430+```
392431
393432At 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:
394433
395-`   /usr/local/lib/fpc/1.0.10/`
434+```text
435+ /usr/local/lib/fpc/1.0.10/
436+```
396437
397438##### Step B - Install the current compiler (FPC Version 1.9.6)
398439
399440This is very similar to the previous section:
400441
401-`   B.1- In user mode ("myself") type: mkdir /home/myself/freepascal/V1.9.6`\
402-`   B.2- move File_2 to: /home/myself/freepascal/V1.9.6`\
403-`   B.3- type: tar -xvf File_2 (actual name given above)`\
404-`   B.4- type: cd fpc`\
405-`   B.5- go to the superuser mode ("su")`\
406-`   B.6- type: sh install.shl (takes about 10 minutes)`\
407-`   B.7- anwser "Y" to all the 12 questions, and answer "return" to the last`\
408-`   question.`
442+``` pascal
443+ B.1- In user mode ("myself") type: mkdir /home/myself/freepascal/V1.9.6
444+ B.2- move File_2 to: /home/myself/freepascal/V1.9.6
445+ B.3- type: tar -xvf File_2 (actual name given above)
446+ B.4- type: cd fpc
447+ B.5- go to the superuser mode ("su")
448+ B.6- type: sh install.shl (takes about 10 minutes)
449+ B.7- anwser "Y" to all the 12 questions, and answer "return" to the last
450+ question.
451+```
409452
410453At this point check that you have a directory:
411454
412-`   /usr/local/lib/fpc/1.9.6/units/i386-linux/`
455+```text
456+ /usr/local/lib/fpc/1.9.6/units/i386-linux/
457+```
413458
414459filled with the libraries. There are all sort of folders in there. Now check that the file fpc.cfg has the lines:
415460
416-`   -Fu/usr/local/lib/fpc/1.9.6/units/$fpctarget `\
417-`   -Fu/usr/local/lib/fpc/1.9.6/units/$fpctarget/* `\
418-`   -Fu/usr/local/lib/fpc/1.9.6/units/$fpctarget/rlt `
461+```text
462+ -Fu/usr/local/lib/fpc/1.9.6/units/$fpctarget
463+ -Fu/usr/local/lib/fpc/1.9.6/units/$fpctarget/*
464+ -Fu/usr/local/lib/fpc/1.9.6/units/$fpctarget/rlt
465+```
419466
420467Note 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:
421468
422-`   B.7.a - "I" to go to the "insert" mode`\
423-`   B.7.b - type in your lines as shown above`\
424-`   B.7.c - press "ESCAPE" to go back to the command mode`\
425-`   B.7.d - type ":wq" to save and exit. (":q!" exit without save!)`
469+``` pascal
470+ B.7.a - "I" to go to the "insert" mode
471+ B.7.b - type in your lines as shown above
472+ B.7.c - press "ESCAPE" to go back to the command mode
473+ B.7.d - type ":wq" to save and exit. (":q!" exit without save!)
474+```
426475
427476The last "trick" is to check (and change, if necessary) that the symbolic link "ppc386" points to the good compiler. Type:
428477
429-`   B.8.a- cd /usr/local/bin`\
430-`   B.8.b- ls -al`
478+```text
479+ B.8.a- cd /usr/local/bin
480+ B.8.b- ls -al
481+```
431482
432483The displayed line should show:
433484
434-`   ppc386 --> /usr/local/lib/fpc/1.9.6/ppc386`
485+```text
486+ ppc386 --> /usr/local/lib/fpc/1.9.6/ppc386
487+```
435488
436489If it does, then skip to step B9, otherwise type :
437490
438-`   B.8.c- rm ppc386 (then "y")`\
439-`   B.8.d- type: ln -s /usr/local/lib/fpc/1.9.6/ppc386`\
440-`   B.9 - Go back to the user mode (type: "exit").`\
441-`   B.10- type: fpc`
491+``` pascal
492+ B.8.c- rm ppc386 (then "y")
493+ B.8.d- type: ln -s /usr/local/lib/fpc/1.9.6/ppc386
494+ B.9 - Go back to the user mode (type: "exit").
495+ B.10- type: fpc
496+```
442497
443498Wonderfull! Now you see from the help message that you have the version 1.9.6 compiler. The last step is to load the IDE.
444499
445500##### Step C - Install the Integrated Development Environment (Lazarus)
446501
447502The Lazarus can installed in your own user account ("myself"). That can be done in the user mode:
448503
449-`   C.1- type: cd ~`\
450-`   C.2- Copy File_3 to: /home/myself/`\
451-`   C.3- cd ~`\
452-`   C.4- tar -xvzf File_3 this will create the lazarus folder`\
453-`   C.5- cd lazarus`\
454-`   C.6- make clean all (takes about 10 minutes)`\
455-`   C.7- type: ./lazarus`
504+``` pascal
505+ C.1- type: cd ~
506+ C.2- Copy File_3 to: /home/myself/
507+ C.3- cd ~
508+ C.4- tar -xvzf File_3 this will create the lazarus folder
509+ C.5- cd lazarus
510+ C.6- make clean all (takes about 10 minutes)
511+ C.7- type: ./lazarus
512+```
456513
457514This 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/.
458515
459-`   C.8- In order to check that the application is working properly,`\
460-`   create the simplest application. Just drag and drop a button on `\
461-`   the form and press F9.`\
462-`   C.9- Finally, create a shortcut icon on your desktop that executes lazarus`\
463-`   in the /home/myself/lazarus/ directory. Enjoy.`
516+```text
517+ C.8- In order to check that the application is working properly,
518+ create the simplest application. Just drag and drop a button on
519+ the form and press F9.
520+ C.9- Finally, create a shortcut icon on your desktop that executes lazarus
521+ in the /home/myself/lazarus/ directory. Enjoy.
522+```
464523
465524Finally, I would like to make a few comments:
466525
467526- 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.
468527- 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.
469528- 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:
470529
471-`      kernel-source-2.6-2.6.8.1-12mdk  `\
472-`      libgdk-pixbuf2.0-0-devel-2.4.9-9mdk  `
530+```text
531+ kernel-source-2.6-2.6.8.1-12mdk
532+ libgdk-pixbuf2.0-0-devel-2.4.9-9mdk
533+```
473534
474535- 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.
475536
476537- 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.
477538
478539I hope that this was not too pedantic and could be useful to someone. I wish you a good luck. Alain Michaud 31 January 2005
479540
480541#### Installing from source
481542
482543If 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 svn.
483544
484545Here is an example of installing 0.9.28 to Ubuntu 6.06. If you understand Linux commands and bash script, you can get what steps are needed. Just copy the script (change the version number when new version has been released), paste it into a text editor, and save it as something like "install_lazarus.sh". Give it execute permission, and run it in a console. Note: In this example, fpc is installed in /opt. So when prompted 'Install prefix', enter '/opt/fpc'.
485546
486-` #!/bin/sh`\
487-` `\
488-` #installing required packages`\
489-` sudo apt-get install build-essential`\
490-` sudo apt-get install libgtk2.0-dev`\
491-` sudo apt-get install libgdk-pixbuf-dev`\
492-` `\
493-` #installing FreePascal source`\
494-` cd /opt`\
495-` sudo wget `[`http://nchc.dl.sourceforge.net/lazarus/fpc-src-2.2.4.source.tgz`](http://nchc.dl.sourceforge.net/lazarus/fpc-src-2.2.4.source.tgz)\
496-` sudo tar -xvf fpc-src-2.2.4.source.tgz`\
497-` sudo mv fpc fpcsrc`\
498-` `\
499-` #installing FreePascal`\
500-` sudo mkdir fpc`\
501-` cd fpc`\
502-` sudo wget `[`http://nchc.dl.sourceforge.net/lazarus/fpc-2.2.4.i386-linux.tar`](http://nchc.dl.sourceforge.net/lazarus/fpc-2.2.4.i386-linux.tar)\
503-` sudo tar -xvf fpc-2.2.4.i386-linux.tar`\
504-` echo "Enter '/opt/fpc' when prompted 'Install prefix'"`\
505-` sudo sh install.sh`\
506-` `\
507-` #adding fpc path to the PATH`\
508-` echo "#FPC PATH" >> ~/.bash_profile`\
509-` echo "if [ -d /opt/fpc/bin ] ; then" >> ~/.bash_profile `\
510-` echo PATH=/opt/fpc/bin:"${PATH}" >> ~/.bash_profile`\
511-` echo "fi" >> ~/.bash_profile`\
512-` `\
513-` #installing Lazarus`\
514-` cd ../`\
515-` sudo wget `[`http://nchc.dl.sourceforge.net/lazarus/lazarus-0.9.28-0.tar.gz`](http://nchc.dl.sourceforge.net/lazarus/lazarus-0.9.28-0.tar.gz)\
516-` sudo tar -zxvf lazarus-0.9.28-0.tar.gz`\
517-` PATH=/opt/fpc/bin:"${PATH}"`\
518-` sudo chmod -R 777 lazarus`\
519-` cd lazarus`\
520-` make clean all`\
521-` ./lazarus`
547+```text
548+ #!/bin/sh
549+
550+ #installing required packages
551+ sudo apt-get install build-essential
552+ sudo apt-get install libgtk2.0-dev
553+ sudo apt-get install libgdk-pixbuf-dev
554+
555+ #installing FreePascal source
556+ cd /opt
557+ sudo wget http://nchc.dl.sourceforge.net/lazarus/fpc-src-2.2.4.source.tgz
558+ sudo tar -xvf fpc-src-2.2.4.source.tgz
559+ sudo mv fpc fpcsrc
560+
561+ #installing FreePascal
562+ sudo mkdir fpc
563+ cd fpc
564+ sudo wget http://nchc.dl.sourceforge.net/lazarus/fpc-2.2.4.i386-linux.tar
565+ sudo tar -xvf fpc-2.2.4.i386-linux.tar
566+ echo "Enter '/opt/fpc' when prompted 'Install prefix'"
567+ sudo sh install.sh
568+
569+ #adding fpc path to the PATH
570+ echo "#FPC PATH" >> ~/.bash_profile
571+ echo "if [ -d /opt/fpc/bin ] ; then" >> ~/.bash_profile
572+ echo PATH=/opt/fpc/bin:"${PATH}" >> ~/.bash_profile
573+ echo "fi" >> ~/.bash_profile
574+
575+ #installing Lazarus
576+ cd ../
577+ sudo wget http://nchc.dl.sourceforge.net/lazarus/lazarus-0.9.28-0.tar.gz
578+ sudo tar -zxvf lazarus-0.9.28-0.tar.gz
579+ PATH=/opt/fpc/bin:"${PATH}"
580+ sudo chmod -R 777 lazarus
581+ cd lazarus
582+ make clean all
583+ ./lazarus
584+```
522585
523586Note: You have to manually set fpc-src path in the Environmental Options.
524587
525588##### Downloading Lazarus Source Code
526589
527590The lazarus repository has moved from cvs to svn (Subversion). SVN 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 need to be root.
528591
529592Please note these instructions are for SubVersion.
530593
531594Lazarus does not need any special permissions, neither during installation nor at runtime.
532595
533596With the move we also changed the directory layout of the lazarus sources. The main difference is that all ide sources are moved from the root to a separate ide subdir. As anybody might understand, this has an impact on the Makefiles, the searchpaths etc. We are in progress of fixing things, so if something doesn't work, please let us know.
534597
535598Now the most important thing.... getting the sources
536599
537-` []$ svn checkout `[`http://svn.freepascal.org/svn/lazarus/trunk/`](http://svn.freepascal.org/svn/lazarus/trunk/)` lazarus`
600+```text
601+ []$ svn checkout http://svn.freepascal.org/svn/lazarus/trunk/ lazarus
602+```
538603
539604(or any other dir where you want to place your sources)
540605
541606On subsequent occasions, to update simply type
542607
543-` []$ svn update lazarus`
608+```text
609+ []$ svn update lazarus
610+```
544611
545612For more information on Subversion, see: <http://subversion.tigris.org/>
546613
547614Note: the CVS is still accessable, but is frozen. This means that no new updates are comitted.
548615
549616##### Compiling and running
550617
551618Whether you checkout from cvs or svn, the next step is:
552619
553620compile lazarus
554621
555-`[]$ cd lazarus`\
556-`[]$ make  (gmake on BSD)`
622+```text
623+[]$ cd lazarus
624+[]$ make (gmake on BSD)
625+```
557626
558627If fpc is installed correctly, the compilation should work without problems. If not, see FAQ.
559628
560629Start lazarus
561630
562-`[]$ ./lazarus`
631+```text
632+[]$ ./lazarus
633+```
563634
564635The 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.
565636
566637Check the paths
567638Use the IDE menu to go to
568639
569640
570641Environment -\> Environment Options -\> Files
571642
572643The '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'.
573644
574645See here for the documentation about this dialog: [[IDE Window: Environment Options]]
575646
576647Hint
577648
578649To update lazarus you can use
579650
580-`[]$ svn update lazarus`
651+```text
652+[]$ svn update lazarus
653+```
581654
582655then for either update pathway:
583656
584-`[]$ make clean all   (gmake on BSD)`
657+```text
658+[]$ make clean all (gmake on BSD)
659+```
585660
586661This will rebuild lazarus and create an IDE without lazarus packages. To link your installed packages do **after** the above:
587662
588-`[]$ ./lazbuild --build-ide=`
663+```text
664+[]$ ./lazbuild --build-ide=
665+```
589666
590667You may have to append other options if for example you use a custom config directory (ie. add --pcp="C:\Documents and Settings\\\<USER\>\Local Settings\Application Data\lazarus-tests")
591668
592669#### Installing Lazarus under Debian GNU/Linux
593670
594671There are preliminary Debian packages for lazarus available for download. They are not the latest versions, however. 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\>.
595672
596673Note that for a fully working Lazarus install, no older or incompatible versions of, for example, the fpc source or fpc compiler must be installed. Remove them by typing
597674
598-` dpkg -r <package name>   `
675+```text
676+ dpkg -r <package name>
677+```
599678
600679without .deb extension. And then install the newest versions as described.
601680
602681#### Installing Lazarus 64 bit version on Red Hat EL 5
603682
604683Linking may fail when you do your first compile with an error "incompatible libglib" if the following symbolic links are not present in the /usr/lib64/ directory
605684
606685libglib.so -\> libglib-1.2.so.0 libgtk.so -\> libgtk-1.2.so.0.9.1 libgdk.so -\> libgdk-1.2.so.0.9.1
607686
608687The steps for successful installation on Red Hat were
609688
610689yum install gimp gimp-devel gtk+* gtk+-devel
611690
612691Then install the following rpms
613692
614693fpc-2.2.4-0.x86_64.rpm fpc-docs-2.2.4-0.x86_64.rpm lazarus-0.9.28.2-0.src.rpm lazarus-debuginfo-0.9.28.2-0.x86_64.rpm fpc-2.2.4-3.fc10.x86_64.rpm fpc-src-2.2.4-091006.x86_64.rpm lazarus-0.9.28.2-0.x86_64.rpm
615694
616695add -Fl/usr/lib64 under \#ifdef cpux86_64 in fpc.cfg
617696
618697Then add the symbolic links listed above.
619698
620699#### Fedora Core 11
621700
622701Needed packages:
623702
624-`gtk2-devel glibc-devel binutils`
703+```text
704+gtk2-devel glibc-devel binutils
705+```
625706
626707Useful packages for development:
627708
628-`subversion wget gcc bison rpm-build`
709+```text
710+subversion wget gcc bison rpm-build
711+```
629712
630713### Installing Lazarus under Windows
631714
632715The current releases of the Windows Lazarus binary packages install very easily, and should work 'out-of-the-box'.
633716
634717It is even possible to install the whole Lazarus/FPC package on a portable USB drive (capacity at least 256 MB), for use in environments where you are not allowed to install software on your Windows workstation or where you haven't got administrator privileges. You do have to be a little careful about adjusting the paths in the compiler and environment options and the fpc.cfg file. It may also be necessary to keep the directory for test compilation on your portable drive.
635718
636719\<\< Q:DOES ANYONE KNOW HOW TO SET UP RELATIVE PATHS IN THESE TAGS AND FILES, SO THAT THE ADDRESSING WORKS WHEN YOU MOVE THE USB DEVICE TO ANOTHER MACHINE WHERE IT HAS A DIFFERENT DRIVE LETTER?
637720
638721A: This is what I do. It's relatively convoluted, but it's the best solution I've found. I have a "bin" directory on my USB drive, where I have several scripts and utilities installed. Inside that directory is a batch file called "setenv.bat" which sets an environment variable called THUMBDRIVE. It is set by using this command in the batch file:
639722
640-`  set THUMBDRIVE=%CD:~0,2%`
723+```text
724+ set THUMBDRIVE=%CD:~0,2%
725+```
641726
642727This is used in setenv.bat to set some paths to other things I have installed on the USB drive. I also have a link in the root directory of the thumb drive with this property:
643728
644-` %SystemRoot%\system32\cmd.exe /k bin\setenv`
729+```text
730+ %SystemRoot%\system32\cmd.exe /k bin\setenv
731+```
645732
646733so that when I click on that link when the thumb drive folder is diplayed after inserting it, it will open a command prompt at the thumb drive with the environment variables set from setenv.bat.
647734
648735Also inside the bin directory is [sed](http://sed.sf.net) (the actual binary is one I obtained from the mingw distribution). So I created another batch file called fixlaz.bat which takes one argument, the drive letter which is currently in the Lazarus/fpc settings files that you want to change (note that this is the previous drive letter the last time you ran fixlaz.bat, not the current one of your USB drive which fixlaz.bat already knows). You will need to create this batch file to fit where you installed Lazarus in the root directory structure of the drive if you didn't install it directly in the root folder, and then repeat these lines also for the editoroptions.xml and fpc.cfg files (fpc.cfg is the the fpc bin directory, which might be buried deep in the lazarus folder):
649736
650-` copy %THUMBDRIVE%\lazarus\environmentoptions.xml %THUMBDRIVE%\lazarus\environmentoptions.bak`\
651-` sed -e 's/%1/%THUMBDRIVE%/g' %THUMBDRIVE%\lazarus\environmentoptions.bak > %THUMBDRIVE%\lazarus\environmentoptions.xml`
737+```text
738+ copy %THUMBDRIVE%\lazarus\environmentoptions.xml %THUMBDRIVE%\lazarus\environmentoptions.bak
739+ sed -e 's/%1/%THUMBDRIVE%/g' %THUMBDRIVE%\lazarus\environmentoptions.bak > %THUMBDRIVE%\lazarus\environmentoptions.xml
740+```
652741
653742So to use it, I would type at the command prompt of the USB drive:
654743
655-` fixlaz G:`
744+```text
745+ fixlaz G:
746+```
656747
657748if "G:" was the previous drive letter used the last time I ran it. This will then scan the file(s) and replace "G:" with the current drive letter of the USB drive, which is in the %THUMBDRIVE% environment variable (after running setenv.bat). Note that you could write it to save the current drive letter in a separate file, so that you wouldn't have to remember it yourself the next time. But this works well enough for me right now. \>\>
658749
659750The binary package is available for Linux and Windows from
660751
661752<http://sourceforge.net/project/showfiles.php?group_id=89339>
662753
663754Download the latest release (currently Lazarus-0.9.28-0-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).
664755
665756You can also use a Lazarus Snapshot. For download locations see [[Lazarus Snapshots Downloads]].
666757
667758Tip: It's perhaps a good idea to reboot your Windows after you installed Lazarus and before you try to install additional lazarus components as zeoslib fore example.
668759
669760#### Installing from source
670761
671762If you prefer to install from sources, then follow these instructions (Thanks to Joe for the initial Step-by-step description). Please note these instructions are for SubVersion.
672763
673764You have to download the lazarus source from one of the [[Lazarus Snapshots Downloads|snapshots servers]]. Then unzip it to c:\lazarus for example \[below called \$(LazarusDir)\].
674765
675766Or you use SVN:
676767
677-` []$ svn checkout `[`http://svn.freepascal.org/svn/lazarus/trunk/`](http://svn.freepascal.org/svn/lazarus/trunk/)
768+```text
769+ []$ svn checkout http://svn.freepascal.org/svn/lazarus/trunk/
770+```
678771
679772You have to install at least fpc-2.2.4, but a fpc-2.5.1 snapshot is also possible. 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).
680773
681774Open a command line. Start-\>Run...\>command or choose MS-DOS icon.
682775
683776Type:
684777
685-`//Replace $(LazarusDir) with the path you have unzipped/checked out Lazarus`\
686-`cd $(LazarusDir)\ide`\
687-`set path=c:\pp\bin\win32;$(LazarusDir)  //of course change the first to`\
688-`                                        //the path of yours`\
689-`windres -i lazarus.rc -o lazarus.res`\
690-`cd $(LazarusDir)`\
691-`make`
778+```text
779+//Replace $(LazarusDir) with the path you have unzipped/checked out Lazarus
780+cd $(LazarusDir)\ide
781+set path=c:\pp\bin\win32;$(LazarusDir) //of course change the first to
782+ //the path of yours
783+windres -i lazarus.rc -o lazarus.res
784+cd $(LazarusDir)
785+make
786+```
692787
693788If 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.
694789
695790You can compile examples also:
696791
697-`cd $(LazarusDir)\examples`\
698-`make`
792+```text
793+cd $(LazarusDir)\examples
794+make
795+```
699796
700797If 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:\\
701798
702799That's all.
703800
704801### Installing Lazarus under FreeBSD
705802
706803#### FreeBSD 6+
707804
708805The latest version of Lazarus into FreeBSD port tree is 0.9.28.3 (Fixes branch). We can to install lazarus using FreeBSD ports.
709806
710-`[]# cd /usr/ports/editors/lazarus && make install clean clean-depends`
807+```text
808+[]# cd /usr/ports/editors/lazarus && make install clean clean-depends
809+```
711810
712811If you get the messages about missing source files, go to \[menu bar \>\> Environment \>\> Environment Options \>\> Files Tab: FPC source library\] and enter the directory of the FPC source files. It can be obtained from /usr/ports/distfiles/freepascal
713812
714813### Installing Lazarus under PC-BSD 1.0rc1+
715814
716815You can install Lazarus on PB-BSD by simply downloading the Lazarus PBI from [PBI Dir](http://www.pbidir.com/)
717816
718817Note that you must install glib* port from /usr/port/devel/glib* or glib packages by pkg_add -r glib12 glib20. I will fix this in new PBI releases.
719818
720819**\[other OpenBSD/NetBSD/DragonFlyBSD goes here\]**
721820
722821### Installing Lazarus under macOS
723822
724823First need to install the Apple developer tools. Then you can install the latest release from [1](http://sourceforge.net/projects/lazarus/files/) or the daily snapshots from the [[Lazarus Snapshots Downloads|snaphot servers]].
725824
726825More elaborate instructions can be found in [[Installing Lazarus on macOS]].
727826
728827If you install all 3 .dmg snapshot files, this also installs the FPC compiler and the FPC and Lazarus source too. If you only need to run Lazarus to develop and compile your own apps, you don't need to install the FPC and Lazarus sources as described above. If you need to rebuild Lazarus or want to help with its development, then you should to install the Lazarus source to a folder where you have read-write permission, as described above.
729828
730829Now you can start Lazarus from the folder /Applications.
731830
732831### Installing Lazarus under Haiku
733832
734833Lazarus requires Qt under Haiku. Qt is not installed by default under Haiku. You need to install package available from this site : <http://qt-haiku.ru/>
735834
736835Currently, there is no binary package to install Lazarus.
737836
738837You will have to compile Lazarus from sources.
739838
740839Detailed instructions to build Lazarus under Haiku are available here : [[Installing Lazarus on Haiku]]
741840
742841### Additional experiences and advice on installing FPC and Lazarus
743842
744843On linux, getting Lazarus to work can be complicated if you have an older version installed. 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.
745844
746845Pitfalls that I have experienced in various attempts with SuSE linux include:
747846
748847The rpm versions often install FPC in /bin or /usr/bin, with the libraries in /lib or /usr/lib.
749848
750849If 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.
751850
752851So 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
753852
754853Make sure the links in /etc/fpc.cfg point to the correct versions of the libraries (particularly if you have older versions still lurking around).
755854
756855In /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.
757856
758857Try running the compiler from the command line using one of the simple example programs or one which you wrote yourself.
759858
760859Turning to Lazarus:
761860
762861If you use a downloaded snapshot (.tar.gz) or get the source from CVS, enter your lazarus directory and type
763862
764-`make`\
765-`./lazarus `
863+```text
864+make
865+./lazarus
866+```
766867
767868and 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 (e.g. /usr/local/bin/ppc386), the FreePascal source directory (e.g. /usr/local/lib/fpc/\$version/fpc or a directory in your own space e.g. ~/FreePascal/fpc). Then close the dialog and start programming.
768869
769870You may find further problems when you start programming or compiling; most of these will be related to PATH selection.
770871
771872Many 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
772873
773874<http://www.lazarus.freepascal.org/modules.php?op=modload&name=FAQ&file=index>
774875
775876From 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.
776877
777878When 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).
778879
779880Once 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.
780881
781882---
782883*From the Free Pascal wiki, page "Installation hints for old versions", as it stood on 2022-01-13 after a change by Trev, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*
783884Category: Historical
784885Category: Install
785886Category: Lazarus

Back to history