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: 879

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)
An escalator can't break
 
gonX's Avatar
 
intel nvidia

Join Date: May 2006
Location: Denmark
Posts: 22,059
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.

System: i7 on Linux. Wut.
CPU
i7 920
Motherboard
EVGA X58 121-BL-E756-TR
Memory
OCZ Gold LV 3 x 2GB DDR3-1600
Graphics Card
Gigabyte 8800GT 512MB @ 686/1743/927
Hard Drive
3x250GB+2x200GB 4xMaxtor 1xHitachi
Sound Card
E-MU Tracker|pre USB
Power Supply
Cooler Master RS-550-ACLY 550W
Case
Antec Three Hundred
CPU cooling
Stock
GPU cooling
Stock
OS
Arch Linux x86_64
Monitor
Samsung 226CW
gonX is offline Overclocked Account gonX's Gallery   Reply With Quote
Old 08-29-09   #3 (permalink)
Linux Lobbyist
 
intel nvidia

Join Date: Apr 2008
Posts: 879

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: 91

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)
An escalator can't break
 
gonX's Avatar
 
intel nvidia

Join Date: May 2006
Location: Denmark
Posts: 22,059
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

System: i7 on Linux. Wut.
CPU
i7 920
Motherboard
EVGA X58 121-BL-E756-TR
Memory
OCZ Gold LV 3 x 2GB DDR3-1600
Graphics Card
Gigabyte 8800GT 512MB @ 686/1743/927
Hard Drive
3x250GB+2x200GB 4xMaxtor 1xHitachi
Sound Card
E-MU Tracker|pre USB
Power Supply
Cooler Master RS-550-ACLY 550W
Case
Antec Three Hundred
CPU cooling
Stock
GPU cooling
Stock
OS
Arch Linux x86_64
Monitor
Samsung 226CW
gonX is offline 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 12:49 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 © 2010 Shogun Interactive Development. Most rights reserved.
Page generated in 0.14571 seconds with 8 queries