Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2013-02

FPC, Lazarus and 3rd libs

11 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Marcos Douglas

Hi,

I would like to know what the best way to work with FPC, Lazarus and 3rd libs. I will try explain myself:

Today I have three FPC versions (2.6.0, 2.6.3 and 2.8.1) and two Lazarus versions (1.0.1 and 1.1 (trunk))
The FPC trunk is only for test, so doesn't count.
Both Lazarus were compiled using FPC 2.6.3 and everything works. I have many 3rd libs (components) and they are compiled using FPC 2.6.3 too.

My "problem" is:
1- I want to have a stable Lazarus (1.0), compiled with FPC 2.6.2 and
stable Libs too (compiled with the same FPC version, ie. 2.6.2);
2- I want to have a Lazarus trunk, compiled with FPC 2.6.3 and Libs
too compiled compiled with the same FPC version;
3- I wont to change the libs package sources;

How can I have libs, compiled with different FPC version, but without change the output sources of libs and without have more than one copy of them?

Best regards,
Marcos Douglas

Reply by email

Mattias Gaertner
to Marcos Douglas
Show quoted text 21 lines
Hi, I would like to know what the best way to work with FPC, Lazarus and 3rd libs. I will try explain myself: Today I have three FPC versions (2.6.0, 2.6.3 and 2.8.1) and two Lazarus versions (1.0.1 and 1.1 (trunk)) The FPC trunk is only for test, so doesn't count. Both Lazarus were compiled using FPC 2.6.3 and everything works. I have many 3rd libs (components) and they are compiled using FPC 2.6.3 too. My "problem" is: 1- I want to have a stable Lazarus (1.0), compiled with FPC 2.6.2 and stable Libs too (compiled with the same FPC version, ie. 2.6.2); 2- I want to have a Lazarus trunk, compiled with FPC 2.6.3 and Libs too compiled compiled with the same FPC version; 3- I wont to change the libs package sources; How can I have libs, compiled with different FPC version, but without change the output sources of libs and without have more than one copy of them?

The second Lazarus must be started with another primary config path (command line parameter --pcp).
The second can use another compiler.
Compiling a project will automatically rebuild the packages.

You can change the output directory of the third party package to use the $(FPCVer) macro. For example
"lib/$(FPCVer)/$(TargetCPU)-$($TargetOS)".

Mattias

Reply by email

Marcos Douglas
to Mattias Gaertner
Mattias Gaertner wrote 27 lines
On Thu, 28 Feb 2013 14:27:37 -0300 Marcos Douglas wrote: > Hi, > > I would like to know what the best way to work with FPC, Lazarus and > 3rd libs. I will try explain myself: > > Today I have three FPC versions (2.6.0, 2.6.3 and 2.8.1) and two > Lazarus versions (1.0.1 and 1.1 (trunk)) > The FPC trunk is only for test, so doesn't count. > Both Lazarus were compiled using FPC 2.6.3 and everything works. > I have many 3rd libs (components) and they are compiled using FPC 2.6.3 too. > > My "problem" is: > 1- I want to have a stable Lazarus (1.0), compiled with FPC 2.6.2 and > stable Libs too (compiled with the same FPC version, ie. 2.6.2); > 2- I want to have a Lazarus trunk, compiled with FPC 2.6.3 and Libs > too compiled compiled with the same FPC version; > 3- I wont to change the libs package sources; > > How can I have libs, compiled with different FPC version, but without > change the output sources of libs and without have more than one copy > of them? The second Lazarus must be started with another primary config path (command line parameter --pcp).

I already use the --pcp parameter to pass different configurations (packages, environment, etc).

The second can use another compiler. Compiling a project will automatically rebuild the packages.

Yep. Well, I thought there was a way to not recompile the libs to compile more faster, but Ok.

You can change the output directory of the third party package to use the $(FPCVer) macro. For example "lib/$(FPCVer)/$(TargetCPU)-$($TargetOS)".

Yep, but for this I need to change lib's sources. I won't to not missing the updates, but thanks anyway.

Regards,
Marcos Douglas

Reply by email

