Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Wed 20 Aug 2014, 12:33
All times are UTC - 4
 Forum index » House Training » HOWTO ( Solutions )
How to Compile Firefox for your CPU (in Lucid 5.2.5)
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [12 Posts]  
Author Message
playdayz


Joined: 25 Apr 2008
Posts: 3788

PostPosted: Wed 11 May 2011, 17:40    Post subject:  How to Compile Firefox for your CPU (in Lucid 5.2.5)
Subject description: Higher Optimization and Efficiency
 

Note added instruction 2b.

Here is location of source for Firefox 5.0b2
ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/5.0b2/source/

This is how to compile Firefox for your cpu, mainly for fun of course, but I got about an 8% speed improvement on the Peacekeeper browser benchmark. http://clients.futuremark.com/peacekeeper/index.action Please be careful in distributing your optimized Firefox pet so that it is very clear what cpu it is for. I have been doing this repeatedly on Lucid 5.2.5 so if it does not work I have probably left something out--please ask. IMHO, the more people who can compile the better for Puppy.

1. Install the lupu_devx_525.sfs (contains files needed to compile)
http://distro.ibiblio.org/pub/linux/distributions/puppylinux/puppy-5.2.5/lupu_devx_525.sfs
Put it in /mnt/home, then Menu -> System -> Bootmanager -> Load SFS, move the devx to the right pane, close, and reboot

2. Download Firefox source code
http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/4.0.1/source/

download -> firefox-4.0.1.source.tar.bz2

2b. Also download and install yasm, which is necessary for Firefox to support webm video.
http://packages.ubuntu.com/natty/i386/yasm/download
Webm test files -> http://forums.mozillazine.org/viewtopic.php?f=23&t=1919639

3. Unpack the source code:
Code:
# tar -xjf firefox-4.0.1.source.tar.bz2

