Recent

Author Topic: "Synchronizing" Lazarus installation across multiple computers/Windows versions  (Read 30961 times)

ARYLIOA

  • New Member
  • *
  • Posts: 23
I am new to Lazarus.  I have a great deal of Delphi code which I am in the process of converting.  Currently I am targeting only Windows but the whole idea is to eventually port everything to Linux as well.  I run three computers with three versions of Windows (2 are purely XP, the other is a dual-boot configuration of Vista and Windows 7).  My source is on a network drive so in theory I can compile from any of the computers and from any OS I happen to be running at the time.

Is there an easy way to make sure each Lazarus installation is identical to the others?  For instance if I install a package in the IDE on one, or change the environment, I would like to make sure it is in all the others without having to do each manually.

Can I copy a particular directory/sub-directory tree, maybe just certain files, or is it even possible there is an application to do cross-computer/cross-OS synchronization?

Thanks.

(I searched for 'synchronize' but, unless I am badly mistaken, the only hits I find don't seem to address what I am asking about here.)

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
You can copy the Lazarus directory and subdirectories, but also the primary config path directory (see wiki, something like c:\documents and settings\<username>\local appdata\lazarus IIRC)
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

IPguy

  • Sr. Member
  • ****
  • Posts: 385
Assuming the network drive is mounted as the same drive letter on all windows systems, you might try installing Laz on the network drive and running it from there.

mas steindorff

  • Hero Member
  • *****
  • Posts: 532
i use the 32 bit release candidates on WinXP and Win7 without any (pascal) problems. I also have a mutant/older pre release copy of one of the 64 bit IDE on win7 that makes me work in the IDE but complies the same code in the end.  I need to download the release rev of the 64 bit but it not high on my list at this time. 
I think if you are staying with windows, then you will not have any real issues working with the same source code even at the driver access level.

I was able to modify one of my projects to fix a windows registry bug I found in the 2.4.4 code in a way so that I did not need to recompile Lazarus on all of the machines it was installed on. 

http://www.lazarus.freepascal.org/index.php/topic,16786.msg92187.html#msg92187
windows 10 &11, Ubuntu 21+ - fpc 3.0.4, IDE 2.0 general releases

ARYLIOA

  • New Member
  • *
  • Posts: 23
.........
I think if you are staying with windows, then you will not have any real issues working with the same source code even at the driver access level........
I was not so concerned with the source or even the executables produced, but perhaps saving the time of making changes to Lazarus itself on each machine, some of which I would be sure to forget, and then wind up scratching my head about what would cause things to be causing errors at compile or link time.

IPguy:  I do use the same drive designation on all systems.  That still might leave the application data that BigChimp mentioned as a potential problem.  I will give it a try on a couple of the machines and see what happens.

Thanks for the replies.  I'll report back if the network drive idea works.

Status as of 1540:

Here's how it stands.  I installed on two computers with the network drive as the target for the installation.  Everything worked fine and Lazarus ran on each.

Then things went south.  I installed the RichMemo package on the second computer.  It worked fine on that computer but on the other computer I got the message The package "richmemopackage" is installed, but no valid package file (.lpk) was found.  A broken dummy package was created. as Lazarus loaded.

I thought maybe I would find something in the environment settings.  Looking at those there was good news/bad news.  They were identical in referencing the network drive, but identical even to the point that the path for test projects on both pointed to the computer where the 2nd installation was done.  That can probably be fixed, but would be a manual job.

Then I started a search starting at My Computer, on the computer where RichMemo was installed to try to find where the richmemopackage.lpk that Lazarus is looking for might live. That traverses the network drive as well, of course.  I found two copies.  Where it was downloaded in the zip file, and the unzipped file.  But so far I haven't found another, nor where and how Lazarus is looking for a link to the file when it tries to load.

I am tempted to copy the files from the 2nd machines Local Settings/Application Data/lazarus directory, but have no idea which one(s) might fix the problem or which one(s) might blow the whole thing out of the water.

Any ideas where Lazarus looks for links to the installed package files would be helpful.
« Last Edit: May 07, 2012, 10:59:59 pm by ARYLIOA »

IPguy

  • Sr. Member
  • ****
  • Posts: 385
I have a USB stick titled "Lazarus Portable" that I received when I purchased the Lazarus book.  I have not attempted to use it, but the title suggests it should be possible to run Laz from a common network drive location.  Unfortunately, I do not have a network drive to test with.

Here are some references from the forum on getting Lazarus to work "portably" (sp?) ...
http://www.lazarus.freepascal.org/index.php/topic,6347.0.html
http://www.lazarus.freepascal.org/index.php/topic,9171.msg44816.html#msg44816
http://www.lazarus.freepascal.org/index.php/topic,13627.msg79381.html#msg79381


picstart

  • Full Member
  • ***
  • Posts: 236
Well the compiled code assuming you get that far is reasonably contained as far as dependencies go. The IDE is another matter it seems like a black art. The adventurous escape from a single lazarus directory into users\Local Settings\Application Data/lazarus directory etc  is so unpleasant it almost always needs to be deleted if any update to the IDE is happening along with a clean build. Now the packages appear to have dependencies on were they were when they are first installed. I don't get this since the IDE has to be compiled to absorb them. Projects have similar dependencies but it is mostly confined to the folder the project is developed in. There is an export to another project folder that helps with this. If Lazarus' IDE wasn't so adventurous it might have been contained within a single folder which could be copied to other systems using the same OS and file system. A single folder ( with subfolders)  would make the IDE more like the exe and free the user from frustration.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11382
  • FPC developer.
I have a USB stick titled "Lazarus Portable" that I received when I purchased the Lazarus book.  I have not attempted to use it, but the title suggests it should be possible to run Laz from a common network drive location.  Unfortunately, I do not have a network drive to test with.

Afaik that one has some form of protection, and the starter program is binary only. It might have based on code from me to modify the Lazarus XML (see the last post of the first URL, the "fixxml" stuff).

In 0.9.30+ there is a lazarusdir option, and basically you simply set the lazarus config dir to $LAZARUSDIR/config, copy the profile there, and then start using startlazarus -lazarusdir=%driveletter%\lazarus

(or force that using --pcp=)

In theory this means you only need to

Install lazarus somewhere (say n:\lazarus).

Copy the profile to n:\lazarus\config

Get the batchfile from http://bugs.freepascal.org/view.php?id=15741 and check/update it a bit for current releases. (check FPC version and dir, root dir, name of the config dir)

And you have a version that you can copy around as long as you keep the base directory the same. If you want to change the base directory, one only should have
to edit the relative path (LAZARUSDIR) in the batchfile

I never tested it with .30 though :-) I did this back then for a project that ended before .30 came out, so I stuck with the XML rewriting trick.

