Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
NPTL installation
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Thu Sep 18, 2003 10:36 am    Post subject: NPTL installation Reply with quote

Hi all

I've been trying to find a definitive install for Gentool using glibc+nptl without much luck. Here's what I've come up with so far.

1. Boot off CD and follow basic instructions for Stage1
2. set USE="nptl"
3. set ACCEPT_KEYWORDS="~x86"
4. start bootstrap
5. install a 2.6.x kernel like say mm-sources

Is this the correct procedure?
Back to top
View user's profile Send private message
pmjdebruijn
Guru
Guru


Joined: 24 Jul 2003
Posts: 506
Location: Sittard, The Netherlands

PostPosted: Thu Sep 18, 2003 12:03 pm    Post subject: Reply with quote

it sounds right, but I can't guarantee it... (remember to install the module-init-tools for 2.6)...

Bye,
DrZ
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Thu Sep 18, 2003 12:57 pm    Post subject: Reply with quote

Thanks - looks like it's working.
I decided to omit the ~x86 setting until I get the base system up.
Back to top
View user's profile Send private message
ebrostig
Bodhisattva
Bodhisattva


Joined: 20 Jul 2002
Posts: 3152
Location: Orlando, Fl

PostPosted: Thu Sep 18, 2003 7:11 pm    Post subject: Reply with quote

What is the problem?

Can't you get glibc to compile with nptl support?
Or do you not see any effect of it after recompiling glibc? If not, remember to recompile the application to in order for it to use nptl.

I have been running it for a long time and it works fine.

Erik
_________________
'Yes, Firefox is indeed greater than women. Can women block pops up for you? No. Can Firefox show you naked women? Yes.'
Back to top
View user's profile Send private message
silverter
Guru
Guru


Joined: 10 Apr 2002
Posts: 491
Location: Ulm, DE

PostPosted: Thu Sep 18, 2003 7:47 pm    Post subject: Re: NPTL installation Reply with quote

UberLord wrote:
Hi all

I've been trying to find a definitive install for Gentool using glibc+nptl without much luck. Here's what I've come up with so far.

1. Boot off CD and follow basic instructions for Stage1
2. set USE="nptl"
3. set ACCEPT_KEYWORDS="~x86"
4. start bootstrap
5. install a 2.6.x kernel like say mm-sources

Is this the correct procedure?

This won't work because if you boot with a kernel pre-2.5.6? you won't get glibc compilied with nptl support. You'll have to, starting from stage1, install your system so that you can boot with a kernel > 2.5.6? or 2.6 then recompile glibc wiht nptl, and this time, it will be compiled with glibc. you'll have to issue "emerge -e world" to recompile the rest off the system to take advantage of glibc+nptl. Someone correct me if I'm wrong.

regards,
_________________
-- A Guru was once a Beginner --
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Fri Sep 19, 2003 9:14 am    Post subject: Reply with quote

Interesting.

Is there any way of finding out if NPTL has been compiled in? I checked the build folder for glibc when it was bootstrapping and it does appear to have NPTL flags in so I assume it was patched and compiled.

According to the flags btw, I just need a kernel>=2.4.1 which the LiveCD meets :)
I think you just need a kernel > 2.5.xx to get the kernel to take advantage of NPTL. But then, I may be wrong :roll:

EDIT: Glibc-2.3.2-r4 ebuild specific 2.6.0 for min kernel.
I may just get the latest mm-sources installed and do a global recompile. Ah well - means I can spent some time playing Star Wars: KOTOR on my Xbox :)


Last edited by UberLord on Fri Sep 19, 2003 9:30 am; edited 1 time in total
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Fri Sep 19, 2003 9:19 am    Post subject: Reply with quote

ebrostig wrote:
What is the problem?

Can't you get glibc to compile with nptl support?
Or do you not see any effect of it after recompiling glibc? If not, remember to recompile the application to in order for it to use nptl.

I have been running it for a long time and it works fine.

Erik


