LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 04-07-2013, 05:45 AM   #1
mlpa
Member
 
Registered: May 2008
Location: Aveiro
Distribution: Slackware
Posts: 481

Rep: Reputation: 34
Rebuild Slackware (LinkedIn project)


An interesting project, here
 
Old 04-07-2013, 06:08 AM   #2
Didier Spaier
Senior Member
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slackware{,64}-14.1 on a Lenovo T61 6457-4XG
Posts: 3,961

Rep: Reputation: 936Reputation: 936Reputation: 936Reputation: 936Reputation: 936Reputation: 936Reputation: 936Reputation: 936
Thanks, but I won't register to Linkedin for that.

Please post a link to a publicly available web page if any.

Last edited by Didier Spaier; 04-12-2013 at 07:58 AM.
 
4 members found this post helpful.
Old 04-07-2013, 06:23 AM   #3
mlpa
Member
 
Registered: May 2008
Location: Aveiro
Distribution: Slackware
Posts: 481

Original Poster
Rep: Reputation: 34
Quote:
Originally Posted by Didier Spaier View Post
Thanks, but I won't register to Linkedin for that.

Please post a link to publicly a available web page if any.
I asked the author of the post.
While we wait for the answer I will copy and past his post:
Quote:
Tommaso Bilotta

Rebuild slackware! :-)

Hello friends, I recently wrote a script that changes the SlackBuild and allows you to put flags optimized for the PC. My notebook, ssd disk - OCZ Vertex IV, writes 1.4 GB / Sec with dd from / dev / zero with PF-Kernel. I'd like to start a project to parameterize the SlackBuild in the compiler optimization. The results at the end are great :-). A bit like on freebsd with / etc / make.conf.

This is a part of the script that acts as a patch. Basically looking for a file, for exceptions, if there is no exception for the package for the optimizations, the value assigned to the variable by default.

printf("if [ -e /etc/make.conf.d/%s ]; then\n", NOME_PACCHETTO);
printf("\t. /etc/make.conf.d/%s\n", NOME_PACCHETTO);
print "else"
printf("\tif [ -e /etc/make.conf ]; then\n");
printf("\t\t. /etc/make.conf\n");
print "\telse"
print "\t\tARCH=\"x86_64\"";
print "\t\tSLKCFLAGS=\"$(gcc -Q -march=native --help=target | awk '/enabled/ {printf("%s ",$1)} /-mtune/ || /-march/ {printf("%s%s ",$1,$2)}')\"";
# print "\t\tSLKCFLAGS=\"-m64 -O3 -march=corei7 -mtune=corei7 -mfpmath=sse -mmmx -msse -msse2 -msse4.2 -DPOSIX64\"";
 
Old 04-07-2013, 06:59 AM   #4
Didier Spaier
Senior Member
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slackware{,64}-14.1 on a Lenovo T61 6457-4XG
Posts: 3,961

Rep: Reputation: 936Reputation: 936Reputation: 936Reputation: 936Reputation: 936Reputation: 936Reputation: 936Reputation: 936
<non constructive>Recompiling my 1111 packages to get a performance increase I'm no sure that it I will even notice is not on the top of my TODO list</non constructive>

But that could interest some, and probably some slackers did that already. Maybe they could post here how they did it, then?
 
Old 04-07-2013, 07:56 AM   #5
GazL
Senior Member
 
Registered: May 2008
Posts: 3,312

Rep: Reputation: Disabled
Maybe the odd package could benefit from targeted recompilation, but I have to agree with Didier. A complete rebuild seems like it wouldn't give a worthwhile return on investment.
 
Old 04-07-2013, 08:22 AM   #6
zakame
Member
 
Registered: Apr 2012
Distribution: Debian, Ubuntu, Slackware
Posts: 119

Rep: Reputation: 42
Tommaso ought to be running Gentoo instead.
 
6 members found this post helpful.
Old 04-07-2013, 08:37 AM   #7
GazL
Senior Member
 
Registered: May 2008
Posts: 3,312

