Recent

Author Topic: Installing package Lnet on linux  (Read 2502 times)

lado

  • New Member
  • *
  • Posts: 12
Installing package Lnet on linux
« on: April 17, 2023, 08:47:08 am »
Using Lazarus 2.2.6/FPC 3.2.2  installed by FpcUpDeluxe I ran into trouble while trying to install Lnet package on Linux Mint 21.1 (AMD64) and on Debian 11 AARCH64 (Raspberry Pi):
- It will not install from the FpcUpDeluxe modules menu, not only that it does not install, but it also messes up the Lazarus installation so it needs to be reinstalled.
- It won't install Lnet from OPM too, it looks like it installs the lnetbase.lpk but not the lnetvisual.lpk.
- I downloaded the lnet-master package but by using the help files from that package I just can't figure out the procedure to install it from the Lazarus

BTW: on Windows 11 Lnet successfully installs from the FpcUpDeluxe.

So I wonder if anyone successfully uses this package on Linux 64-bit platform from a recent Lazarus/FPC combination and looking for a description of how she/he installed it.
Since I am just starting a multi-platform project where I need to communicate with external hardware using UDP in one case and XML-RPC in the other case, I am willing to consider using alternative packages other than Lnet, so I am open to suggestions.

TRon

  • Hero Member
  • *****
  • Posts: 4377
Re: Installing package Lnet on linux
« Reply #1 on: April 17, 2023, 09:08:48 am »
Tested with Lazarus 2.2.4/Linux Mint x86-64:
- start lazarus
- menu/package/online package manager
- in the list of packages.lazarus-ide.org select LNet (that will select/checkmark both lnetbase.lpk and lnetvisual.lpk)
- press the install button
- a popup window appeasrs that show the download/build progress for the packages
- after that popup window closes a dialog window appears, asking to rebuild the ide with a preselected profile (normal IDE in my case).
- press yes on the dialog window.
- the lazarus IDE will now rebuild.
- After the rebuild finished, Lazarus is restarted
- The the visual and non-visual lnet packages/units can now be used.

At what point do things go wrong for you if you try to install both LNet packages with OPM ?

In your lazconfig directory there is a subdirectory named "onlinepackagemanager" with a subdirectory named "packages". If the OPM installation was successful then you should be able to see a directory named "lnet" in there. In there is a directory named "lazaruspackage" which should contain both files "lnetbase.lpk" and "lnetvisual.lpk" which should be accessible from your Lazarus project.
Today is tomorrow's yesterday.

lado

  • New Member
  • *
  • Posts: 12
Re: Installing package Lnet on linux
« Reply #2 on: April 17, 2023, 10:10:24 am »
Hi, thanks for the quick response.

I tried again using the steps you provided:
- after I press the install window, a popup opens saying that packages FPC and Widgetset are not tested Lazarus is OK and that they might not work
- after pressing Yes to start the package installation it opens and compiles lnetbase.lpk with sucess, then tries to do the same with the package lnetvisual.lpk That step fails during compilation and a new popup appears telling Cannot install package: lnetvisual.lpk. In a IDEMessages window there are 6 errors found before the compiler abort:

Quote
lclnet.pas(45,15) Error: Forward declaration not solved "HandleIgnoreError(TLHandle);"
lclnet.pas(46,15) Error: Forward declaration not solved "HandleIgnoreWrite(TLHandle);"
lclnet.pas(47,15) Error: Forward declaration not solved "HandleIgnoreRead(TLHandle);"
lclnet.pas(48,15) Error: Forward declaration not solved "InternalUnplugHandle(TLHandle);"
lclnet.pas(50,15) Error: Forward declaration not solved "HandleEvents(Int64;LongWord);"
lclnet.pas(58,14) Error: Forward declaration not solved "AddHandle(TLHandle):Boolean;"


Popup asking for the rebuild (of course) never appears. When I check the Install/Uninstall packages window there is package lnetvisual 0.6.6 on the Available for installation side. If I move it to the Install side and rebuild the IDE same errors appear (not surprisingly) in the IDE Message window.

I guess that the best way now would be to downgrade to Lazarus 2.2.4 which you are using  but unfortunately  quick check of the fpcupdeluxe GitHub page shows no older versions ...



lado

  • New Member
  • *
  • Posts: 12