Some loose ends:
- I don't know if the fpmkcfg in the batchfile is still necessary
- lazarus is started via lazarus.exe, not via startlazarus.
 

ARYLIOA

  • New Member
  • *
  • Posts: 23
………. The IDE is another matter it seems like a black art. The adventurous escape from a single lazarus directory into users\Local Settings\Application Data/lazarus directory etc  is so unpleasant it almost always needs to be deleted if any update to the IDE is happening along with a clean build. ………..

I know the feeling and I am beginning to feel inadequate to the job of making all four systems play together even if it were possible.  I have decided to do it the old fashioned way: write a procedure that works and follow it on each individual installation and update.

As I detailed in post#4 above I installed on one of the XP machines then the Windows 7 side of my dual-boot machine.  I used the network drive as the installation target on both.  Lazarus was already installed on the Vista side of the dual boot machine, installed in the C: partition.  As I said, the XP and Windows 7 machines each ran fine from the network drive until I tried to install RichMemo.  In addition to the things I listed there, I found four files in my User area that contained references to the RichMemo package.  I stopped the whole idea of all the computers sharing the install on the network drive right then.  It looked more complicated than was worth the trouble and I am anxious to get back to my Delphi conversions.

I uninstalled Lazarus on the XP machine and on the Windows 7 OS.  When I tried to reinstall to the respective local drives I got a make.exe[2]***[lazarus.exe]Error 1 error when I tried to install RichMemo.  No matter what I tried, I couldn't get around it.  I even uninstalled, deleted every file referencing Lazurus and even deleted every reference in the Registry.  That worked on the XP machine and I was able to get a stable IDE with RichMemo installed.  But nothing has worked so far on the Windows 7 OS.  Even the IDE without any changes will not recompile and ends with the make error.

As I said, I am new to Lazarus but it has me stumped.  In desperation, I restored the Windows 7 system with a full-image restoration of the partition which I had made on May 1 before trying any of this.  When I reinstall Lazarus to what I thought was as "scratch" OS I still get the ue]make error.  It appears that something that lives outside the Windows 7 (G:) partition may be involved.

One strange thing, which may be a lead, is that on the Windows 7 installation, the environment starts out with the FPC Source Directory and the Make Path both blank as if the installer doesn't know everything it needs to know.  I have copied the Compiler Path to the Make Path and changed fpc.exe to make.exe.  I used $(LazarusDir)fpc\$(FPCVer)\source\ for the FPC Source Directory since all three other installations have that.  But still no joy on getting the thing to build.  Any idea why those were not filled in at installation?  Are those the right entries?  Could the thing that caused them to be blank be causing the make errors?

Anyway, I have three working copies, 2 XP and one Vista.  All were installed step-by-step independently.  And to tell the truth, I dislike Windows 7 more than I dislike even Vista, so it is not a heart-breaker, but I hate to have a piece of software get the better of me.
« Last Edit: May 09, 2012, 05:13:39 am by ARYLIOA »

ARYLIOA

  • New Member
  • *
  • Posts: 23
Latest failure: (edited for clarity, pushed wrong button earlier)

I found this on http://wiki.freepascal.org/Lazarus_Faq#How_do_I_compile_Lazarus.3F

How do I compile Lazarus? Do something like this:

$ cd lazarus
$ make clean all


Interestingly, the make output was headed by "MAKE Version 5.1 Copyright <c> 1987, 1998 Borland International"

The first error is:
    "Error makefile 12: Colon expected"
There are others of that type scattered in the output.

