Recent

Author Topic: why built app file size so big on osx? and is it possible to merge to one file?  (Read 6904 times)

teriyaki

  • New Member
  • *
  • Posts: 47
for win, I can adjust 'link option' to minimize the size of execute file.
but for osx, even I adjust link option, it looks like no use. Built file is still huge.

there are 2 files: one is .app, one is unix execute file.
Is it possible to merge to one execute file?
and how to minimize the file size?

Your comment welcome
« Last Edit: April 19, 2014, 07:17:55 am by teriyaki »

zeljko

  • Hero Member
  • *****
  • Posts: 1594
    • http://wiki.lazarus.freepascal.org/User:Zeljan
I've found that strip isn't executed on macosx for some reason.
So just execute strip yourbinary from terminal.

teriyaki

  • New Member
  • *
  • Posts: 47
 

if I unchecked 'Generate debuging info for GDB'
the file(project1 unix execute) size changes from 22.7M to 22.5M
but on win, it changes form 15.5M to 2M


Is there a way to minimize the size of .app file on osx?
« Last Edit: April 19, 2014, 12:15:26 pm by teriyaki »

Leledumbo

  • Hero Member
  • *****
  • Posts: 8746
  • Programming + Glam Metal + Tae Kwon Do = Me
Quote
there are 2 files: one is .app, one is unix execute file.
.app is a directory, please read: http://en.wikipedia.org/wiki/Application_bundle

teriyaki

  • New Member
  • *
  • Posts: 47
I knew this

but I try several ways but no one can minimize the size of the unix execute file.
even a hello world project is more than 20M

zeljko

  • Hero Member
  • *****
  • Posts: 1594
    • http://wiki.lazarus.freepascal.org/User:Zeljan
@teriyaki, have you tried my propopsal ?

teriyaki

  • New Member
  • *
  • Posts: 47
I do not understand 'execute strip yourbinary'.
Do you mean upx compression?

To merge .app and unix execute, I just copied the execute file to .app sub-directory: /content/macos/ to replace the shortcut of the unix execute file.
Thus it is an merged .app, but the size is still same huge.

I used Delphi for windows for a long time and Xcode/Objective-C for osx/ios for 4 years., in which the built file size always is from 100K to 4,5M.
but new to Lazarus(due to an open source project for winows/osx/ubuntu).

Wonder if the file size has the same situation on Ubuntu
« Last Edit: April 19, 2014, 03:09:16 pm by teriyaki »

Leledumbo

  • Hero Member
  • *****
  • Posts: 8746
  • Programming + Glam Metal + Tae Kwon Do = Me
Quote
Quote
I do not understand 'execute strip yourbinary'.
Do you mean upx compression?
No, upx is compression, strip is removing unneeded debug symbols.
Actually, a better way is not to generate debug symbols at all. Uncheck respective checkbox in compiler options or add -g- to compiler option.
Quote
Wonder if the file size has the same situation on Ubuntu
Platform doesn't matter, when the environment is configured properly. Size of executables between platforms and widgesets should differ no more than 500K. A correctly stripped hello, world should be around 1.5 MB only.

Hendrik

  • Newbie
  • Posts: 5
There was a discussion last year on this topic.
http://forum.lazarus.freepascal.org/index.php/topic,21969.msg129464.html
can this help you?

teriyaki

  • New Member
  • *
  • Posts: 47
thanks this works for me

 

TinyPortal © 2005-2018