LinuxQuestions.org

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

mlpa 04-07-2013 05:45 AM

Rebuild Slackware (LinkedIn project)
 
An interesting project, here

Didier Spaier 04-07-2013 06: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 06: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 06: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 07: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 08:22 AM

Tommaso ought to be running Gentoo instead.

GazL 04-07-2013 08: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 09: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 09:07 AM

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

GazL 04-07-2013 10: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 11:58 AM

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 10: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 11:48 AM

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 11:31 AM

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

H_TeXMeX_H 04-10-2013 12:43 PM

Quote:

Originally Posted by GazL (Post 4926822)
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?

It is NOT at all safe. Programs can crash randomly if it is enabled.

To the OP, please take your funroll-loops and go use Gentoo.

ReaperX7 04-10-2013 10:25 PM

-O2 is the safest optimization you can make. -O3 still can cause issues.

JWJones 04-11-2013 12:27 PM

Quote:

Originally Posted by H_TeXMeX_H (Post 4929105)
To the OP, please take your funroll-loops and go use Gentoo.

Way back when I was looking into various distros to try, I came across that website, while looking into Gentoo. It always makes me laugh, and I have to remind myself of it when I start going down the path of "Gentoo might be interesting to try."

TobiSGD 04-11-2013 12:45 PM

Quote:

Originally Posted by eyeofliberty (Post 4929853)
I have to remind myself of it when I start going down the path of "Gentoo might be interesting to try."

While Gentoo can be used that way there is absolutely no necessity to do so. Gentoo is more a meta-distribution than a distribution, a distribution construction kit. That you can "optimize" in ways that aren't advisable doesn't mean that you have to.
Discarding a distro because some people do things with it that one wouldn't do with the own system seems to me somewhat weird, you are actually robbing yourself of an experience just because others do things you don't like.
I have tried it (and other source-based distributions) and if Slackware wouldn't exist a source-based distribution like Gentoo would be the next closest thing to what I expect from a distribution.

TobiSGD 04-11-2013 12:49 PM

Quote:

Originally Posted by H_TeXMeX_H (Post 4929105)
To the OP, please take your funroll-loops and go use Gentoo.

May I ask why you feel entitled to tell the OP which distribution to use, just because he does things with his Slackware installation that you don't appreciate?

JWJones 04-11-2013 12:59 PM

Quote:

Originally Posted by TobiSGD (Post 4929860)
While Gentoo can be used that way there is absolutely no necessity to do so. Gentoo is more a meta-distribution than a distribution, a distribution construction kit. That you can "optimize" in ways that aren't advisable doesn't mean that you have to.
Discarding a distro because some people do things with it that one wouldn't do with the own system seems to me somewhat weird, you are actually robbing yourself of an experience just because others do things you don't like.
I have tried it (and other source-based distributions) and if Slackware wouldn't exist a source-based distribution like Gentoo would be the next closest thing to what I expect from a distribution.

Oh, I'm not saying I'll never try it, quite the contrary, I find the idea of Gentoo fascinating. But I'm still in the process of wrapping my brain around the "Slackware way" and so I don't feel qualified just yet to make the jump to Gentoo. Baby steps! Heck, after some difficulty, I just successfully installed my first SlackBuild.

H_TeXMeX_H 04-11-2013 01:14 PM

Quote:

Originally Posted by TobiSGD (Post 4929861)
May I ask why you feel entitled to tell the OP which distribution to use, just because he does things with his Slackware installation that you don't appreciate?

Well, at first I wanted to tell him to go elsewhere, but that would be mean. So, instead I told him to take his funroll-loop attitude and use a distro that supports it by default.

I think Gentoo is a decent distro, but it really depends on you.

I think it is senseless to try to rebuild slackware because you want a bit of extra performance, don't you ? It isn't even designed for that.

Honestly, if the project wasn't on Linkedin, and if it wasn't focused on funroll-loops, I'd say it's not a bad idea. Maybe people want to rebuild slackware and can't figure out how to do it properly.

TobiSGD 04-11-2013 02:33 PM

Quote:

Originally Posted by H_TeXMeX_H (Post 4929878)
I think it is senseless to try to rebuild slackware because you want a bit of extra performance, don't you ?

You might want to look who has started this thread: http://www.linuxquestions.org/questi...sbopkg-871295/

Quote:

It isn't even designed for that.
That is why the original author is changing the design. Doesn't seem to be that hard, and funnily AlienBob uses a somewhat similar approach for his ARM port, that can be easily adapted to do the same thing.

But anyways, I rather questioned your tone. If you would have said "Hey, that is what Gentoo does, maybe you should rather look at that." I wouldn't have objected your post. Instead it was more like "Go away, this is not like we do it in Slackware!"
After all, it is still open source and the OP can do what he likes with his systems, regardless if you like that attitude or not.

shadowww 04-11-2013 05:46 PM

Meh, GCC, as much as it was traditionally 'flagship' compiler in linux community it was never really the best piece of code, and considering how big, fat and hard to maintain has become it never will be. Hence, I would suggest that everyone looking to some optimizations in compiling shift their attention to LLVM/Clang. Its codebase is very clean, it is backed up by big names: google, apple, so it is very actively developed and has bright future. Completely open source as well. Its performance jumped quite so in recent SVN builds, and I would not be suprised if already surpassed gcc in both compiling speed and speed of created binaries. I was happy to see it included in Slackware 14 release, and I hope that one day all Slackware packages will be prebuilt with clang. I understand slackware's conservative approach to changes in software (and I am like that too, so I feel with slackware at home) but consider that FreeBSD already switched to clang and dropped gcc, and that alone says much...