Re: Installing package Lnet on linux
« Reply #3 on: April 17, 2023, 11:44:53 am »
HI,
It turns out that my check for older releases was too quick. I found the Lazarus 2.2.4/FPC 3.2.2 release and installed it. Sadly it does not work, with the same symptoms as with the newer Lazarus release before.
Question: which exact Mint version do you use? Mine is the latest (21.1). I can install an earlier version in a VM but  if you use the same version as I do that would be a pointless waste of time

TRon

  • Hero Member
  • *****
  • Posts: 4377
Re: Installing package Lnet on linux
« Reply #4 on: April 17, 2023, 11:50:43 pm »
Sorry for the delay as I missed/overlooked your post.

I used mint 21.0 (not upgraded) on a flash-drive where I tested it.

But, in reality it does not matter much as it should work (also for mint 21.1, but my actual development system is running debian bookworm with mate) so I wonder what might be wrong at your setup.

fwiw: the only thing I use to make my setups is a starting compiler (or actually the ppc executable) that I extract from an existing Free Pascal installation package. I use that to build the FPC compiler version that I want to install from source (gitlab) and use that FPC compiler to build Lazarus (again from gitlab source). In theory fpcdeluxe does exactly the same but in an automated manner (press some checkboxes/buttons and presto).

Quote
after I press the install window, a popup opens saying that packages FPC and Widgetset are not tested Lazarus is OK and that they might not work
.. that makes me wonder if could be possible that you perhaps have some remnants left of an old(er) installation. Are you aware of the importance of the pcp start option of Lazarus (it is also responsible for the storage location of your configuration files) ?

The message as you describe seem to suggest that the required FPC and widgetset (source) packages are located somewhere where Lazarus is actually unable to check/verify them.

I am very ill informed when it comes to fixing/debugging such issues with Lazarus simply because I never seem to run into such errors myself (knock on wood).

The only thing I can say for sure is that on Windows things are a lot more forgiving/simpler as Linux tend to have about a hundred different locations where your configuration could be stored (and which one Lazarus/FPC picks up is always a mystery to/for me, hence the use of the pcp startup option for Lazarus and the deletion of all default fpc.cfg and Lazarus configuration files. I even override the default used fpc.cfg file that is used by default by FPC).

« Last Edit: April 17, 2023, 11:57:18 pm by TRon »
Today is tomorrow's yesterday.

lado

  • New Member
  • *
  • Posts: 12
Re: Installing package Lnet on linux
« Reply #5 on: April 18, 2023, 11:20:49 am »
Hi,
I went through your last message and it occurred to me that you don't use fpcupdeluxe for setting up the FPC and Lazarus combo. I only went to the fcpupdeluxe way because it seemed easier than going through 'traditional' installation as the docs about doing that are somewhat 'lacking', to put it mildly.
It would be really great if you roughly describe the way you are doing it and maybe provide me with some links to docs, so I can try the installation your way.

TRon

  • Hero Member
  • *****
  • Posts: 4377
Re: Installing package Lnet on linux
« Reply #6 on: April 18, 2023, 06:41:07 pm »
I went through your last message and it occurred to me that you don't use fpcupdeluxe for setting up the FPC and Lazarus combo.
That is correct. I do things manually (from scratch and pristine machine).

Quote
I only went to the fcpupdeluxe way because it seemed easier than going through 'traditional' installation as the docs about doing that are somewhat 'lacking', to put it mildly.
On occasion I do use fpcdeluxe on a new (FPC supported) system as that will allow me to skip the step of cross compiling first in order to create a native compiler (fpcdeluxe can be faster/quicker than me supporting a new introduced target) but that mostly because of laziness  :D

One thing that I think is definitely a pro for using fpcdeluxe is that it also provides all necessary tools (binutils etc) so that you can skip building those yourself (it can be a daunting task on some platforms).

The general approach is to use a FPC (precompiled) distributed package (whether provided by Free Pascal downloadplaces) or your package manager (if there is any).

But, I dislike that approach of installing precompiled binaries as doing also will dictate where everything is located and that can cause serious headaches when dealing with multiple installations of FPC and/or Lazarus, not to mention cross-compiling.