No problem excect everyone talking about NPTL here and no information about how to set it up. I searched these forums, google, alltheweb, etc and nada for Gentoo instructions. As I'm installing on a lowly laptop I thought I'd ask before having to recompile everything ;)

I hope I do see a nice effect of NPTL - Mozilla in Windows XP took a lot less time to render the same page than the same Mozilla on RH9. A quick install of the Gentoo GRP and a compile of Mozilla showed a major speedup - just only slightly slower than the Windows build. So I'm hoping that this NPTL thingy will make it even quicker!
Back to top
View user's profile Send private message
ebrostig
Bodhisattva
Bodhisattva


Joined: 20 Jul 2002
Posts: 3152
Location: Orlando, Fl

PostPosted: Fri Sep 19, 2003 7:30 pm    Post subject: Reply with quote

Ok.

Here is the procedure I used to build glibc+nptl and the apps that can take advantage of them.

Code:

1. Edit /etc/make.conf and add 'nptl' to your USE flags.
2. Add ACCEPT_KEYWORDS="~x86"
3. make sure that yoiu have at least gcc 3.2.3-r2 installed or emerge gcc 3.3.1-r1
4. emerge glibc-2.3.2-r2
5. emerge any application that can use nptl.


Step 5 is very important since just building glibc with nptl is not going to make an already compiled application use the npt library.

