This forum has been archived. All content is frozen. Please use KDE Discuss instead.

compilation error: `cpu_set\' undeclared

Tags: None
(comma "," separated)
cyryl
Karma
0
I\'m compiling amaroK from source some time, and newer had any problems. Now, when I\'m trying to make 1.3.5 I\'m getting the following errors:
app.cpp: In member function `void App::fixHyperThreading()\':
app.cpp:409: error: `cpu_set\' undeclared (first use this function)
app.cpp:409: error: (Each undeclared identifier is reported only once for each function it appears in.)
app.cpp:409: error: `__arr\' undeclared (first use this function)
make[4]: *** [app.o] Błąd 1
make[4]: Leaving directory `/home/majkel/soft/amarok-1.3.5/amarok/src\'
make[3]: *** [all-recursive] Błąd 1
make[3]: Leaving directory `/home/majkel/soft/amarok-1.3.5/amarok/src\'
make[2]: *** [all-recursive] Błąd 1
make[2]: Leaving directory `/home/majkel/soft/amarok-1.3.5/amarok\'
make[1]: *** [all-recursive] Błąd 1
make[1]: Leaving directory `/home/majkel/soft/amarok-1.3.5\'
make: *** [all] Błąd 2

Some time ago I made an apt-get dist-upgrade, bo everything was fine...

What is wrong? What should I do?
jefferai
Moderator
Posts
52
Karma
0
Try grabbing the latest source from SVN and recompiling. It should be fixed now (thanks to eean).
User avatar
oggb4mp3
Registered Member
Posts
166
Karma
0
Is a problem with glibc. If you don\'t want to run TRUNK, here is a patch that should apply cleanly to 1.3.5 that should fix this.
User avatar
oggb4mp3
Registered Member
Posts
166
Karma
0
[code:1]--- amarok-1.3.5/amarok/configure.in.in 2005-10-24 18:50:38.000000000 -0500
+++ amarok-1.3.5-patched/amarok/configure.in.in 2005-10-26 17:19:57.000000000 -0500
@@ -627,6 +627,8 @@
AC_LANG_SAVE
AC_LANG_CPLUSPLUS

+amarok_glibcsched_works=no
+
AC_TRY_COMPILE([
#include
],
@@ -634,18 +636,37 @@
cpu_set_t mask;
sched_setaffinity( 0, sizeof(mask), &mask );
],
- amarok_glibcsched_works=yes,
- amarok_glibcsched_works=no
+ amarok_sched_3params=yes
+ amarok_sched_3params=no
)

+if test \"x$amarok_sched_3params\" = \"xyes\"; then
+ AC_DEFINE(SCHEDAFFINITY_SUPPORT, 1, [sched_setaffinity works correctly])
+ AC_DEFINE(SCHEDAFFINITY_3PARAMS, 1, [sched_setaffinity takes three params])
+ amarok_glibcsched_works=yes
+fi
+
+if test \"x$amarok_sched_3params\" = \"xno\"; then
+ AC_TRY_COMPILE([
+ #include
+ ],
+ [
+ cpu_set_t mask;
+ sched_setaffinity( 0, &mask );
+ ],
+ amarok_sched_2params=yes,
+ amarok_sched_2params=no
+ )
+ if test \"x$amarok_sched_2params\" = \"xyes\"; then
+ AC_DEFINE(SCHEDAFFINITY_SUPPORT, 1, [sched_setaffinity works correctly])
+ amarok_glibcsched_works=yes
+ fi
+fi
+
AC_LANG_RESTORE

AC_MSG_RESULT($amarok_glibcsched_works)

-if test \"$amarok_glibcsched_works\" = \"yes\"; then
- AC_DEFINE(SCHEDAFFINITY_SUPPORT, 1, [sched_setaffinity works correctly])
-fi
-
###############################################################################
# END SCHED_SETAFFINITY BUGGY GLIBC CHECK
###############################################################################
--- amarok-1.3.5/amarok/src/app.cpp 2005-10-24 18:50:38.000000000 -0500
+++ amarok-1.3.5-patched/amarok/src/app.cpp 2005-10-26 17:13:39.000000000 -0500
@@ -69,11 +69,10 @@