Frank Church
to Marcos Douglas: I would like to know what the best way to work with FPC, Lazarus and 3rd libs. I will try…
Marcos Douglas wrote 25 lines
Hi, I would like to know what the best way to work with FPC, Lazarus and 3rd libs. I will try explain myself: Today I have three FPC versions (2.6.0, 2.6.3 and 2.8.1) and two Lazarus versions (1.0.1 and 1.1 (trunk)) The FPC trunk is only for test, so doesn't count. Both Lazarus were compiled using FPC 2.6.3 and everything works. I have many 3rd libs (components) and they are compiled using FPC 2.6.3 too. My "problem" is: 1- I want to have a stable Lazarus (1.0), compiled with FPC 2.6.2 and stable Libs too (compiled with the same FPC version, ie. 2.6.2); 2- I want to have a Lazarus trunk, compiled with FPC 2.6.3 and Libs too compiled compiled with the same FPC version; 3- I wont to change the libs package sources; How can I have libs, compiled with different FPC version, but without change the output sources of libs and without have more than one copy of them? Best regards, Marcos Douglas

For my own libraries and other third party libs this is what I use

$(ConfDir)/lib/{LibraryName}/lib/$(TargetCPU)-$(TargetOS). Because I use a different -pcp directory it works very well me.

Show quoted text 5 lines
-- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Frank Church ======================= http://devblog.brahmancreations.com

Reply by email

Marcos Douglas
to Frank Church
Frank Church wrote 31 lines
On 28 February 2013 17:27, Marcos Douglas wrote: > Hi, > > I would like to know what the best way to work with FPC, Lazarus and > 3rd libs. I will try explain myself: > > Today I have three FPC versions (2.6.0, 2.6.3 and 2.8.1) and two > Lazarus versions (1.0.1 and 1.1 (trunk)) > The FPC trunk is only for test, so doesn't count. > Both Lazarus were compiled using FPC 2.6.3 and everything works. > I have many 3rd libs (components) and they are compiled using FPC 2.6.3 too. > > My "problem" is: > 1- I want to have a stable Lazarus (1.0), compiled with FPC 2.6.2 and > stable Libs too (compiled with the same FPC version, ie. 2.6.2); > 2- I want to have a Lazarus trunk, compiled with FPC 2.6.3 and Libs > too compiled compiled with the same FPC version; > 3- I wont to change the libs package sources; > > How can I have libs, compiled with different FPC version, but without > change the output sources of libs and without have more than one copy > of them? > > Best regards, > Marcos Douglas > For my own libraries and other third party libs this is what I use $(ConfDir)/lib/{LibraryName}/lib/$(TargetCPU)-$(TargetOS). Because I use a different -pcp directory it works very well me.

Yes, but as I said, to do this you need to change the lib package (source) to set the output files.
I do not want change the original libs sources.

Marcos Douglas

Reply by email

Graeme Geldenhuys
to Marcos Douglas: On Thu, Feb 28, 2013 at 2:59 PM, Mattias Gaertner I already use the --pcp parameter to…
Marcos Douglas wrote 5 lines
> You can change the output directory of the third party package to use > > the $(FPCVer) macro. For example > > "lib/$(FPCVer)/$(TargetCPU)-$($TargetOS)". Yep, but for this I need to change lib's sources. I won't to not missing the updates, but thanks anyway.

I fail to understand what you mean by that? You simply need to change the Unit Output Directory in each *.lpk you use, and add the $(FPCVer) part to the path. No other "source code" needs to be changed.

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/

Reply by email

Graeme Geldenhuys
to Marcos Douglas: Yes, but as I said, to do this you need to change the lib package (source) to set the…
Marcos Douglas wrote
Yes, but as I said, to do this you need to change the lib package (source) to set the output files. I do not want change the original libs sources.

But why not? The *.lpk files hardly change. So if you get repository updates for those packages, there will not be any conflicts. Even if the *.lpk package changes (eg: new units was added), it should still not cause a conflict.

You have to change something, otherwise you will not be able to find a solution to your issue. The above is the bare minimum and least invasive change you can make.

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/

Reply by email

