Overclock.net - Overclocking.net
     
 
Home Gallery Reviews Blogs Register Today's Posts Mark Forums Read Members List


Go Back   Overclock.net - Overclocking.net > Software, Programming and Coding > Operating Systems > Linux, Unix

Reply
 
LinkBack Thread Tools
Old 08-27-09   #1 (permalink)
Linux Lobbyist
 
intel nvidia

Join Date: Apr 2008
Posts: 900

Rep: 81 transhour is acknowledged by some
Unique Rep: 64
Trader Rating: 5
Default bash script: assist with compiling and making deb files: ubuntu/debian/mint/etc

i do not know how use full any one will find this bash script, but i use it alot when i go to compile programs. it is a very limited script, it will only do the ./configure, if there are any other process you are to do before that, then you will need to do it yourself, it will configure, and will pass optimization onto the configure, it will build and then create a deb package using checkinstall, then it will clean the directory.

you will need to make sure that you have all dependency's install for compiling and installing, checkinstall will ask you for a dependency list, i typically only use these files for my own use, so i can remove them using the package manager, you could always change

checkinstall -d to make install if you want.

here is the usage

bash: ./compile.sh /home/desktop/user/location-of-source

there is currently only one argument you can pass to the script, and that is the director location of the source you wish to compile.

here is the script, i have commented the areas you can change.

Code:
#!/bin/bash
DEST_DIR=$1 #this is the first argument capture
cd $DEST_DIR #changing to thedirectory
Cf="" # optimization flags go here, you can find a list by googling gcc optimization cflags
CxF=$Cf #cxxflags optimization flags, i typically use the cflags for this, but you can alter if you wish
NumOfProcs=1 #number of threads you wish make to start when compiling.
make clean
./configure CFLAGS="$Cf" CXXFLAGS="$CxF"
make -j$NumOfProcs
checkinstall -D
make clean
if you have any suggestions or comments on this bash script, let me know, i use it mainly for light builds, nothing major or fancy.

System: Xeon Glory
CPU
Xeon X3440 @ 3.8 ghz w/HT 1.32vcore
Motherboard
ASRock P55 Extreme
Memory
4x2gb RipJaw Gskills
Graphics Card
nvidia 8800 gt
Hard Drive
Main 250 wd, secondary, 500 Seagate
Sound Card
onboard
Power Supply
corsair 550 watt
Case
Cooler Master Centurion 590
CPU cooling
xigamatek s1283 Darknight
GPU cooling
duorb. thanks to blameless :)
OS
Win7 && Ubuntu 9.04
Monitor
20 inch acer ws
transhour is offline   Reply With Quote
Old 08-28-09   #2 (permalink)
You what?
 
gonX's Avatar
 
intel

Join Date: May 2006
Location: Tampere, Finland
Posts: 20,970
Blog Entries: 10

FAQs Submitted: 1
Hardware Reviews: 15
Trader Rating: 13
Default

You probably want -O3 and -pipe as both C and C++ flags. Then -mtune=core2 is ideal, but if you know you'll only be running it on core2 systems, then you can use -march instead. mtune only makes generic optimizations for the set architecture, but will run on any x86-compatible computer.
__________________
THE Mouse FAQ | 32-bit Resolution Fix | Important Information
64-Bit Driver Signing Fix | The Infraction and Warning System
My Anime Progress | The HoN Discussion Thread


Please direct all tech related questions to a thread in the respectable forums, and not to my PM inbox. Thank you

System: Netbook - Fujisu Siemens Lifebook P7120
CPU
Pentium M ULV 1.2 GHz
Motherboard
Fujitsu Siemens
Memory
2x512MB Generic
Graphics Card
Intel 915GM
Hard Drive
60GB 5400RPM
Sound Card
E-MU Tracker|pre and Onboard
OS
Arch Linux i686
Monitor
11" LED-backlit LCD
gonX is online now Overclocked Account gonX's Gallery   Reply With Quote
Old 08-29-09   #3 (permalink)
Linux Lobbyist
 