Rep: Reputation: Disabled
While were on the subject. How safe is gcc -O3 these days. I know that it had a reputation for causing problems in the past? Is that still the case?
 
Old 04-07-2013, 09:05 AM   #8
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 5,184

Rep: Reputation: Disabled
If that person were using Google+ to discuss it instead of LinkedIn, I would possibly read it. But I unsubscribed from that Slackware group on LinkedIn long ago because of all the SPAM I got in my mailbox from one of the other members promoting his books.

Anyway, looking at his "/etc/make.conf" perhaps he should have a look at the Alien's ARM project where I am modifying lots of SlackBuild scripts to read a configuration file "/etc/slackbuild/machine.conf". I use that filename and in my SlackBuild script modifications am using a variable definition block which I discussed with Pat and which has his approval (basically he changed a few things to arrive at the final design).

As an example, look at http://taper.alienbase.nl/gitweb/?p=...bc200c;hb=HEAD for the new stype of SlackBuild.

Eric
 
2 members found this post helpful.
Old 04-07-2013, 09:07 AM   #9
fskmh
Member
 
Registered: Jun 2002
Location: South Africa
Distribution: Slackware64-current multilib
Posts: 235

Rep: Reputation: 55
It looks like the "unsafe" math optimisations are associated -Ofast, so -O3 is looking pretty tame.
 
Old 04-07-2013, 10:30 AM   #10
GazL
Senior Member
 
Registered: May 2008
Posts: 3,312

Rep: Reputation: Disabled
The old style block of code dealing with $ARCH doesn't have to be anywhere near as ugly as it is: The selections in the case statement are duplicated in the if/then/elif/else blocks below it, and then there's that completely unnecessary double call to uname -m)

I use the following construct in my build scripts which is much cleaner.
Code:
case "${ARCH:=$(uname -m)}" in
      i?86)  SLKCFLAGS="-march=i486 -mtune=i686 -O2"
             LIBDIRSUFFIX=""
             ;;
      arm*)  ARCH="arm"
             SLKCFLAGS="-O2"
             LIBDIRSUFFIX=""
             ;;
    x86_64)  SLKCFLAGS="-O2 -fPIC"
             LIBDIRSUFFIX="64"
             ;;
     core2)  SLKCFLAGS="-march=core2 -O2 -fPIC"
             LIBDIRSUFFIX="64"
             ;;
      s390)  SLKCFLAGS="-O2"
             LIBDIRSUFFIX=""
             ;;
         *)  SLKCFLAGS="-O2"
             LIBDIRSUFFIX=""
             ;;
esac
If you moved any common assignments outside and prior to the case statement and just use the case statement to override them it is shorter still, but i prefer seeing all the assignments for an individual arch in a block of consecutive statements for ease of reading.

Last edited by GazL; 04-07-2013 at 11:00 AM. Reason: Added -O2 -fPIC to be more representative of a stock package in case anyone cut/pastes
 
Old 04-07-2013, 11:58 AM   #11
GazL
Senior Member
 
Registered: May 2008
Posts: 3,312

Rep: Reputation: Disabled
I just tried march=core2 on ffmpeg and MPlayer and it appears to have doubled the cpu utilisation while playing back a vidieo, so I'll be sticking with the defaults in future.
 
Old 04-08-2013, 10:28 AM   #12
mlpa
Member
 
Registered: May 2008
Location: Aveiro
Distribution: Slackware
Posts: 481

Original Poster
Rep: Reputation: 34
Reply from Tommaso:

Quote:
Hello Friends, unfortunately I still have not published anything. Since, however, the topic is of interest, scripts, and reorganized them public on github. The basic idea is that the flags (-O2-march-mtune ... ...) are set by default in a file (make.conf), if there is a file in a specified directory, which is named package these parameters are considered instead of the global ones. By doing so, if a program with the global settings you should fill in (for whatever reason), you can put exceptions ..... An important part, in my opinion, is the iventario packages and the association of each file to the package so that you have absolute control over the operating system. I implemented a script that seemed files in / var / log / packages /