Frank Church
to Marcos Douglas: Yes, but as I said, to do this you need to change the lib package (source) to set the…
Marcos Douglas wrote 44 lines
On Thu, Feb 28, 2013 at 4:02 PM, Frank Church wrote: > On 28 February 2013 17:27, Marcos Douglas wrote: >> Hi, >> >> I would like to know what the best way to work with FPC, Lazarus and >> 3rd libs. I will try explain myself: >> >> Today I have three FPC versions (2.6.0, 2.6.3 and 2.8.1) and two >> Lazarus versions (1.0.1 and 1.1 (trunk)) >> The FPC trunk is only for test, so doesn't count. >> Both Lazarus were compiled using FPC 2.6.3 and everything works. >> I have many 3rd libs (components) and they are compiled using FPC 2.6.3 too. >> >> My "problem" is: >> 1- I want to have a stable Lazarus (1.0), compiled with FPC 2.6.2 and >> stable Libs too (compiled with the same FPC version, ie. 2.6.2); >> 2- I want to have a Lazarus trunk, compiled with FPC 2.6.3 and Libs >> too compiled compiled with the same FPC version; >> 3- I wont to change the libs package sources; >> >> How can I have libs, compiled with different FPC version, but without >> change the output sources of libs and without have more than one copy >> of them? >> >> Best regards, >> Marcos Douglas >> > > For my own libraries and other third party libs this is what I use > > $(ConfDir)/lib/{LibraryName}/lib/$(TargetCPU)-$(TargetOS). Because I > use a different -pcp directory it works very well me. Yes, but as I said, to do this you need to change the lib package (source) to set the output files. I do not want change the original libs sources. Marcos Douglas -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

I think the way I described should be made the default for all 3rd party libraries unless other more experienced developers think otherwise from their experience. Given the strictness of FPC with regards to compiler and build versions, I find it very useful and disk space is not so expensive now on general purpose computers.

Do you need to track some remote repositories that change often?

That is one reason for not wanting to use that method. I am sure Graeme can help you with some Git hook mojo when upstream changes :)

Frank Church ======================= http://devblog.brahmancreations.com

Reply by email

Marcos Douglas
to Graeme Geldenhuys: But why not? The *.lpk files hardly change. So if you get repository updates for those…
Graeme Geldenhuys wrote 11 lines
On 2013-02-28 18:31, Marcos Douglas wrote: >> You can change the output directory of the third party package to use >> > the $(FPCVer) macro. For example >> > "lib/$(FPCVer)/$(TargetCPU)-$($TargetOS)". > Yep, but for this I need to change lib's sources. I won't to not > missing the updates, but thanks anyway. I fail to understand what you mean by that? You simply need to change the Unit Output Directory in each *.lpk you use, and add the $(FPCVer) part to the path. No other "source code" needs to be changed.

I know. When I said source I mean *.lpk - it is a source too, not?

Graeme Geldenhuys wrote 10 lines
On 2013-02-28 19:08, Marcos Douglas wrote: > > Yes, but as I said, to do this you need to change the lib package > (source) to set the output files. > I do not want change the original libs sources. But why not? The *.lpk files hardly change. So if you get repository updates for those packages, there will not be any conflicts. Even if the *.lpk package changes (eg: new units was added), it should still not cause a conflict.

You probably right, but problems can happen -- little problems -- like a file deleted, file renamed, etc. So I'll have to change the lpk anyway, manually.

You have to change something, otherwise you will not be able to find a solution to your issue. The above is the bare minimum and least invasive change you can make.

In that case I will prefer the Mattias' tip "Compiling a project will automatically rebuild the packages." so, I can use the original *.lpk and one output directory for each package, but if I compile them using other FPC version, they will automatically rebuild.

Regards,
Marcos Douglas

Reply by email

Graeme Geldenhuys
to Marcos Douglas
Marcos Douglas wrote
You probably right, but problems can happen -- little problems -- like a file deleted, file renamed, etc. So I'll have to change the lpk anyway, manually.

You should still not get any conflicts in the *.lpk files even if files was added, renamed or deleted. The only time you will get a conflict (and changes are very slim) is if upstream they changed the Unit Output Directory - something that pretty much never happens after it was set. They are different areas of the xml file (*.lpk file), so will not conflict.

Conflicts only occur if the same lines of code has changed locally and upstream.

Anyway, it's your choice.

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/

Reply by email

Marcos Douglas
to Graeme Geldenhuys
Graeme Geldenhuys wrote 17 lines
On 2013-03-01 14:09, Marcos Douglas wrote: > > You probably right, but problems can happen -- little problems -- like > a file deleted, file renamed, etc. So I'll have to change the lpk > anyway, manually. You should still not get any conflicts in the *.lpk files even if files was added, renamed or deleted. The only time you will get a conflict (and changes are very slim) is if upstream they changed the Unit Output Directory - something that pretty much never happens after it was set. They are different areas of the xml file (*.lpk file), so will not conflict. Conflicts only occur if the same lines of code has changed locally and upstream. Anyway, it's your choice.

Thanks for the good explanation. Well, I can change my choices... ;-)

Regards,
Marcos Douglas

Reply by email