Recent

Author Topic: Lazarus Project gives problem on other machines.  (Read 14776 times)

The_Marlboro_Man

  • New Member
  • *
  • Posts: 33
Lazarus Project gives problem on other machines.
« on: November 06, 2007, 01:53:53 pm »
Hi:

I am quite new to Lazarus development (and almost as new to Delphi) but in my short adventures I have already found a problem with my projects.

As a part of an assignment we´re to make a program with Lazarus. The program itself will flawlessly run in a computer with Lazarus installed but as soon as we try to run it in a fresh Ubuntu machine (we´re running Ubuntu) we get no results. Trying it from the console results on the project requesting certain libraries to run.

First we thought it could have something to do with running "strip" on the compiled project but after trying again we got to the conclusion that the system does actually need the libraries it is requesting. That is strange for us as we are used to Delphi being "portable" without a single problem.

In this recent thread http://www.lazarus.freepascal.org/index.php?name=PNphpBB2&file=viewtopic&t=4513
we´ve found certain useful information but since our assignment is to make things as simple as possible we would like to know if there´s a way of "embedding" the required data from the compiling machine.

If the answer is negative we´re on a problem here: all Ubuntu machines in our classroom have no internet connection and trying to manually install the packages results in evil dependency problems.

We would like to know if there´s any way of having our application to run in any Ubuntu machine without the need of locating and installing the required packages.

Thanks for your attention.

Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2673
RE: Lazarus Project gives problem on other machines.
« Reply #1 on: November 06, 2007, 04:37:00 pm »
you need the required libs, no other way than installing them
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

Almindor

  • Sr. Member
  • ****
  • Posts: 412
    • http://www.astarot.tk
RE: Lazarus Project gives problem on other machines.
« Reply #2 on: November 06, 2007, 05:34:07 pm »
You could piggy-back them inside a libdir and use startup scripts which point the LD_LIBRARY_PATH to them. But for libraries like "gtk" it's not a good idea. If you need your app to work on generic linux install, try to compile a gtk2 lazarus and use that. Gtk2 is much more commonly installed than gtk1 by default.

The_Marlboro_Man

  • New Member
  • *
  • Posts: 33
RE: Lazarus Project gives problem on other machines.
« Reply #3 on: November 06, 2007, 08:23:39 pm »
First off, thanks for your quick reply, it sure does put some things into the correct perspective.

Marc, if we need the required libs then we have a problem: all the machines in the class are, as said, without an internet connection (as far as Ubuntu installations are concerned). We managed to get a hold of those libraries but they seem to depend on some others, and others and others. My partner insists that following the web of dependencies is madness as it comes to a point where their installation just breaks... In that sense we're lost: I have personally tried to manually install all dependencies for Lazarus and it was a never ending process. Nedless to say it didn't work and ended up doing the whole thing with Synaptic.

Almindor, I guess I am too much of a newbie to Lazarus to understand the meaning of your post. As for recompiling Lazarus with gtk2, it wouldn't work for our goal: we'd like people on the class to get Lazarus running by following simple instructions...

So, now we're thinking about this: if there's a way of running a Lazarus project in a machine where Lazarus is not present we'd like to integrate it in our class assignment. Our questions regarding this are:

-Do all Lazarus ("default" Lazarus projects, so to say) projects use the same dependencies?.
-Are these dependencies manually installable by downloading and installing the debian packages?.
-Where could we find a list of these needed files?.

Obviously, instructions regarding the installation of these libs would be included with our programs so they get running in any Ubuntu machine.

Then there's another question: as a part of our assignment we would like to demonstrate cross-compiling a Lazarus project so it runs in Windows. What kind of files would this Windows executable need to run?. If people in the class actually like Lazarus and would like to try it without installing Ubuntu in their home computers, would it be easy (easy enough as to follow instructions) to get it running in their computers?.

Again, thanks a lot... These kind of things demonstrate that sometimes the hardest part is not the code itself!.

Almindor

  • Sr. Member
  • ****
  • Posts: 412
    • http://www.astarot.tk