(
cd /var/log/packages/
ls -1 | awk '
{
n=split($0, vett, "-");

INSTALLER=vett[n];
ARCH=vett[n-1];
VERSION=vett[n-2];

m=n - 3;
NOME=vett[1];
for (x = 2; x <= m; x++)
NOME=sprintf("%s-%s",NOME,vett[x]);

printf("insert into package(id,name,version,arch,postfix) values(%d, \"%s\", \"%s\", \"%s\", \"%s\");\n", NR, NOME, VERSION, ARCH, INSTALLER);

}'
)

. The return them in a sqlite3 database. I was also thinking to run ldd with a list of libraries that every track needs in order to establish, associated with each "I" to the packages dependencies.

I am sending this screenshot ... :-)
 
Old 04-08-2013, 11:48 AM   #13
elvis4526
Member
 
Registered: Aug 2011
Posts: 111

Rep: Reputation: Disabled
Quote:
Originally Posted by Alien Bob View Post
If that person were using Google+ to discuss it instead of LinkedIn, I would possibly read it. But I unsubscribed from that Slackware group on LinkedIn long ago because of all the SPAM I got in my mailbox from one of the other members promoting his books.

Anyway, looking at his "/etc/make.conf" perhaps he should have a look at the Alien's ARM project where I am modifying lots of SlackBuild scripts to read a configuration file "/etc/slackbuild/machine.conf". I use that filename and in my SlackBuild script modifications am using a variable definition block which I discussed with Pat and which has his approval (basically he changed a few things to arrive at the final design).

As an example, look at http://taper.alienbase.nl/gitweb/?p=...bc200c;hb=HEAD for the new stype of SlackBuild.

Eric
This is kinda like the make.conf from Gentoo.
This is really cool!
 
Old 04-10-2013, 11:31 AM   #14
mlpa
Member
 
Registered: May 2008
Location: Aveiro
Distribution: Slackware
Posts: 481

Original Poster
Rep: Reputation: 34
Quote:
Originally Posted by Alien Bob View Post
If that person were using Google+ to discuss it instead of LinkedIn, I would possibly read it. But I unsubscribed from that Slackware group on LinkedIn long ago because of all the SPAM I got in my mailbox from one of the other members promoting his books.

Anyway, looking at his "/etc/make.conf" perhaps he should have a look at the Alien's ARM project where I am modifying lots of SlackBuild scripts to read a configuration file "/etc/slackbuild/machine.conf". I use that filename and in my SlackBuild script modifications am using a variable definition block which I discussed with Pat and which has his approval (basically he changed a few things to arrive at the final design).

As an example, look at http://taper.alienbase.nl/gitweb/?p=...bc200c;hb=HEAD for the new stype of SlackBuild.

Eric
Is this becoming a "standard" in Slackware slackbuilds?
 
Old 04-10-2013, 12:10 PM   #15
yenn
Member
 
Registered: Jan 2011
Location: Czech Republic
Distribution: Slackware, Gentoo
Posts: 152

Rep: Reputation: 21
Quote:
Originally Posted by elvis4526 View Post
This is kinda like the make.conf from Gentoo.
This is really cool!
Definitely. Good thing is that SlackBuilds actually doesn't hide the magic, so I can tell what will happen, when and why. This always confuse me on Gentoo as I never know where all variables in ebuilds and init scripts came from.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Linkedin.com - a good idea? honeybadger General 23 07-27-2012 04:51 AM
LXer: Open Source: It's all LinkedIn LXer Syndicated Linux News 0 07-07-2010 02:50 PM
LXer: Open HealthCare Group on LinkedIn.com LXer Syndicated Linux News 0 05-03-2007 05:31 PM
complete Slackware rebuild tintapok Slackware 23 07-02-2005 11:56 AM
Package for Slackware, rebuild xorg Ephracis Slackware 11 03-20-2005 05:32 AM


All times are GMT -5. The time now is 07:58 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration