Recent

Author Topic: Installing Lazarus 1.8.4 on Ubuntu 18.04  (Read 72919 times)

Handoko

  • Hero Member
  • *****
  • Posts: 5122
  • My goal: build my own game engine using Lazarus
Installing Lazarus 1.8.4 on Ubuntu 18.04
« on: June 07, 2018, 10:26:35 pm »
Today I upgraded my Ubuntu Mate 17.10 to 18.04 and then Lazarus 1.8.2 to 1.8.4. At the beginning my several attempts to install Lazarus 1.8.4 were failed. Luckily, I managed to install Lazarus 1.8.4 at the end. Here I want to share how I did it, maybe it can be useful for others.

If you don't understand how to use Gdebi, Synaptic Package Manager then you should not try what I did. Also remember: always do proper backup especially for the config files.

You can read my previous tutorial Installing Lazarus 1.8.0 on Ubuntu 17.10 if you want to know more about Gdebi, Synaptic Package Manager, Version Locking. Read here:
https://forum.lazarus.freepascal.org/index.php/topic,39281.0.html

My previous system before software upgrade:
Ubuntu Mate 17.10 Intel 64-bit
Lazarus 1.8.2 64-bit

I use the deb files downloaded from:
https://sourceforge.net/projects/lazarus/files/Lazarus%20Linux%20amd64%20DEB/Lazarus%201.8.4/

I use these tools:
- Gdebi (makes installing deb packages easier)
- Synaptic Package Manager (for inspecting problem and do version locking)

After I upgraded to Ubuntu Mate 18.04 64-bit, I continued to Install Lazarus 1.8.4:

Attempts That Failed

01. Uninstalled Lazarus, fpc-src, fpc
02. Installed fpc_3.0.4-3_amd64.deb using Gdebi
03. Installed fpc-src_3.0.4-2_amd64.deb using Gdebi
04. Failed to install lazarus-project_1.8.4-0_amd64.deb using Gdebi


On step #04, I got a "Dependency is not satisfiable" error and the installation cannot continue. See image1.

Installation That Succeed

01. Uninstalled Lazarus, fpc-src, fpc
02. Installed fpc_3.0.4-3_amd64.deb using Gdebi
03. Installed fpc-src_3.0.4-2_amd64.deb using Gdebi
04. Restarted the computer
05. Disconnect the internet connection
06. Installed lazarus-project_1.8.4-0_amd64.deb using Gdebi
07. Got "multiple lazarus" warning, see
image2
08. For issue on #07, click "Start system default" and do step #09
09. Removed /home/handoko/.lazarus/bin folder
10. Got "incorrect configuration" warning, see
image3
11. For issue on #10, click "Update info"
12. Did version locking on fpc using Synaptic Package Manager


Usually you don't need step #04 but in some rare cases, you really need it.

I had to do step #12, because using Synaptic Package Manager I learned that fpc is waiting to be update. I have several bad experiences, Ubuntu told me to update my fpc and I did as what it said, after that my Lazarus failed to start.

I'm not sure, but it seems the step #05 was the thing caused my installation succeed.

Update1:

Although Lazarus 1.8.4 was installed after I finished the 12 steps above, it showed "error while linking" error if I tried rebuilding the IDE. You can read my posts below to learn how I solved it.

But in short, I've done 2 things: I reinstalled OpenGL-related libraries (using Synaptic Package Manager) and removed OpenGL-related packages in the IDE (in my case: LazOpenGL Context, BGRABitmap, Castle Game Engine).

Update2:

The know if the FPC is in the update list or not using Synaptic Package Manager, read here:
https://forum.lazarus.freepascal.org/index.php/topic,41326.msg288471.html#msg288471
« Last Edit: June 23, 2018, 10:21:09 am by Handoko »

Handoko

  • Hero Member
  • *****
  • Posts: 5122
  • My goal: build my own game engine using Lazarus
Re: Installing Lazarus 1.8.4 on Ubuntu 18.04
« Reply #1 on: June 08, 2018, 05:41:26 am »
:'( Unfortunately, the installation wasn't fully success. I got "error while linking" error when trying to rebuild my Lazarus. I can't use Lazarus 1.8.4 because I need to install third party components. For now I just reinstall back my Lazarus 1.8.2 and wait new release of Lazarus.

Someone has the same issue as mine too:
https://forum.lazarus.freepascal.org/index.php/topic,41482.msg287880.html#msg287880
« Last Edit: June 08, 2018, 05:45:03 am by Handoko »

balazsszekely

  • Guest
Re: Installing Lazarus 1.8.4 on Ubuntu 18.04
« Reply #2 on: June 08, 2018, 06:09:56 am »
@Handoko