Quote
It would be really great if you roughly describe the way you are doing it and maybe provide me with some links to docs, so I can try the installation your way.
Before going into details on that, please bear in mind that your issue seem to be related to the configuration/setup of Lazarus (due to my lack of knowledge with these kind of errors I am unable to tell if it is something simple that can be fixed based on some simple checks or if there is a bigger underlying issue).

The way that I personally use to install things is not documented anywhere though I used existing documentation (wiki and buildfaq) to get myself familiar with the build system, available platforms and their additional build options if any, required binutils, cross-compilation etc.

I do not have a problem sharing a manual installation process but in the process it might bore you to death. My setup is pretty uncommon in that it works for multiple platforms at the same time so, I am unable to copy/share things verbatim (so that will take some time in case you require detailed instructions).

If you allow, then let me/us take a step back first by asking a few questions.
1.
When you started your freshly installed Lazarus for the first time (you might be able to see that window later as well in case Lazarus thinks there are issues with its setup) there would have been a popup window named "configure Lazarus IDE). For more details/pictures see https://forum.lazarus.freepascal.org/index.php?topic=61185.0

Did you setup the configuration correctly there ?

If you want to go into the nitty gritty details then the file used to store those settings is located in your lazcfg directory and is named "environmentoptions.xml"

2.
Did or have you ever used your package manager or Debian package file from Free Pascal downloads for installing FPC/Lazarus ?

If you have, then that can cause issues with FPCDeluxe (but also for a manual build) as there are configuration files in place that are able to mess up your FPC/Lazarus setup (even after removal as it requires manual labor to be able to do it properly)

As a very raw version of my manual builds:
- Determine which FPC version you wish to build. For example sake: v3.2.2
- Determine bootstrap compiler version (previous dot release). For 3.2.2 that would be 3.2.0
- Download the FPC 3.2.0 archive for your host system. For example sake we are on Linux-x86-64, Thus, https://sourceforge.net/projects/freepascal/files/Linux/3.2.0/fpc-3.2.0-x86_64-linux.tar
- Extract the bootstrap compiler executable (ppcx64) that is required. It is located in the tar file at fpc-3.2.0-x86_64-linux/binary.x86_64-linux.tar/base.x86_64-linux.tar.gz/lib/fpc/3.2.0/ppcx64
- Download and extract source-code for compiler version you wish to build, f.e. https://sourceforge.net/projects/freepascal/files/Source 3.2.2/fpc-3.2.2.source.tar.gz (alternatively you can use git to clone the gitlab repository and checkout the 3.2.2 branch).
- Build the FPC compiler using the bootstrap compiler, e.g. make clean all install PP="/wherever/your/ppcx86_64/executable/is/located/but/please/avoid/having/it/in/your/searchpath" . Use additional make options if required.
- optionally build a cross compiler using the FPC executable of your freshly build fpc 3.2.2 with using make option FPC="/path/to/your/3.2.2/fpc/executable" with additional/required build options.
- Place/copy/move your freshly copies of the FPC host and cross compiler somewhere that you want them to be located.
- Make a link, use an alias, or a script that invokes your FPC executable from the command line. Make sure to avoid placing the Free Pascal binary directory in your path (it clashes when you want to install multiple different versions of FPC on the same host).
- configure the compiler by editing your fpc.cfg file. In case there are multiple different version of Free Pascal that you want to use, as an advise make sure to only use one fpc.cfg file (f.e. you can use the -n override in combination with the (undocumented) @ symbol to point to another fpc..cfg file (with location)).
- determine which Lazarus version you wish to build, for example 2.2.4
- download and extract Lazarus sources, f.e. "https://sourceforge.net/projects/lazarus/files/Lazarus%20Zip%20_%20GZip/Lazarus%202.2.4/lazarus-2.2.4-0.tar.gz"
- Build and install Lazarus using the freshly 3.2.2. compiler (make bigide PP="/path/to/your/fpc/3.2.2/executable/or/script/link/that/invokes/fpc").
- Make sure to invoke Lazarus with the option --pcp. f.e. use a desktop shortcut that reads something like "/home/username/lazarus/2.2.4/startlazarus --pcp=/home/username/lazarus/2.2.4/.lazconfig %f"
- On first run Lazarus will present a dialog and you need to answer a few questions about your setup/configuration, see also https://forum.lazarus.freepascal.org/index.php?topic=61185.0 . Make sure that thre are no red exclamation marks left and if all locations are corresponding to your setup.