Then there are hundreds of messages reading:
   "Error makefile 3672: Command syntax error" where 3672 is where it finally gave up.

That was followed by:
    "***1907 errors during make ***".

Should this have worked?  Should I have tried some other command?  Could this be what the real problem is, especially in light of the way I have the environment set?

Thanks for any solution you might offer.
« Last Edit: May 09, 2012, 04:07:15 pm by ARYLIOA »

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4459
  • I like bugs.
Interestingly, the make output was headed by "MAKE Version 5.1 Copyright <c> 1987, 1998 Borland International"

You may have installed or updated Delphi after installing FPC.
Delphi comes with "make" which is incompatible with FPC's "make".
In any case you can delete or rename the Delphi's "make". Very likely you will not need it.


Quote
... Could this be what the real problem is, ...

Yes, I have got the same problem after installing and updating Delphi.

Regards,
Juha
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

ARYLIOA

  • New Member
  • *
  • Posts: 23
Interestingly, the make output was headed by "MAKE Version 5.1 Copyright <c> 1987, 1998 Borland International"

You may have installed or updated Delphi after installing FPC.
Delphi comes with "make" which is incompatible with FPC's "make".
In any case you can delete or rename the Delphi's "make". Very likely you will not need it.

Quote
... Could this be what the real problem is, ...

Yes, I have got the same problem after installing and updating Delphi.

Regards,
Juha

Ah.  Thanks for the reply.  Apparently the default make command is the Borland version 5.1.  I suppose Delphi installed it way-back-when.

There is one in the \Lazarus.......\i386-win32\ directory.  It is identified as GNU Make 3.80.  But searching for the proper makefile yields literally dozens of makefiles under the top-level (G:Lazarus) directory and it's sub-directories.  I have no idea which to use as the target for the make command to build the entire system.

Whatever the problem, the makekfiles MakeFile and MakeFile.fpc in G:\Lazarus are dated 06/27/2011 and are the ones loaded by the Lazarus installation.  They match the files on the other computers' Lazurus top-level directories.

Assuming the Makefile in G:\Lazarus was the proper one, I tried the using the GNU Make 3.80 command with it.  It fails after apparently doing all the required compiles with the messages:
  "Linking ..\lazbuild.exe"
  "1278 lines compiled, 6.5 sec , 3747584 bytes code, 2331004 bytes data"
  "make[2]: Leaving directory G:/lazarus/ide"
  "make[1]: Leaving directory G:/lazarus/ide"

There's gotta be a way......
« Last Edit: May 09, 2012, 07:45:18 pm by ARYLIOA »

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4459
  • I like bugs.
Ah.  Thanks for the reply.  Apparently the default make command is the Borland version 5.1.  I suppose Delphi installed it way-back-when.

There is really no default make command. The cmd shell searches from PATH and uses the first one it finds.

Quote
There is one in the \Lazarus.......\i386-win32\ directory.  It is identified as GNU Make 3.80.  But searching for the proper makefile yields literally dozens of makefiles under the top-level (G:Lazarus) directory and it's sub-directories.  I have no idea which to use as the target for the make command to build the entire system.

Don't count the makefiles. Just go to Lazarus root dir, G:\Lazarus in your case, and run "make clean all".

Quote
Whatever the problem, the makekfiles MakeFile and MakeFile.fpc in G:\Lazarus are dated 06/27/2011 and are the ones loaded by the Lazarus installation.  They match the files on the other computers' Lazurus top-level directories.

Assuming the Makefile in G:\Lazarus was the proper one, I tried the using the GNU Make 3.80 command with it.  It fails after apparently doing all the required compiles with the messages:
  "Linking ..\lazbuild.exe"
  "1278 lines compiled, 6.5 sec , 3747584 bytes code, 2331004 bytes data"
  "make[2]: Leaving directory G:/lazarus/ide"
  "make[1]: Leaving directory G:/lazarus/ide"

How does it fail? I don't see any error messages there.

Juha
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

ARYLIOA

  • New Member
  • *
  • Posts: 23
I assumed perhaps installed as default since that is the one that ran from the g:\lazarus directory.  I also assumed the make.exe[2] and make.exe[1] were error messages since that is what I was seeing when Tools > Build Lazarus with Profile: Build IDE with Packages fails.  Obviously too many assumptions based on inexperience.

If I run the "make clean all" from the g:\Lazarus directory it picks up the Borland make and fails as indicated earlier with hundreds of errors.  I do wonder how that version is found before the one in the actual Lazarus directory tree.  The search must begin at the root directory somehow.  I think perhaps that is what the build in the IDE may be doing.  I think I am going to hunt down the Borland make and defeat it.  Then perhaps the IDE will  build properly.

Thanks for the pointers.  I am a long retired, long time DOS/Windows user and was a professional software developer in the aerospace industry on many OSs but never had any exposure to Unix in the 32 years I did that.  My goal is to add that to my "resume".  Times may get rough..... :D

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Borland make is probably in your path, that's why it's picked up first. You can also remove the directory where Borland make is in from your path (right click my computer, advanced, environment, paths and system variables or something... also slightly different in each windows version)
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

 

TinyPortal © 2005-2018