Try step 3 from here: http://wiki.lazarus.freepascal.org/BGRA_Installation_on_Linux
It's about BGRA_Installation, but most likely will fix the linking error.

Handoko

  • Hero Member
  • *****
  • Posts: 5122
  • My goal: build my own game engine using Lazarus
Re: Installing Lazarus 1.8.4 on Ubuntu 18.04
« Reply #3 on: June 08, 2018, 07:51:12 am »
Thank you GetMem. After I done that, I still get the same error.

balazsszekely

  • Guest
Re: Installing Lazarus 1.8.4 on Ubuntu 18.04
« Reply #4 on: June 08, 2018, 08:01:19 am »
One thing is sure one or more library is still missing(or wrong version). Set the filtering setting to the lowest "Filter none" in the Message Window. Do you get any extra information on rebuild? Can you please copy the messages to clipboard and paste it here?
« Last Edit: June 08, 2018, 08:25:07 am by GetMem »

Handoko

  • Hero Member
  • *****
  • Posts: 5122
  • My goal: build my own game engine using Lazarus
Re: Installing Lazarus 1.8.4 on Ubuntu 18.04
« Reply #5 on: June 08, 2018, 08:32:03 am »
Here are the messages after I set the filter to none and disable "Filter Hints without Source Position":

Quote
make: Entering directory '/usr/share/lazarus/1.8.4'
/usr/bin/make -C ide idepkg
make[1]: Entering directory '/usr/share/lazarus/1.8.4/ide'
/usr/bin/make --assume-new=lazarus.pp lazarus OPT=' @/home/handoko/.lazarus/idemake.cfg'
make[2]: Entering directory '/usr/share/lazarus/1.8.4/ide'
/usr/bin/fpc -gl -vbqewnhi -Sci -dlclgtk2 -Fu../designer -Fu../debugger -Fu../debugger/frames -Fu../converter -Fu../packager -Fu../packager/frames -Fu../components/custom -Fuframes -Fu. -Fiinclude -Fiinclude/linux -Fi../images -FE.. -FU../units/x86_64-linux/gtk2 -Cg -Fl/usr/lib/gcc/x86_64-linux-gnu/7 -Flinclude -Fl/etc/ld.so.conf.d/*.conf @/home/handoko/.lazarus/idemake.cfg -dx86_64 lazarus.pp
Hint: (11030) Start of reading config file /etc/fpc.cfg
Hint: (11031) End of reading config file /etc/fpc.cfg
Hint: (11030) Start of reading config file /home/handoko/.lazarus/idemake.cfg
Hint: (11031) End of reading config file /home/handoko/.lazarus/idemake.cfg
Free Pascal Compiler version 3.0.4 [2018/05/21] for x86_64
Copyright (c) 1993-2017 by Florian Klaempfl and others
(1002) Target OS: Linux for x86-64
(3104) Compiling lazarus.pp
(9022) Compiling resource /home/handoko/.lazarus/units/x86_64-linux/gtk2/lazarus.or
(9015) Linking /home/handoko/.lazarus/bin/lazarus
/usr/bin/ld: warning: /home/handoko/.lazarus/bin/link.res contains output sections; did you forget -T?
/usr/bin/ld: cannot find -lGL
/usr/share/lazarus/1.8.4/ide/lazarus.pp(161,1) Error: (9013) Error while linking
/usr/share/lazarus/1.8.4/ide/lazarus.pp(161,1) Fatal: (10026) There were 1 errors compiling module, stopping
Fatal: (1018) Compilation aborted
make[2]: *** [lazarus] Error 1
make[1]: *** [idepkg] Error 2
Error: /usr/bin/ppcx64 returned an error exitcode
Makefile:3961: recipe for target 'lazarus' failed
make[2]: Leaving directory '/usr/share/lazarus/1.8.4/ide'
Makefile:4383: recipe for target 'idepkg' failed
make[1]: Leaving directory '/usr/share/lazarus/1.8.4/ide'
make: *** [idepkg] Error 2
Makefile:3276: recipe for target 'idepkg' failed
make: Leaving directory '/usr/share/lazarus/1.8.4'

The line before "Error while linking" is:
/usr/bin/ld: cannot find -lGL

What is it? And what should I do to fix it?

Handoko

  • Hero Member
  • *****
  • Posts: 5122
  • My goal: build my own game engine using Lazarus
Re: Installing Lazarus 1.8.4 on Ubuntu 18.04
« Reply #6 on: June 08, 2018, 08:48:02 am »
In my /home/handoko/.lazarus/bin/link.res I found these:

Quote
...
INPUT(
-lpthread
-ldl
-lgdk-x11-2.0
-lX11
-lgdk_pixbuf-2.0
-lgtk-x11-2.0
-lgobject-2.0
-lglib-2.0
-lgthread-2.0
-lgmodule-2.0
-lpango-1.0
-lcairo
-latk-1.0
-lGL
-lpangocairo-1.0
)
...

So lGL is a library. I checked using Synaptic Package Manager, lGL can't be found in the repository of Ubuntu 18.04 default installation.

Still looking for solution ...
« Last Edit: June 08, 2018, 08:55:15 am by Handoko »

balazsszekely

  • Guest
Re: Installing Lazarus 1.8.4 on Ubuntu 18.04
« Reply #7 on: June 08, 2018, 09:40:24 am »
sudo apt-get install libgl1-mesa-dev

Handoko

  • Hero Member
  • *****
  • Posts: 5122
  • My goal: build my own game engine using Lazarus
Re: Installing Lazarus 1.8.4 on Ubuntu 18.04
« Reply #8 on: June 08, 2018, 10:06:15 am »
libgl1-mesa-dev was already installed.

Because Ubuntu 18.04 (maybe also other linuxes) drops support for NVidia driver 304, now I'm using Nouveau driver. It's working good, I can run Lulu's Fire & Wire game (Game Contest 2018) using this open source driver.

Could you think this is the cause of the problem.

Previously before I upgraded my Ubuntu and Lazarus, I was using NVidia driver version 304. I had no such problem. Ubuntu 18.04 only provides Nouveau (open source), NVidia 340 and 390 drivers. The version 340 and 390 show only a blank screen and stop when starting the Ubuntu.

I googled the web, I saw people are complaining the missing NVidia 304 support on Ubuntu 18.04 and lGL library on Ubuntu 18.04.
« Last Edit: June 08, 2018, 11:42:01 am by Handoko »

balazsszekely

  • Guest
Re: Installing Lazarus 1.8.4 on Ubuntu 18.04
« Reply #9 on: June 08, 2018, 10:33:17 am »
Quote
Could you think this is the cause of the problem?
Yes. Maybe you should post a question on the Ubuntu forum and ask the guys if it's possible to install those libraries under 18.4.

Handoko

  • Hero Member
  • *****
  • Posts: 5122
  • My goal: build my own game engine using Lazarus
Re: Installing Lazarus 1.8.4 on Ubuntu 18.04
« Reply #10 on: June 08, 2018, 11:41:27 am »
Problem solved, now my Lazarus 1.8.4 seems to work correctly.

Not sure which one was the 'real' solution, but I have done these:

Because IGL is a library related with OpenGL, I use Synaptic Package Manager to reinstall items that related with OpenGL. I use Synaptic to find items with keyword "libGL". Then right-clicked on them and selected "Mark for reinstallation". (This is what I like about Synaptic, you can reinstall items without need the dependent libs/programs to be removed. AFAIK, I can't do it using Terminal).

Also, on the Lazarus IDE, I marked the OpenGL related packages to uninstall. FYI, I previously had LazOpenGL Context, BGRABitmap, Castle Game Engine installed on Lazarus 1.8.2.

After I done those 2 things above, I rebuilt my Lazarus 1.8.4. Everything went smoothly. And later I reinstalled back LazOpenGL Context, BGRABitmap, Castle Game Engine packages.

So far my Lazarus 1.8.4 now works without any issue.

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: Installing Lazarus 1.8.4 on Ubuntu 18.04
« Reply #11 on: June 08, 2018, 01:33:17 pm »
I think it is not "IGL" but "lGL" (lowercase L). So  sudo apt-get install lGL
should do the trick, and the only "i" is in "install".

Handoko

  • Hero Member
  • *****
  • Posts: 5122
  • My goal: build my own game engine using Lazarus
Re: Installing Lazarus 1.8.4 on Ubuntu 18.04
« Reply #12 on: June 08, 2018, 01:56:11 pm »
Oh my fault, if I mentioned IGL. It should be lGL.

I got "Unable to locate package lGL" if I type sudo apt-get install lGL on my Ubuntu 18.04 Terminal.

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: Installing Lazarus 1.8.4 on Ubuntu 18.04
« Reply #13 on: June 08, 2018, 02:47:14 pm »
Sorry that should be  ... install libGL

Handoko

  • Hero Member
  • *****
  • Posts: 5122
  • My goal: build my own game engine using Lazarus
Re: Installing Lazarus 1.8.4 on Ubuntu 18.04
« Reply #14 on: June 08, 2018, 04:24:00 pm »
libGL was already installed. Thank you for the suggestion, now my Lazarus is working correctly.

 

TinyPortal © 2005-2018