How to install lnet was outlined one of the previous posts. Basically the above is what I did to install lnet (I just done what is written in this post on an earlier occasion)
Today is tomorrow's yesterday.

lado

  • New Member
  • *
  • Posts: 12
Re: Installing package Lnet on linux
« Reply #7 on: April 23, 2023, 06:29:53 am »
Hi, TRon
Sorry for taking this long to respond. My daughter is visiting with her 12-month-old son, so you can imagine that my life is upside down at the moment.
I almost accidentally found a solution to my trouble:(https://github.com/almindor/lnet/issues/7), so to solve it I need to either edit the file mentioned in the link or use non-Qt5 release of fpcupdeluxe. I tried both ways and both are working OK.
As for your last message: I tried to follow your description on fpc/Lazarus installation but 'crashed and burned'. Because I'd really like to be able to do this from scratch, I'll come back to tell you where and how I failed and perhaps get some further help from you. But it'll take 10 to 14 days until my life will be 'my own' again.

TRon

  • Hero Member
  • *****
  • Posts: 4377
Re: Installing package Lnet on linux
« Reply #8 on: April 23, 2023, 07:47:24 am »
Sorry for taking this long to respond....
No problem at all. Enjoy life :)

Quote
I almost accidentally found a solution to my trouble:(https://github.com/almindor/lnet/issues/7), so to solve it I need to either edit the file mentioned in the link or use non-Qt5 release of fpcupdeluxe. I tried both ways and both are working OK.
Ah. Great that you were able to find that. I did not encounter this issue because I'm running GTK. I would have expected that particular fix to be in the OPM version of LNet but apparently it is not.

Quote
As for your last message: ...
No worries. Just post whenever is comfortable for you. I am aware that the basic steps as described are a bit bare-bones but it does help to know where you get stuck. There are many pages in the wiki that are able to help but the basic ones are https://wiki.freepascal.org/Installing_the_Free_Pascal_Compiler for Free Pascal and https://wiki.lazarus.freepascal.org/Getting_Lazarus for Lazarus. I deviate a lot from what is written there but the basics are similar. Buildfaq page: https://wiki.freepascal.org/buildfaq
Today is tomorrow's yesterday.

CM630

  • Hero Member
  • *****
  • Posts: 1579
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
Re: Installing package Lnet on linux
« Reply #9 on: November 18, 2025, 03:31:36 pm »
I cannot install LNet on RPi 5 (Kali Linux).
Lazarus 4.4 (rev Unknown) FPC 3.2.3 aarch64-linux-gtk2

I get lcommon.pp(467,20) Error: Identifier not found "TZSeconds" in

Code: Pascal  [Select][+][-]
  1. function TZSeconds: Integer; inline;
  2. begin
  3. {$IF FPC_FULLVERSION >= 30301}
  4.   Result := TZInfo.Seconds;
  5. {$ELSE}
  6.   Result := unixutil.TZSeconds;
  7. {$ENDIF}
  8. end;    
Лазар 4,4 32 bit (sometimes 64 bit); FPC3,2,2

paweld

  • Hero Member
  • *****
  • Posts: 1561
Re: Installing package Lnet on linux
« Reply #10 on: November 19, 2025, 02:23:10 pm »
FPC 3.2-fixes has TZInfo defined. Change this code to:
Code: Pascal  [Select][+][-]
  1. function TZSeconds: Integer; inline;
  2. begin
  3.   {$IF FPC_FULLVERSION >= 30203}
  4.   Result := TZInfo.Seconds;
  5.   {$ELSE}
  6.   Result := unixutil.TZSeconds;
  7.   {$ENDIF}
  8. end;
« Last Edit: November 19, 2025, 02:30:00 pm by paweld »
Best regards / Pozdrawiam
paweld

CM630

  • Hero Member
  • *****
  • Posts: 1579
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
Re: Installing package Lnet on linux
« Reply #11 on: November 19, 2025, 03:11:02 pm »
Thanks, it compiled your way!
« Last Edit: November 19, 2025, 04:02:10 pm by CM630 »
Лазар 4,4 32 bit (sometimes 64 bit); FPC3,2,2

 

TinyPortal © 2005-2018