H_TeXMeX_H 04-12-2013 01:43 AM

Instead of rebuilding 32-bit Slackware, I think you will gain much more performance from using 64-bit Slackware.

zakame 04-12-2013 02:03 AM

Quote:

Instead of rebuilding Slackware, I think you will gain much more performance from just using Slackware.
A little edit like that, and it would still seem to be right. :)

a4z 04-12-2013 04:35 AM

Quote:

Originally Posted by shadowww (Post 4930009)
Meh, GCC, as much as it was traditionally 'flagship' compiler in linux community it was never really the best piece of code, and considering how big, fat and hard to maintain has become it never will be. Hence, I would suggest that everyone looking to some optimizations in compiling shift their attention to LLVM/Clang. Its codebase is very clean, it is backed up by big names: google, apple, so it is very actively developed and has bright future. Completely open source as well. Its performance jumped quite so in recent SVN builds, and I would not be suprised if already surpassed gcc in both compiling speed and speed of created binaries. I was happy to see it included in Slackware 14 release, and I hope that one day all Slackware packages will be prebuilt with clang. I understand slackware's conservative approach to changes in software (and I am like that too, so I feel with slackware at home) but consider that FreeBSD already switched to clang and dropped gcc, and that alone says much...

lot of nonsens in this post.
the FreeBSD change is primary for License reasons, not cause of a better compiler.
and that's the same reason Apple and others are so interested in clang, they can make their own stuff out of it and stop sharing any time they want, and that's the reason why there is so much marketing blabla arraound.
the best thing on clang is that gcc has now competition and therefore more will to change some things.
gcc is now written in C++, so it seems still to be maintainable , has also nice error messages, and the result performs much better than clang binaries.
and talking about supported platfroms, naja, you simply can not replace gcc.

shadowww 04-12-2013 11:38 AM

Quote:

Originally Posted by a4z (Post 4930240)
the FreeBSD change is primary for License reasons, not cause of a better compiler.

Of course its better. Its actually quite hard not to be better, you should put your gnu/linux fanboyism aside for a moment, educate yourself on things and then try to objectively judge.
Quote:

Originally Posted by a4z (Post 4930240)
and that's the same reason Apple and others are so interested in clang, they can make their own stuff out of it

and... whats the problem?
Quote:

Originally Posted by a4z (Post 4930240)
and stop sharing any time they want

Why would they do that, BSD licence is even more permissive then GPL...
Quote:

Originally Posted by a4z (Post 4930240)
the best thing on clang is that gcc has now competition and therefore more will to change some things.

disagree. what shall gcc do to 'compete'? Suddenly hire more developers to be able to keep up? Don't make me laugh... That competition scheme works only among companies and not open source projects.

Quote:

Originally Posted by a4z (Post 4930240)
gcc is now written in C++, so it seems still to be maintainable ,

yea, c++ now allows them to write even more unmaintanable and unholy-messier code. they are just brining levels of complexity, like what they have been doing for years.

Quote:

Originally Posted by a4z (Post 4930240)
and the result performs much better than clang binaries.

In what, speed? Maybe for now, but there is much improvement regarding that even in current clang SVN builds. And not to talk about quality of produced binary in which gcc was never on pair with other commercially developed compilers.

a4z 04-12-2013 12:00 PM

shadowww, thanks a lot for your words, they are a real eye opener for me, I promise that I will even work more hard from now to lower my fanboyism (except for Slackware) and to acquire knowledge, even if I have heavy doubts that I will ever reach the level of wisdom you have obviously reached.

comfree 04-12-2013 12:44 PM

I will not join that discussion about Gentoo and the 'better' compiler. It's ridiculous to talk about something that is not finished and can't even compile a complete Linux kernel (right now) and compare it to the GCC .

I really like the idea of a make.conf like in FreeBSD. Maybe you don't get the biggest performance boost out of it, maybe even none, but it's still a cool thing. Even if it is just for the fun and the education you'll get out of some tryouts with compilerflags. I can't nor I want to understand people beeing against that kind of thing. There is nothing bad about it and when the OP has the efford to finish it I will definitely give it a try. Even if it gives you nothing, it's still better then another gnome fork.
For some time I was rebuilding a lot of Slackware packages with my own flags etc. First just for my 3 RaspberryPis, but now even on my other machines.
It would be handy to have a config for that.

Alien Bob 04-12-2013 02:56 PM

Quote:

Originally Posted by a4z (Post 4930430)
shadowww, thanks a lot for your words, they are a real eye opener for me, I promise that I will even work more hard from now to lower my fanboyism (except for Slackware) and to acquire knowledge, even if I have heavy doubts that I will ever reach the level of wisdom you have obviously reached.

I admire your gentleman's response, your eloquent phrasing and general respect for the environment ;-)
As for me, I would have gutted the troll and buried him under a rock.

Eric

ottavio 04-13-2013 04:23 AM

I am surprised nobody has mentioned Netbsd. If one really wants, they install applications straight from the Netbsd sources with "pkgsrc":
http://wiki.netbsd.org/pkgsrc/how_to...gsrc_on_linux/

It's probably a PITA but if you've got nothing to do it's a good waste of time. There used to be a couple of Slackware-based distros using pkgrsc but they're no longer maintained.

There are some ready made pkgscr binaries here but I am not sure how they'd work on a modern system:
http://code.google.com/p/pkgsrc-on-slack/downloads/list


All times are GMT -5. The time now is 01:29 PM.