intel nvidia

Join Date: Apr 2008
Posts: 900

Rep: 81 transhour is acknowledged by some
Unique Rep: 64
Trader Rating: 5
Default

these are my settings:

"-march=core2 mtune=core2 -02 -msse4.1 -fomit-frame-pointer -pipe -mmmx -msse2 -msse3"

i've always used -02, never -03, read that can lead to instability.

System: Xeon Glory
CPU
Xeon X3440 @ 3.8 ghz w/HT 1.32vcore
Motherboard
ASRock P55 Extreme
Memory
4x2gb RipJaw Gskills
Graphics Card
nvidia 8800 gt
Hard Drive
Main 250 wd, secondary, 500 Seagate
Sound Card
onboard
Power Supply
corsair 550 watt
Case
Cooler Master Centurion 590
CPU cooling
xigamatek s1283 Darknight
GPU cooling
duorb. thanks to blameless :)
OS
Win7 && Ubuntu 9.04
Monitor
20 inch acer ws
transhour is offline   Reply With Quote
Old 08-29-09   #4 (permalink)
Programmer
 
intel nvidia

Join Date: May 2009
Location: madison WI
Posts: 81

Rep: 10 nerdy_swagger Unknown
Unique Rep: 8
Trader Rating: 0
Default

I use a similar script except I have some extra stuff in there to do things for specific purposes
__________________
Freelance programmer, computer hardware enthusiast.

System: Money Maker
CPU
e6400 @ 400x9 = 3600MHz
Motherboard
GA-P965-S3 vdroopmod
Memory
8GB PQI PC3200
Graphics Card
GeForce 7600GT vmod
Hard Drive
500GB Seagate SATA
Sound Card
diamondtek xtremesound 7.1
Power Supply
PC P&C Silencer 610W
Case
small rosewill black midT
CPU cooling
big typhoon + thunderblade
GPU cooling
stock
OS
Slackware 12, Windows 7 beta
Monitor
22" Dell
nerdy_swagger is offline   Reply With Quote
Old 08-29-09   #5 (permalink)
You what?
 
gonX's Avatar
 
intel

Join Date: May 2006
Location: Tampere, Finland
Posts: 20,970
Blog Entries: 10

FAQs Submitted: 1
Hardware Reviews: 15
Trader Rating: 13
Default

-O2 is overall more stable, but -O3 tends to be faster (though not by much). The mmx, sse2, sse3 and sse4.1 pointers are unnecessary if you have -march, and so is -mtune. The -O setting also automatically omits frame pointers, so that one becomes unnecessary too.

So with your example you'd ideally need to use:

-march=core2 -O2 -pipe

You probably want to read this:
http://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html

You probably want to read the Gentoo Linux Compile Optimization guide too:
http://www.gentoo.org/doc/en/gcc-optimization.xml
__________________
THE Mouse FAQ | 32-bit Resolution Fix | Important Information
64-Bit Driver Signing Fix | The Infraction and Warning System
My Anime Progress | The HoN Discussion Thread


Please direct all tech related questions to a thread in the respectable forums, and not to my PM inbox. Thank you

System: Netbook - Fujisu Siemens Lifebook P7120
CPU
Pentium M ULV 1.2 GHz
Motherboard
Fujitsu Siemens
Memory
2x512MB Generic
Graphics Card
Intel 915GM
Hard Drive
60GB 5400RPM
Sound Card
E-MU Tracker|pre and Onboard
OS
Arch Linux i686
Monitor
11" LED-backlit LCD
gonX is online now Overclocked Account gonX's Gallery   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools



All times are GMT -5. The time now is 01:52 AM.


Overclock.net is a Carbon Neutral Site Creative Commons License

Terms of Service / Forum Rules | Privacy Policy | DMCA Info | Advertising | Become an Official Vendor
Copyright © 2009 Shogun Interactive Development. Most rights reserved.
Page generated in 0.12455 seconds with 8 queries