RE: Lazarus Project gives problem on other machines.
« Reply #4 on: November 06, 2007, 09:31:55 pm »
Well first off I'd like to say that not installing dependecies from packages is generally a bad idea. You can get all the required packages from ubuntu's repositories, put them on an usb key and redistribute (if you use one distro that is). The list of packages is relatively big, because of all the -dev ones (those are the development versions which enable to link against things etc.) but it should be doable. The "top" of the chain is gtk and gdk_pixbuf packages (not exact names). If you look at those in synaptic you will see what they depend on and can make a list to download (you don't need to go down to all, but most -dev ones surely). This isn't easy tho, Linux without net is.. well in all honesty, useless.

The easiest way to find out all the required packages for a given ubuntu distro is to install a clear installation, and then add the "top level" -dev packages (libgtk-dev and libgdk_pixbuf-dev) and see all the packages which get installed too. You can then get them from the dir in which synaptic downloads them to. A bit far fetched, but 100% ensured functionality :D (for same distro version)

All basic (that is, not using additional 3rd party components) lazarus projects should have same dependencies.

For cross-compiling, the resulting binary shouldn't need anything on windows to run, but to get it you need to first cross-compile the FPC RTL, FCL and then LCL for windows (32 I guess?). These steps are presented in Marco's document here: http://www.stack.nl/~marcov/buildfaq.pdf

NOTE: the buildfaq is a bit outdated and also uses "gmake" instead of make (because marco is BSD user, and GNU make is secondary there). For windows, as far as I know, you don't need external utilities since FPC 2.2.0, but I'm not expert at this...

The_Marlboro_Man

  • New Member
  • *
  • Posts: 33
RE: Lazarus Project gives problem on other machines.
« Reply #5 on: November 06, 2007, 09:45:45 pm »
Almindor, thanks a lot for the quick reply again!... I see, if I said that I wanted to install the dependencies from anything else than the packages I didn't mean it, I mean, I don't even know of another way of installing them!. My original plan was to get all the needed packages for class use and distribute them among our partners. As for the top of the chain, I'll keep that in mind. I think my partner said something about his installation of "gtk" was impossible to complete due to errores.

I think I will go the "clean installation" way: we have access to virtual machines in wich we can install Ubuntu and get the internet connection from the "parent" machine: I'll try to get the list for lazarus programs and also the list from Lazarus itself from there... Then I'll have to figure out the dependency tree by myself but I think I can do it :).

As for cross compiling, thanks for the link: we will get to it once we get Lazarus running without Synaptic ;). Still I agree with you, without a connection to the Internet there's not a lot of use for Ubuntu (actually for any computer nowadays...) but we'd like to demonstrate the possibility.

Thanks a lot Almindor, you're being very helpful there!.

Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2673
RE: Lazarus Project gives problem on other machines.
« Reply #6 on: November 07, 2007, 11:39:47 am »
don't know for ubunto, i'm a fc user, but for yum I can specify where the repositiory of downloaded files is located.
If you place this on a network share, and you do an update once (or you manually place the files there), updating on other computers will use the shared repository. So you can update without having a internet connection
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

The_Marlboro_Man

  • New Member
  • *
  • Posts: 33
RE: Lazarus Project gives problem on other machines.
« Reply #7 on: November 07, 2007, 07:45:02 pm »
Thanks Marc, our first thought was to share the dependency tree with our partners or place them somewhere where Synaptic could find them (wich would have resulted in learning more than just Object Pascal for our project) but we have finally convinced our teacher of the utmost need of an internet connection to get the program running so we will have it granted :).

I guess our next questions will be more about some weird bugs happening in my computer (basically, Lazarus just shuts up when I run certain applications, though it runs it perfectly on the next session) or about cross-compiling.

Again, thanks a lot for your help :).

Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2673
Re: RE: Lazarus Project gives problem on other machines.
« Reply #8 on: November 08, 2007, 11:11:49 am »
Quote from: "The_Marlboro_Man"

I guess our next questions will be more about some weird bugs happening in my computer (basically, Lazarus just shuts up when I run certain applications, though it runs it perfectly on the next session) or about cross-compiling.


Are you running lazarus on a machine with limited ram ? When running out of memory, linux may terminate some processes.
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

The_Marlboro_Man

  • New Member
  • *
  • Posts: 33
