Recent

Author Topic: Output File Size ?  (Read 12284 times)

nhatdung

  • New Member
  • *
  • Posts: 34
Output File Size ?
« on: April 05, 2011, 08:26:32 pm »
Finally i port my app to OSX and it work perfect!
However the size is too big! the output are two file
One is
Project1 ~14mb
Project1.app ~12kb
(on linux my file size ~3mb, and ~1mb when upx)
My question is :
+ How to reduce file size ?
+ What file i will give to people ?

« Last Edit: April 05, 2011, 08:45:42 pm by nhatdung »


eny

  • Hero Member
  • *****
  • Posts: 1609
Re: Output File Size ?
« Reply #2 on: April 05, 2011, 09:07:35 pm »
All posts based on: Win10 (Win64); Lazarus 2.0.10 'stable' (x64) unless specified otherwise...

nhatdung

  • New Member
  • *
  • Posts: 34
Re: Output File Size ?
« Reply #3 on: April 05, 2011, 10:46:55 pm »
okie, got it

Jonas Maebe

  • Hero Member
  • *****
  • Posts: 756
Re: Output File Size ?
« Reply #4 on: April 09, 2011, 08:33:05 pm »
Finally i port my app to OSX and it work perfect!
However the size is too big! the output are two file
One is
Project1 ~14mb
Project1.app ~12kb
(on linux my file size ~3mb, and ~1mb when upx)
My question is :
+ How to reduce file size ?
+ What file i will give to people ?

Regarding what file to give other people: delete the file (which is a symbolic link) with the name of your application in Project1.app/Contents/MacOS, replace it with the big Project1 file, and give the people the Project1.app bundle (zipped or not).

I don't know why Lazarus pulls tricks with the symbolic link like it does. I've never seen any other tool do that.

Phil

  • Hero Member
  • *****
  • Posts: 2750
Re: Output File Size ?
« Reply #5 on: April 09, 2011, 08:37:43 pm »
I don't know why Lazarus pulls tricks with the symbolic link like it does. I've never seen any other tool do that.

Probably so it doesn't confuse Linux and Windows developers who are expecting to find the executable in the usual place?

Thanks.

-Phil

Jonas Maebe

  • Hero Member
  • *****
  • Posts: 756
Re: Output File Size ?
« Reply #6 on: April 09, 2011, 08:47:03 pm »
I don't know why Lazarus pulls tricks with the symbolic link like it does. I've never seen any other tool do that.

Probably so it doesn't confuse Linux and Windows developers who are expecting to find the executable in the usual place?

It obviously does confuse them when comes to distributing the application though, and distributing a virtually empty and non-functional app-bundle seems more obstructive than someone simply wondering where the binary is located.

Phil

  • Hero Member
  • *****
  • Posts: 2750
Re: Output File Size ?
« Reply #7 on: April 09, 2011, 08:54:48 pm »
Lazarus should probably be changed to create the executable inside the app bundle. Maybe nhatdung can submit a bug report to Lazarus mantis at left.

Back when Lazarus first introduced the app bundle, there were very, very few Mac users of Lazarus.

Thanks.

-Phil

Dibo

  • Hero Member
  • *****
  • Posts: 1048
Re: Output File Size ?
« Reply #8 on: April 09, 2011, 09:16:46 pm »
Or option "use external gdb debug symbols file (-Xg)" should be default checked. I never use it but tried once and I saw that it generate debug symbols in another file so executable is stripped. I saw in many forums/blogs/articles that lazarus is ugly because it generate ~20MB executable. First impressions count and many programmers are disappointed when see this size and leave lazarus without checking compiler options. This is negative marketing for lazarus. But I did not test if I can debug with -Xg option.
« Last Edit: April 09, 2011, 09:18:20 pm by Dibo »

Jonas Maebe

  • Hero Member
  • *****
  • Posts: 756
Re: Output File Size ?
« Reply #9 on: April 09, 2011, 09:27:23 pm »
Or option "use external gdb debug symbols file (-Xg)" should be default checked.

On Mac OS X, that will never change anything to the size of the program (other than a few bytes): with Stabs because the system tools don't support it (debug information is always in the program), and with DWARF because there the system tools never put any debug information in the final binary anyway. On Mac OS X, the only use of -Xg is with DWARF to create a single file containing all debug information for a particular program binary (since otherwise if you recompile a unit, the debug information for the version of the unit used in a previous compilation is lost).

nhatdung

  • New Member
  • *
  • Posts: 34
Re: Output File Size ?
« Reply #10 on: April 10, 2011, 08:31:56 am »
i use strip command and get the size small, thanks for the tip. i'll put the big file to the .app folder
btw: it will be best if Larazus have a option/menu/command build for release mode like Visual Studio does  ::)

fabienwang

  • Sr. Member
  • ****
  • Posts: 449
  • Lazarus is the best
    • My blog
Re: Output File Size ?
« Reply #11 on: April 10, 2011, 10:39:16 am »
nhatdung, Lazarus has such options,
it's in Project options, Build modes.
Once you create multiple build mode you'll have a combobox to Select your mode and Build the project near the Run Button.

Please read my post here to configure such build modes:
http://lazarus.freepascal.org/index.php/topic,10502.msg64404.html#msg64404
« Last Edit: April 10, 2011, 10:47:51 am by FabienWang »
I'm using Arch Linux.
Known for: CPickSniff, OpenGrabby
Contributed to: LazPaint

 

TinyPortal © 2005-2018