That means, for Mozilla, that you need to emerge any of the plugins used first, esp java (it needs to be compiled from source, don't install the binary version of jav (JDK)) then re-emerge Mozilla.

I primarily started to use nptl bacause of Java. I'm using a bundle of java based applications internally and they tended to take a lot more of memory under Linux than under other OS'es and they also used a LOT of threads and made my top/ps listings very un-managable.

I'd be more than happy to assist you on specific issues that turns up :)

Erik
_________________
'Yes, Firefox is indeed greater than women. Can women block pops up for you? No. Can Firefox show you naked women? Yes.'
Back to top
View user's profile Send private message
AlterEgo
Veteran
Veteran


Joined: 25 Apr 2002
Posts: 1619

PostPosted: Sat Sep 20, 2003 8:05 am    Post subject: Reply with quote

I am under the impression that sun-jdk-1.4.2 suports nptl out-of-the-box:
I only see 1 java thread at a time, where I saw dozens before.
Back to top
View user's profile Send private message
silverter
Guru
Guru


Joined: 10 Apr 2002
Posts: 491
Location: Ulm, DE

PostPosted: Sat Sep 20, 2003 1:27 pm    Post subject: Reply with quote

All this said, what applications would I need to recompile, on a normal desktop machine (apart from Mozilla+plugins+java) in order to take advantage of nptl?
I always thought if I boostrap my system (which I can't do with nptl), I'll have to get the necessary versions of gcc+kernel in order to recompile glibc w\ nptl support, then after that reemerge everything with emerge -e world. Is this step necessary or does is suffice to emerge ONLY the stuff that takes advantage of glibc+nptl?

Thanks and regards,
_________________
-- A Guru was once a Beginner --
Back to top
View user's profile Send private message
bos_mindwarp
Apprentice
Apprentice


Joined: 19 Oct 2002
Posts: 275
Location: stockholm, sweden

PostPosted: Sat Sep 20, 2003 9:42 pm    Post subject: Reply with quote

I'm pretty sure that you dont have to recompile applications to use nptl, except the statically linked ones. Maybe the system stuff is compiled statically, but pretty much everything else isn't.
Back to top
View user's profile Send private message
nephros
Advocate
Advocate


Joined: 07 Feb 2003
Posts: 2139
Location: Graz, Austria (Europe - no kangaroos.)

PostPosted: Sat Sep 20, 2003 10:49 pm    Post subject: Reply with quote

Code:
scourge root # emerge -pve world | fgrep nptl
   sys-libs/glibc-2.3.2-r1  -nls +pic -build -nptl
   app-emulation/wine-20030911  +nas +arts +cups +opengl -alsa +tcltk -nptl -debug
   x11-libs/fltk-1.1.4_rc2  +opengl -debug -nptl


does this look correct? I honestly had expected more apps to make use of it.

[EDIT:] aah, forget it, just found the appropriate thread
_________________
Please put [SOLVED] in your topic if you are a moron.
Back to top
View user's profile Send private message
nephros
Advocate
Advocate


Joined: 07 Feb 2003
Posts: 2139
Location: Graz, Austria (Europe - no kangaroos.)

PostPosted: Sun Sep 21, 2003 2:26 pm    Post subject: Reply with quote

OK, next question:

When compiling kernels, I get a bunch of assembler warnings like this:
Code:
Warning: setting incorrect section attributes for foo

Is this normal or did I bork something?
Is it dangerous?
_________________
Please put [SOLVED] in your topic if you are a moron.
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Mon Sep 22, 2003 2:22 pm    Post subject: Reply with quote

ebrostig wrote:

Code:

5. emerge any application that can use nptl.


Step 5 is very important since just building glibc with nptl is not going to make an already compiled application use the npt library.


I was under the impression that NPTL was a drop-in replacement for linuxthreads. If that's the case why do I need to recompile my applications?

IMO a recompile is only necessary when the ABI changes OR a configuration change is made. Now, the ABI will only change (in theory for glibc) when upgrading glibc to a new version like 2.2.x -> 2.3.x and not 2.3.2-r1 -> 2.3.r4 for example.

If NPTL requires a configuration change then it's NOT a drop-in replacement which I thought it was.

So the only apps which would require a re-compile would be the ones where they were statically linked to glibc. The only ones which I know of are the kernel and gcc - for obvious reasons. And of course the Java SDK which comes as a binary only package.
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Tue Sep 23, 2003 12:45 pm    Post subject: Reply with quote

OK - I have an installed Mozilla compiled using the vanilla GCC & GLIBC binaries from the Stage3 tarball.

And I then decided to goto NPTL again. This time I used GCC 3.3.1-r3 and GLIBC-2.3.2-r5. BTW, a previous poster here was correct - Kernel 2.6.x needs to be installed to get NPTL now.

After compiling GLIBC using NPTL mozilla only had one entry in 'ps ax' where it used to have several. I think this proves that applications do not have to be recompiled for NPTL. Of course, I may be wrong.
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Tue Sep 23, 2003 12:48 pm    Post subject: Reply with quote

Here's a quick script I knocked up which tests for NPTL if you've correctly installed it.

Code:

#!/bin/bash
                                                                               
cat > ${T}/test-nptl.c <<-"END"
#define _XOPEN_SOURCE
#include <unistd.h>
#include <stdio.h>
                                                                               
int main() {
        char buf[255];
        char *str = buf;
                                                                               
        confstr(_CS_GNU_LIBPTHREAD_VERSION, str, 255);
        if (NULL != str) {
                printf("%s\n", str);
                if (NULL != strstr(str, "NPTL"))
                return 0;
        }
                                                                               
        return 1;
}
END
                                                                               
echo "Checking for _CS_GNU_LIBPTHREAD_VERSION support in glibc ... "
if gcc -o ${T}/nptl ${T}/test-nptl.c &> /dev/null
then
        echo "yes"
        echo "Checking what PTHREADS implementation we have ... "
        if ${T}/nptl
        then
                echo "We have NPTL installed :)"
        else
                echo "NPTL is not installed :("
        fi
else
        echo "Your GLIBC doesn't support PTHREADS and therefore NPTL"
fi


OK - I confess.
I nicked it from a Gentoo script :twisted:
Back to top
View user's profile Send private message
nephros
Advocate
Advocate


Joined: 07 Feb 2003
Posts: 2139
Location: Graz, Austria (Europe - no kangaroos.)

PostPosted: Tue Sep 23, 2003 2:57 pm    Post subject: Reply with quote

UberLord wrote:
After compiling GLIBC using NPTL mozilla only had one entry in 'ps ax' where it used to have several. I think this proves that applications do not have to be recompiled for NPTL. Of course, I may be wrong.

Beware, this might not be a good test:
procps-3.1.12.ebuild wrote:
pkg_postinst() {
einfo "NOTE: By default \"ps\" and \"top\" no longer"
einfo "show threads. You can use the '-m' flag"
einfo "in ps or the 'H' key in top to show them"
}

-m will show _no_ threads with NPTL. (tested with binary sun-jdk running netbeans and recompiled mozilla)
_________________
Please put [SOLVED] in your topic if you are a moron.
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Tue Sep 23, 2003 4:08 pm    Post subject: Reply with quote

So what would be a good test? :?:
Back to top
View user's profile Send private message
devsk
Advocate
Advocate


Joined: 24 Oct 2003
Posts: 2995
Location: Bay Area, CA

PostPosted: Sat Oct 25, 2003 7:08 pm    Post subject: Reply with quote

Can somebody verify if I need to start from bootstrap or just building the glibc and nptl enabled applications is enough?

do I need to re-compile gcc, kernel?
Back to top
View user's profile Send private message
devsk
Advocate
Advocate


Joined: 24 Oct 2003
Posts: 2995
Location: Bay Area, CA

PostPosted: Sun Oct 26, 2003 6:37 am    Post subject: Reply with quote

UberLord wrote:
BTW, a previous poster here was correct - Kernel 2.6.x needs to be installed to get NPTL now.


This means if I recompile glibc using LiveCD (2.4.21), nptl won't be built. Your test above as well as "ps" output tell me that after following above steps and recompiling 2.4.20-gentoo-r8, nptl is not there. whole day of wasted compiles...:(

Question remains: How do I get NPTL in 2.4.20-gentoo-r8? please help.
Back to top
View user's profile Send private message
Dinini
Apprentice
Apprentice


Joined: 11 Jun 2003
Posts: 236

PostPosted: Tue Oct 28, 2003 12:17 am    Post subject: Reply with quote

devsk wrote:
Question remains: How do I get NPTL in 2.4.20-gentoo-r8? please help.
Answer remains, you can't, it's not part of the kernel code for 2.4.0-gentoo-r8. Red Hat specifically patched their late 2.4.x kernels for nptl support. So you might be able to snag their kernel set and get it to work. For most of us, it means shifting to 2.6.x kernels.

[Massive Edit]There are new 2.6.0 live CDs available see http://www.gentoo.org/news/en/gwn/20031027-newsletter.xml

So editing the make.conf off the bat for nptl should work now since it's supported in the kernel that's in use. make sure you ONLY compile 2.6.x kernels on this system though.

Oh and don't forget to edit "/usr/include/pthread.h" and add the line "/* Linuxthreads */" so mysql can compile without error.
Back to top
View user's profile Send private message
devsk
Advocate
Advocate


Joined: 24 Oct 2003
Posts: 2995
Location: Bay Area, CA

PostPosted: Wed Oct 29, 2003 11:29 pm    Post subject: Reply with quote

:D

moving to 2.6 was easier than I thought. finally got rid of ten nautilus processes in ps (although they are threads being part of the same process, but still) listing, thanks to NTPL. I am not sure about the performance aspect of it, although overall 2.6 is faster than 2.4.
Back to top
View user's profile Send private message
xhook
n00b
n00b


Joined: 14 Oct 2003
Posts: 7
Location: Estonia

PostPosted: Sat Dec 13, 2003 2:06 pm    Post subject: Reply with quote

The above given script shows me that i have NPTL support in my glibc, but it says that "NPTL is not installed". Mozilla in top/ps looks like often.

I added nptl to USE variable, and competelly reinstalled the system (beginig form bootstrap).
I have kernel-2.6.0-beta11-r2, glibc-2.3.2-r2, gcc-3.2.3-r3.

What I made wrong?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum