Lazarus

Free Pascal => General => Topic started by: GypsyPrince on April 10, 2020, 12:53:34 am

Title: [SOLVED] Is the mingw folder necessary?
Post by: GypsyPrince on April 10, 2020, 12:53:34 am
Are the 'mingw' subfolder (C:\Lazarus\mingw) and its enclosed files necessary for the proper functioning of either Free Pascal or Lazarus?
 
The reason I ask is... I have 8 different development environments which installed and use their own copy of the mingw compiler.  I want to map the ones that I can to one central copy of the compiler, then delete all the ones I don't need to free up hard drive space.  The only one I don't think I can successfully remap is Qt, but none others seem to have added their own custom libraries to the installation.

So, can the 'mingw' subfolder be safely deleted?
a. If so, what other subfolders can I safely delete from the Lazarus directory?
b. If the 'mingw' compiler is required and can't be deleted, can I remap Lazarus to a centralized copy?

I wish if all these programs are going to utilize mingw that they would either ask you or search for an existing copy on your hard drive instead of numerous copies of the same compiler being installed. All that wasted space is just annoying...
Title: Re: Is the mingw folder necessary?
Post by: mercurhyo on April 10, 2020, 01:47:58 am
May God bless us from noobs  :P :D 8-)
Title: Re: Is the mingw folder necessary?
Post by: mercurhyo on April 10, 2020, 01:51:39 am
Okay

1) FP text IDE is ALWAYS shipped with Free Pascal Compiler, and has nothing to do with releases of Lazarus, to answer your question on another topic (future laz release 2.0.8 )

2) mingw Compilers have NOTHING TO DO with freepascal compiler (except some minimal binutils tools which are.. make tool and very optionaly ld linker tool)
Title: Re: Is the mingw folder necessary?
Post by: Martin_fr on April 10, 2020, 04:36:56 am
The mingw folder contains a copy of gdb.
If you have gdb in any other place, you can configure the IDE to use that other gdb. (Tools > Option > Debugger)

There is also a copy of LazGDeBugControl.exe. This is only necessary when debugging cross-bitness. (I.e. 64bit vs 32bit)
If you do cross bitness, and use another gdb, copy this file into the folder where gdb.exe is.

Alternatively you can setup the IDE to use the beta LazDebuggerFp. (search for fpdebug on forum/wiki)

Quote
I wish if all these programs are going to utilize mingw that they would either ask you or search for an existing copy on your hard drive instead of numerous copies of the same compiler being installed.
There is no compiler in that folder.
Only gdb.




At least on Windows:
There are a few mingw tools in the fpc folder. (eg make  and ld)
And I advice to keep them.

Fpc may work with other versions, but it could also fail.
No one will be able to solve any strange errors that you get by having another toolchain in your PATH.

And again its not the entire mingw. Only selected files, that take not very much space.

There is a copy of gcc. That is only required for compiling resources (which I think includes lfm files). Its required by windres.exe.
But again it probably needs to be kept.

But well you can try to include them from elsewhere. Until eventually you get mysterious errors. Or if you are lucky it may work....
Title: Re: Is the mingw folder necessary?
Post by: Martin_fr on April 10, 2020, 04:41:11 am
a. If so, what other subfolders can I safely delete from the Lazarus directory?

examples folder?

maybe the tools and install folder (not sure, but at least some of its subfolders)

docs depends on if you need it.

Not sure, but probably images too.

Title: Re: Is the mingw folder necessary?
Post by: GypsyPrince on April 10, 2020, 05:44:49 am
@Martin_fr

Quote
There is no compiler in that folder.
Only gdb.

Well, darn. I feel really stupid now. LOL

I guess I should have thoroughly searched in there before asking the question.  The folder popped up in my search, so I (incorrectly) assumed it was the full compiler program like all the others.
Title: Re: Is the mingw folder necessary?
Post by: GypsyPrince on April 10, 2020, 05:55:32 am
@mercurhyo

Quote
1) FP text IDE is ALWAYS shipped with Free Pascal Compiler, and has nothing to do with releases of Lazarus, to answer your question on another topic (future laz release 2.0.8 )

