|
![]() |
Overclock.net - Overclocking.net > Software, Programming and Coding > Operating Systems > Linux, Unix | |
bash script: assist with compiling and making deb files: ubuntu/debian/mint/etc
|
||
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 (permalink) | |||||||||||||
|
Linux Lobbyist
![]() |
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
__________________
There are three kinds of lies: Lies, damned lies, and benchmarks. never go as5 to mouth ASrock[/COLOR] Pro/Extreme/Deluxe/SuperComputer club, P55 and X58 welcome[/B]"]http://www.overclock.net/intel-motherboards/588268-asrock-pro-extreme-deluxe-supercomputer-club.html Xeon Glory
|
|||||||||||||
|
|
|
|
|
#2 (permalink) | |||||||||||||
|
An escalator can't break
![]() |
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 | THE Tutorial to OCN 64-Bit Driver Signing Fix | The Infraction and Warning System My Anime Progress | The HoN Discussion Thread | Signature Rules
|
|||||||||||||
|
|
|
|
#3 (permalink) | |||||||||||||
|
Linux Lobbyist
![]() |
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.
__________________
There are three kinds of lies: Lies, damned lies, and benchmarks. never go as5 to mouth ASrock[/COLOR] Pro/Extreme/Deluxe/SuperComputer club, P55 and X58 welcome[/B]"]http://www.overclock.net/intel-motherboards/588268-asrock-pro-extreme-deluxe-supercomputer-club.html Xeon Glory
|
|||||||||||||
|
|
|
|
|
#4 (permalink) | |||||||||||||
|
Programmer
|
I use a similar script except I have some extra stuff in there to do things for specific purposes
__________________
Freelance programmer, computer hardware enthusiast.
|
|||||||||||||
|
|
|
|
|
#5 (permalink) | |||||||||||||
|
An escalator can't break
![]() |
-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 | THE Tutorial to OCN 64-Bit Driver Signing Fix | The Infraction and Warning System My Anime Progress | The HoN Discussion Thread | Signature Rules
|
|||||||||||||
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
|
|