RE: Re: RE: Lazarus Project gives problem on other machines.
« Reply #9 on: November 13, 2007, 11:43:26 am »
Sorry for the Late reply Marc. Well, I don't thik I am running with limited ram: the machine has 1gb of Ram memory and is almost new... Ubuntu has never killed any process for me and I don't think I run too many processes at once as to force Ubuntu to shut anything down... I am still clueless on that.

Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2673
RE: Re: RE: Lazarus Project gives problem on other machines.
« Reply #10 on: November 13, 2007, 11:58:09 am »
1GB  should be enough :)
(when I started on lazarus my devel machine had only 96 MB and I had sometimes troubles in compiling Laz)

Anyway, does it always happen running the same app or is it random ?
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

The_Marlboro_Man

  • New Member
  • *
  • Posts: 33
RE: Re: RE: Lazarus Project gives problem on other machines.
« Reply #11 on: November 19, 2007, 09:27:08 pm »
Again, Sorry for the late reply!. I am having a bit of a rough time with time itself, if I am allowed the pun... 1 Gb should be, as you say, more than enough so the problem should be somewhere else. The computer is running Ubuntu 7.10 (with generic Kernel 2.6.22-14 and Gnome 2.20 1) and it has, as said, 1gb of Ram and a couple of processors (2.80ghz). I have like 40gb worth of hard disk space left on this partition.

As for the happenings of it, I though it did only happen with a single application but to be honest I didn't try that hard to check it... A couple of days after I posted my last message everything started working again and today, when I started another small project I am having the same problem: hitting F9 or the "Run" key results in Lazarus just shutting down. It still produces valid "executable" files, so to say, wich it didn't before. Perhaps something is horribly wrong with my installation or my Free Pascal sources?.

I am marking this thread as "followed" so I am notified of any replies. I'll try to be faster next time. Again, thanks a lot Marc :).

Edit: Just wanted to add some information:
-The last I get to see in the Lazarus title window is "Debugging", then it dissapears.
-I noticed it also happens randomly when moving windows.
-Did I say it generates good executables?. I was wrong. I have one here that won't run but does run after a recompile (????).

Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2673
RE: Re: RE: Lazarus Project gives problem on other machines.
« Reply #12 on: November 20, 2007, 12:00:58 pm »
if you install a binary version of lazarus then the sources are not the problem.
Are you running 32 or 64 bit lazarus ?
and in the debugger options, did you specify a debugger ?
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

The_Marlboro_Man

  • New Member
  • *
  • Posts: 33
Lazarus Project gives problem on other machines.
« Reply #13 on: November 20, 2007, 12:39:21 pm »
Actually I just learned that my computer has a couple of 64 processors... I am running the 32 bit version of Ubuntu and, of course, the 32 bit version of Lazarus... Should I install the 64 bit version of Lazarus over a 32 bit Ubuntu installation or should I update the whole system (reinstall Ubuntu and then reinstall Lazarus)??. I don´t know, maybe that has something to do with the problem :).

As for the debugger, I am not home right now but will look at it later. As always, thanks :).

Edit: I did my checkings and made sure that no debugger was selected: the F9 button should just compile and run the program, right?. As of today it still resets itself.

Regarding the 64 bit thing... My processor are Pentium D ones, 64 bits, but the Ubuntu 64 version is made for AMD processors so there's no chance I'm installing it... Should I install a Lazarus 64 over an Ubuntu 32 system?, I made my installation from Synaptics but I could download the package and try to figure out the installation process (as you can imagine, I don't know a lot about Linux...).

piper62

  • New Member
  • *
  • Posts: 41
Lazarus Project gives problem on other machines.
« Reply #14 on: November 21, 2007, 02:29:44 am »
Hi, I wouldn't take the 64 Bit specific version. Some components, like ZeosLib, which you might be find useful have a problem with that.

I strongly recommend to test that before you go for 64 bit.

Regarding sharing Lazarus and/or programs for a classroom environment: Did you think about a terminalserver installation? I do that with my students at my university and this simplifies the processes a lot.
We use in my lab freeNX (server) and the standard NX-clients from www.nomachine.com for this purpose.

Regards,
Tibor

 

TinyPortal © 2005-2018