I understand this. However, since Lazarus does come with a copy of the Free Pascal compiler, I'm just thinking it would be nice to toss in the fp IDE as well, to keep from having to install a separate full copy of fp in order to gain the IDE.
Title: Re: Is the mingw folder necessary?
Post by: PascalDragon on April 10, 2020, 10:34:13 am
1) FP text IDE is ALWAYS shipped with Free Pascal Compiler, and has nothing to do with releases of Lazarus, to answer your question on another topic (future laz release 2.0.8 )

However the textmode IDE is not shipped with the Free Pascal distrubution that's also provided with the Lazarus Windows installer (which makes sense in my opinion).
Title: Re: Is the mingw folder necessary?
Post by: Martin_fr on April 10, 2020, 02:07:07 pm
1) FP text IDE is ALWAYS shipped with Free Pascal Compiler, and has nothing to do with releases of Lazarus, to answer your question on another topic (future laz release 2.0.8 )
It is not going to happen for 2.0.8.
For some reason the fpc make file does not build it the fp.exe. This is not intended, not sure why it is (possible missing gdb object file)

I did check the current test builds with the upcoming 3.2 branch. (I only checked 64bit build)
They seem to build it. If nothing changes in fpc, then it looks like Lazarus 2.2 (no date yet) will contain the fp.exe. (I have not tested if it works....)

The 3.2 based installer can be found here https://sourceforge.net/projects/lazarus-snapshots/files/
(ensure it has 3.2 in the name / they are test versions, the may net be stable)


I do not know which part of the build process changed. So no idea if that persists.

If anyone wants to investigate themself (too late for 2.0.8 though, and maybe/hopefully not needed for 3.2), I can point out the build process, so anyone can test.
Title: Re: Is the mingw folder necessary?
Post by: marcov on April 10, 2020, 02:09:17 pm
1) FP text IDE is ALWAYS shipped with Free Pascal Compiler, and has nothing to do with releases of Lazarus, to answer your question on another topic (future laz release 2.0.8 )
It is not going to happen for 2.0.8.
For some reason the fpc make file does not build it the fp.exe. This is not intended, not sure why it is (possible missing gdb object file)

Just "make all" at the toplevel FPC builds the IDE.  You need to pass IDE=0 to skip it.

The makefiles check for the existence of the libgdb files to see if it needs to build with GDB or not, but the IDE should be built any way.
Title: Re: Is the mingw folder necessary?
Post by: Martin_fr on April 10, 2020, 02:29:23 pm
Well, I use the same script for the builds.
Yet, the old installers misses the file, the 3.2 seem to have it.

