LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Rebuild Slackware (LinkedIn project) (http://www.linuxquestions.org/questions/slackware-14/rebuild-slackware-linkedin-project-4175457215/)

mlpa 04-07-2013 06:45 AM

Rebuild Slackware (LinkedIn project)
 
An interesting project, here

Didier Spaier 04-07-2013 07:08 AM

Thanks, but I won't register to Linkedin for that.

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

mlpa 04-07-2013 07:23 AM

Quote:

Originally Posted by Didier Spaier (Post 4926773)
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\"";

Didier Spaier 04-07-2013 07:59 AM

<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?

GazL 04-07-2013 08:56 AM

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.

zakame 04-07-2013 09:22 AM

Tommaso ought to be running Gentoo instead.

GazL 04-07-2013 09:37 AM

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?

Alien Bob 04-07-2013 10:05 AM

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

fskmh 04-07-2013 10:07 AM

It looks like the "unsafe" math optimisations are associated -Ofast, so -O3 is looking pretty tame.

GazL 04-07-2013 11:30 AM

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.

GazL 04-07-2013 12:58 PM

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.

mlpa 04-08-2013 11:28 AM

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 ... :-)

elvis4526 04-08-2013 12:48 PM

Quote:

Originally Posted by Alien Bob (Post 4926834)
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! :D

mlpa 04-10-2013 12:31 PM

Quote:

Originally Posted by Alien Bob (Post 4926834)
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?

yenn 04-10-2013 01:10 PM

Quote:

Originally Posted by elvis4526 (Post 4927648)
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.


All times are GMT -5. The time now is 10:09 PM.