(Don't try to use Xarchive--it takes forever)

4. Open the mozilla-2.0 folder and open a terminal in that folder
(right-click in the folder background and choose Window -> Terminal Here)

5. Figure out what cpu you want to compile for
http://gcc.gnu.org/onlinedocs/gcc-3.4.6/gcc/i386-and-x86_002d64-Options.html
(for the most speed pick the highest category your cpu fits in, for instance my Phenom could be i686 or K8, but its highest is amdfam10)

6. Enter:
Code:
# export CFLAGS="-march=amdfam10 -O3“   
# export CXXFLAGS="-march=amdfam10 -O3“

This makes environmental variables that the compiler will heed

or another way (suggested by Dingo below)
Code:
#export CXXFLAGS="-march=native -O3“
#export CFLAGS="-march=native -O3“

(substitute the abbreviation for your cpu--the -O3 stands for the highest level of optimization--it is the letter capital O. -march means to optimize for *only* the cpu listed--a safer alternative, for less performance, is -mtune. If you are in doubt about your cpu-type, you can use the cpu-type "native," and the compiler will figure it out for itself--I tested and got the same speed with amdfam10 and with native.)

7. Enter: .
Code:
For Firefox
# ./configure --enable-application=browser --prefix=/usr
For Seamonkey
# ./configure --enable-application=suite --prefix=/usr


8. If no error: enter

Code:
# make


9. It could take about an hour to make. If no error, create a new folder with a representative name such as
/mnt/sdb1/Firefox-4.0.1-lucid525-amdfam10

10. Still in the same terminal, Enter:

Code:
# make install DESTDIR=/mnt/sdb1/Firefox-4.0.1-lucid525-amdfam10

(DESTDIR puts the installation into a folder that you can turn into a pet--I often put it in the / directory, such as )
Code:
# make install DESTDIR=/Firefox-4.0.1-lucid525-amdfam10


11. Exit the Firefox folder and find the DESTDIR and enter

Code:
# dir2pet Firefox-4.0.1-lucid525-amdfam10

and answer the pet questions. At the end you will have a pet of the Firefox you have compiled. It will not have menu entries though, so start it in /usr/bin/firefox, or by entering firefox in a terminal. The pet you make will have the DEV files included so it will be about 32MB. You can delete: /usr/include, /usr/lib/firefox-4.01-devel, and /usr/share/idl before making the pet, in order to bring the pet down to 14MB.

This is just an outline. There are several thousand Puppians who know more than I do about this, so I hope they will offer suggestions to refine the process. For instance I am not sure that both CXXFLAGS and CFLAGS are needed...

Traditionally firefox was regarded as very difficult to compile--not so anymore. Another urban myth was that the Mozilla code could not be optimized at even -O2--not so anymore--at least the firefox code can handle -O3..

Last edited by playdayz on Fri 17 Jun 2011, 13:00; edited 10 times in total
Back to top
View user's profile Send private message 
Dingo


Joined: 11 Dec 2007
Posts: 1415
Location: somewhere at the end of rainbow...

PostPosted: Wed 11 May 2011, 18:07    Post subject:  

I tried to build Firefox 4.xx on Puppy 3.01, but I had an error message about lacking of mozilla-libs

where can I get mozilla-libs?

_________________
replace .co.cc with .info to get access to stuff I posted in forum
dropbox 2GB free
OpenOffice for Puppy Linux
Back to top
View user's profile Send private message Visit poster's website 
playdayz


Joined: 25 Apr 2008
Posts: 3788

PostPosted: Wed 11 May 2011, 18:11    Post subject:  

Dingo, You are one of the thousands of Puppians who know more than I do about this. I don't know. I was darn happy to get it working on Lucid 5.2.5 Wink
Back to top
View user's profile Send private message 
Dingo


Joined: 11 Dec 2007
Posts: 1415
Location: somewhere at the end of rainbow...

PostPosted: Wed 11 May 2011, 18:32    Post subject:  

I'll try again, (first attempt was a matter of few minutes before to sleep). If you want try, meanwhile, I read in past that -Os can sometimes give a minor memory footprint once application loads itself

since gcc 4.3.x (if I remember well), we can use a special switch

-mtune=native

that turns on all processor capabilities

in this way:
Code:
export CFLAGS="-O3 -march=native"
export CXXFLAGS="-O3 -march=native"


unfortunately I have a wireless adapter (netgear wg311V3) not working in latest puppies via ndiswrapper, so until I not find any adapter working, I cannot experiment by myself

_________________
replace .co.cc with .info to get access to stuff I posted in forum
dropbox 2GB free
OpenOffice for Puppy Linux
Back to top
View user's profile Send private message Visit poster's website 
puppyluvr


Joined: 06 Jan 2008
Posts: 3195
Location: Chickasha Oklahoma

PostPosted: Wed 11 May 2011, 19:41    Post subject:  

Very Happy Hello,
I needed this to build for nocona..(Intel with 64 support)
(Available via the PPM from the `butu repos as "YASM"..)
https://developer.mozilla.org/en/YASM...

Using march=xxx enables mtune=xxx so I used:

#export CXXFLAGS="-march=nocona -O3“
#export CFLAGS="-march=nocona -O3“
# ./configure --enable-application=browser --prefix=/usr --sysconfdir=/etc --localstatedir=/var

Still "making"......

_________________
Close the Windows, and open your eyes, to a whole new world
http://puppylinuxstuff.meownplanet.net/puppyluvr/
Puppy Linux Users Group on Facebook

Puppy since 2.15CE...
Back to top
View user's profile Send private message Visit poster's website 
playdayz


Joined: 25 Apr 2008
Posts: 3788

PostPosted: Wed 11 May 2011, 19:56    Post subject:  

Yes, puppyluvr, I knew I would forget something. I will add it to the instructions and provide a link. Yasm is necessary if the compiled Firefox is to support Webm video as I understand/remember it. I installed the Ubuntu Natty Yasm, and indeed the Firefox I built does support webm. I will provide links to that also. Thanks also to Dingo for the -march=native tip--I remember reading it now.
Back to top
View user's profile Send private message 
Indy'spup

Joined: 11 May 2011
Posts: 50
Location: SoCal

PostPosted: Fri 13 May 2011, 14:14    Post subject:  

This is where I butted heads with the fisrt road block, whenever I try to load the sfs file the boot configuration tool says no files exist!!

Quote:
. Install the lupu_devx_525.sfs (contains files needed to compile)
http://distro.ibiblio.org/pub/linux/distributions/puppylinux/puppy-5.2.5/lupu_devx_525.sfs
Put it in /mnt/home, then Menu -> System -> Bootmanager -> Load SFS, move the devx to the right pane, close, and reboot


I'm using the latest Puppy Linux 525 with a full install to HDD. Downloaded the above devx 525.sfs directly to /mnt/home/ open the boot configuration tool at add the devx file but the app consistently reports "No files are available"!!!! damn it!!!

Ok tried again reformat the drive, full install, but no joy, same negative result... Sad

anyone got any ideas? because i'm right out of them ...
Back to top
View user's profile Send private message 
666philb


Joined: 07 Feb 2010
Posts: 1658
Location: wales

PostPosted: Sat 14 May 2011, 04:21    Post subject:  

hi indy'spup

Using the bootmanager to load sfs files is for frugal installs only. For a full install you can use either of these....

this will install the sfs permanently (no uninstall)http://www.murga-linux.com/puppy/viewtopic.php?t=44765

I've never tried this, but it seems you can also uninstall the sfs.....http://www.murga-linux.com/puppy/viewtopic.php?t=64587

_________________
Quickpet_Precise, install popular apps quickly http://www.murga-linux.com/puppy/viewtopic.php?t=83642
LÖVE2d, a collection of 27 lua gameshttp://www.murga-linux.com/puppy/viewtopic.php?t=76739
Back to top
View user's profile Send private message 
Indy'spup

Joined: 11 May 2011
Posts: 50
Location: SoCal

PostPosted: Sat 14 May 2011, 16:12    Post subject:  

Thank You Very Happy

After four days of reading I finally found buried in the dev section where it says exactly that!!

So I get it now, effectively limits compiling to a live build only Sad go figure...
Back to top
View user's profile Send private message 
666philb


Joined: 07 Feb 2010
Posts: 1658
Location: wales

PostPosted: Sun 15 May 2011, 16:51    Post subject:  

Indy'spup wrote:
Thank You Very Happy

After four days of reading I finally found buried in the dev section where it says exactly that!!

So I get it now, effectively limits compiling to a live build only Sad go figure...


Not at all, you just need to install the devx.sfs in a different way. i recommend to use the first link i posted above. After rereading the post it seems that it also has an uninstall option. Although if you're interested in compiling, you would want it installed permanently.

_________________
Quickpet_Precise, install popular apps quickly http://www.murga-linux.com/puppy/viewtopic.php?t=83642
LÖVE2d, a collection of 27 lua gameshttp://www.murga-linux.com/puppy/viewtopic.php?t=76739
Back to top
View user's profile Send private message 
scabz


Joined: 30 Apr 2009
Posts: 302
Location: Tallahassee FL US

PostPosted: Mon 17 Dec 2012, 14:12    Post subject:  

here is the .mozconfig i used to compile firefox 18.0 in precise for my cpu if anybody wants it, this line needs to be changed for your cpu

ac_add_options --enable-optimize="-march=k8 -O2 -pipe -fomit-frame-pointer"
Code:
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/objdir-fx-release
mk_add_options MOZ_CO_PROJECT=browser
mk_add_options MOZ_PHOENIX=1
ac_add_options --enable-optimize="-march=k8 -O2 -pipe -fomit-frame-pointer"
ac_add_options --enable-application=browser
ac_add_options --enable-system-hunspell
ac_add_options --localstatedir=/var
ac_add_options --sysconfdir=/etc
ac_add_options --prefix=/usr
ac_add_options --disable-dbus
ac_add_options --disable-accessibility
ac_add_options --with-system-bz2
ac_add_options --disable-updater
ac_add_options --disable-parental-controls
ac_add_options --disable-gnomevfs
ac_add_options --disable-gnomeui
ac_add_options --disable-system-sqlite
ac_add_options --disable-system-cairo
ac_add_options --enable-system-pixman
ac_add_options --enable-strip
ac_add_options --with-system-jpeg
ac_add_options --with-system-zlib
ac_add_options --enable-libxul
ac_add_options --enable-storage
ac_add_options --disable-tests
ac_add_options --with-default-mozilla-five-home=/usr/lib/firefox
ac_add_options --enable-default-toolkit=cairo-gtk2
ac_add_options --disable-crashreporter
ac_add_options --disable-libnotify
ac_add_options --enable-mathml
ac_add_options --enable-crypto
ac_add_options --without-system-png
ac_add_options --enable-cookies
ac_add_options --enable-negotiateauth
ac_add_options --enable-plugins
ac_add_options --disable-debug
ac_add_options --with-pthreads
ac_add_options --enable-printing
ac_add_options --with-system-libvpx
ac_add_options --enable-jsd
ac_add_options --disable-gio
ac_add_options --disable-gconf
ac_add_options --without-system-nss
ac_add_options --without-system-nspr
ac_add_options --disable-necko-wifi
ac_add_options --enable-official-branding


this compiled and works great but is there anything i could change to make it optimize better?

Code:
# cat /proc/cpuinfo
processor   : 0
vendor_id   : AuthenticAMD
cpu family   : 15
model      : 75
model name   : AMD Athlon(tm) 64 X2 Dual Core Processor 4600+
stepping   : 2
microcode   : 0x62
cpu MHz      : 2411.240
cache size   : 512 KB
physical id   : 0
siblings   : 2
core id      : 0
cpu cores   : 2
apicid      : 0
initial apicid   : 0
fdiv_bug   : no
hlt_bug      : no
f00f_bug   : no
coma_bug   : no
fpu      : yes
fpu_exception   : yes
cpuid level   : 1
wp      : yes
flags      : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow extd_apicid pni cx16 lahf_lm cmp_legacy svm extapic cr8_legacy
bogomips   : 4824.41
clflush size   : 64
cache_alignment   : 64
address sizes   : 40 bits physical, 48 bits virtual
power management: ts fid vid ttp tm stc

processor   : 1
vendor_id   : AuthenticAMD
cpu family   : 15
model      : 75
model name   : AMD Athlon(tm) 64 X2 Dual Core Processor 4600+
stepping   : 2
microcode   : 0x62
cpu MHz      : 2411.240
cache size   : 512 KB
physical id   : 0
siblings   : 2
core id      : 1
cpu cores   : 2
apicid      : 1
initial apicid   : 1
fdiv_bug   : no
hlt_bug      : no
f00f_bug   : no
coma_bug   : no
fpu      : yes
fpu_exception   : yes
cpuid level   : 1
wp      : yes
flags      : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow extd_apicid pni cx16 lahf_lm cmp_legacy svm extapic cr8_legacy
bogomips   : 4823.54
clflush size   : 64
cache_alignment   : 64
address sizes   : 40 bits physical, 48 bits virtual
power management: ts fid vid ttp tm stc
Back to top
View user's profile Send private message AIM Address Yahoo Messenger 
scabz


Joined: 30 Apr 2009
Posts: 302
Location: Tallahassee FL US

PostPosted: Wed 19 Dec 2012, 18:31    Post subject:  

I got it worked out this line works great on firefox and seamonkey.
Code:
ac_add_options --enable-optimize="-O3 -march=k8"
Back to top
View user's profile Send private message AIM Address Yahoo Messenger 
Display posts from previous:   Sort by:   
Page 1 of 1 [12 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » HOWTO ( Solutions )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1191s ][ Queries: 12 (0.0157s) ][ GZIP on ]