However the build scripts (in the folder tools/install/win do individual make calls for different parts of fpc.
I have no idea why. They were written long ago.

Title: Re: Is the mingw folder necessary?
Post by: marcov on April 10, 2020, 05:12:38 pm
Well, I use the same script for the builds.
Yet, the old installers misses the file, the 3.2 seem to have it.

That's because 3.2 moves the IDE from ide/ to packages/ide so that it is build intbetween.

Quote
However the build scripts (in the folder tools/install/win do individual make calls for different parts of fpc.
I have no idea why. They were written long ago.

Building times, last byte savings, and probably all outdated. Wouldn't be surprised if this is even FPC 1.x legacy.....

Best clean it out. The extra size will be very small compared to the current FPC/Lazarus combined installation
Title: Re: Is the mingw folder necessary?
Post by: GypsyPrince on April 10, 2020, 08:43:19 pm
LOL
 
I guess I should have said earlier that if it would be a lot of trouble to include the fp IDE with Lazarus, then don't worry about it.  As far as I know, I may be the only person who has inquired about it, so it is definitely not worth the effort to satisfy my whim.
Title: Re: Is the mingw folder necessary?
Post by: marcov on April 10, 2020, 10:58:13 pm
LOL
 
I guess I should have said earlier that if it would be a lot of trouble to include the fp IDE with Lazarus, then don't worry about it.  As far as I know, I may be the only person who has inquired about it, so it is definitely not worth the effort to satisfy my whim.

I think it is best to simply be orthogonal, and distribute roughly the same FPC standalone as with Lazarus. The difference might have seemed large in the distance past, but aren't anymore. A FPC 3.2.0rc1 install is about 380MB of which only 2MB is the IDE.
Title: Re: Is the mingw folder necessary?
Post by: winni on April 10, 2020, 11:16:41 pm
Hardware:

2 TerraByte Harddisks (internal) are now below 60.- €

That is 3 Cent per Gigabyte.

Title: Re: Is the mingw folder necessary?
Post by: trev on April 10, 2020, 11:44:40 pm
1) FP text IDE is ALWAYS shipped with Free Pascal Compiler, and has nothing to do with releases of Lazarus, to answer your question on another topic (future laz release 2.0.8 )

The FP text mode IDE is most definitely NOT shipped with the macOS Free Pascal Compiler installer.
Title: Re: Is the mingw folder necessary?
Post by: GypsyPrince on April 11, 2020, 07:50:13 pm
Quote
Hardware:

2 TerraByte Harddisks (internal) are now below 60.- €

That is 3 Cent per Gigabyte.

While I consider you a friend, this attitude bothers me every time I see it expressed in forums and blog articles - which is quite often. LOL
 
It's much like the venture capitalist's philosophy: "Who cares about finite resources? Let's plunder the earth and destroy the environment. Continued human existence is less important than making money right now."
 
This particular mindset translates to computer speak like this: "Rather than streamline and optimize our code and techniques each time computers multiply in power so that we can capitalize on their speed and efficiency as was intended, we should instead, bog them down with bloat to where they are no longer any faster than the generation of systems that came before... simply because storage capacity is cheap."

Because I am used to working with embedded and secured military systems where storage space is at a premium, I'm used to taking the opposite approach of constant optimization and getting rid of unnecessary bloat.
 
Besides... my laptop is already maxed out with the largest HDD its BIOS will allow. This is the real reason. All the previous nonsense was just to keep in practice my skills at useless bloviating and ranting. LOL
Title: Re: Is the mingw folder necessary?
Post by: marcov on April 12, 2020, 10:11:41 am
It's much like the venture capitalist's philosophy: "Who cares about finite resources? Let's plunder the earth and destroy the environment. Continued human existence is less important than making money right now."

Human labour is a finite resource too. It translates to a living wage and all the upkeep that comes with that.

So then it is not absolute over the other, but a tradeoff to minimize resource usage.
Title: Re: [SOLVED] Is the mingw folder necessary?
Post by: Martin_fr on April 12, 2020, 12:47:40 pm
I have not tested this, but if you want to save space, it may be an idea to rebuild packages....

Afaik the pre-compiled packages (except for what is in the FPC folder) come with debug info. That eats into space. If you do not intend to debug into the LCL, you can rebuild this.
In all folders, EXCEPT any folder inside the FPC folder, remove all *.ppu and *.o files

Make sure debug info settings are off for each individual package.
Make sure Tools > Config build IDE  does not have any debug info (-gw -gs -g...) set

Next rebuild of your project will take a bit longer, as it recreates some of the deleted files.

There may be some files that are not recreated, if they are not needed by your project(s). So that would save space.
I guess (but really not tested) that the recreated files may be smaller.

Each time you install a package you rebuild the IDE, that leaves ppu for the IDE (and IDE only packages). So you need to clean out again.
It is full intend they are left behind.
It save cpu time for the next build. And with that it save energy and is better for the environment. (Well that depends how long you keep them till the next package install, and how big the impact on producing the extra storage is / assuming you can otherwise re-use the storage for other purposes....)

------------
No idea if or how much that will save...

Title: Re: [SOLVED] Is the mingw folder necessary?
Post by: GypsyPrince on April 13, 2020, 07:35:29 am
@Martin_fr

I wound up uninstalling a couple of old development tools I don't plan on using anymore.

Got plenty of room now.  I'll be buying myself a new laptop (with much larger SSD) as a gift to myself when I retire in June.
TinyPortal © 2005-2018