// For the HyperThreading fix
#ifdef __linux__
- #include
- #if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2,3)
+ #if SCHEDAFFINITY_SUPPORT
#include
#include
- #endif //__GLIBC_PREREQ && __GLIBC_PREREQ(2,3)
+ #endif //SCHEDAFFINITY_SUPPORT
#endif //__linux__

App::App()
@@ -386,7 +385,6 @@
DEBUG_BLOCK

#ifdef __linux__
- debug() << \"SCHEDAFFINITY_SUPPORT enabled. Testing to see if HT fix should be enabled...\" << endl;
QString line;
uint cpuCount = 0;
QFile cpuinfo( \"/proc/cpuinfo\" );
@@ -404,24 +402,24 @@
debug() << \"CPU with active HyperThreading detected. Enabling WORKAROUND.\\n\";

// If the library is new enough try and call sched_setaffinity.
- #if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2,3)
+ #if SCHEDAFFINITY_SUPPORT
cpu_set_t mask;
CPU_ZERO( &mask ); // Initializes all the bits in the mask to zero
CPU_SET( 0, &mask ); // Sets only the bit corresponding to cpu
- #ifdef SCHEDAFFINITY_SUPPORT
+ #ifdef SCHEDAFFINITY_3PARAMS
if ( sched_setaffinity( 0, sizeof(mask), &mask ) == -1 )
- #else //SCHEDAFFINITY_SUPPORT
+ #else //SCHEDAFFINITY_3PARAMS
if ( sched_setaffinity( 0, &mask ) == -1 )
- #endif //SCHEDAFFINITY_SUPPORT
+ #endif //SCHEDAFFINITY_3PARAMS
{
warning() << \"sched_setaffinity() call failed with error code: \" << errno << endl;
QTimer::«»singleShot( 0, this, SLOT( showHyperThreadingWarning() ) );
return;
}
- #else //defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2,3)
- warning()<<\"glibc too old (<2.3) for sched_setaffinity\" << endl;
+ #else //SCHEDAFFINITY_SUPPORT
+ warning()<<\"glibc failed checks for sched_setaffinity\" << endl;
QTimer::«»singleShot( 0, this, SLOT( showHyperThreadingWarning() ) );
- #endif //defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2,3)
+ #endif //SCHEDAFFINITY_SUPPORT
}
else { debug() << \"Fix not enabled\" << endl; }
#else //__linux__[/code:1]

Post edited by: oggb4mp3, at: 2005/10/27 00:47
cyryl
Karma
0
Thanks very much for the patch. It did the work :)
I can\'t run the svn version, becouse I have not fully configured svn. Have to sit and work about it :)
cyryl
Karma
0
The same error returns in 1.3.6

I read the comments in bug report [url=\"http://bugs.kde.org/show_bug.cgi?id=115068\"]BR115068[/url], and these solutions don\'t work.

Distro: PCLinuxOS

$ rpm -q glibc
glibc-2.3.2-14mdk
$ uname -r
2.6.12-oci5.mdk

Hope, this info will help solve this problem :)
papi71
Karma
0
same exact prob. running PCLinuxOS 2005. I wanted to install from source since it seems the the pclos package dosen\'t have the mysql support. I WANT MY AMAROK WITH ALL THE GREAT FEATURES!!!! :P
thanks :whistle:
User avatar
markey
KDE Developer
Posts
2286
Karma
3
OS
papi71 wrote:
same exact prob. running PCLinuxOS 2005. I wanted to install from source since it seems the the pclos package dosen\'t have the mysql support. I WANT MY AMAROK WITH ALL THE GREAT FEATURES!!!! :P
thanks :whistle:


OK, I\'ve just backported our fixes for that to 1.3-branch. That means 1.3.7 is going to compile on PCLinuxOS.

A word of warning though: The HyperThreading fix will then not work on PCLinuxOS. If you got a P4, you will have to disable HyperThreading, or suffer from amaroK crashing.


--
Mark Kretschmann - Amarok Developer
Papi71
Karma
0
:woohoo:
Thanks!!! :)


Bookmarks



Who is online

Registered users: Bing [Bot], claydoh, Google [Bot], rblackwell, Yahoo [Bot]