Jdesk / memcached

Automatically exported from code.google.com/p/memcached
0 stars 0 forks source link

Bad parameter -pthread being used on Solaris (instead of -pthreads) #118

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.
  On SunOS (see below for my particular version), installed libevent-1.4.13:
   cd libevent-1.4.13-stable/
   ./configure
   make
   make install

2. Configure and make memcached:
   cd memcached-1.4.4/
     ./configure --with-libevent=/root/libevent-1.4.13-stable
     make

3. Notice the warnings about -pthread:
   gcc: unrecognized option `-pthread'

The first time I compiled it, I did not notice this problem in make, and I
installed anyways.  The result was that I could not reliably cache any
value > 7K.  At 7+K the cache would start failing.

To fix it, I edited memcached-1.4.4/configure and changed -pthread to
-pthreads (plural for SunOS).  That worked, and fixed my max value for
cache size to 1MB as it should be.

I believe this is a problem in ./configure for memcached.

Thanks,

Original issue reported on code.google.com by aavak...@gmail.com on 31 Dec 2009 at 2:48

GoogleCodeExporter commented 9 years ago
According to http://gcc.gnu.org/onlinedocs/gcc/Option-Summary.html both 
-pthread 
and -pthreads should work on SPARC. 

What is the gcc-version you are using? 

Original comment by trond.no...@gmail.com on 31 Dec 2009 at 6:53

GoogleCodeExporter commented 9 years ago
Had same issue trying to compile on solaris, memcached-1.4.4 and gcc (GCC) 
3.4.3 (csl-sol210-3_4-
20050802).

Original comment by jalen...@gmail.com on 2 Jan 2010 at 11:08

GoogleCodeExporter commented 9 years ago
Guess you should try a newer version of gcc (according to 
http://gcc.gnu.org/gcc-3.4/ 
3.4.3 was released in 2004...) I just tried to compile memcached with gcc 4.4.1 
on a 
T5240 running Solaris 10, and I didn't get a single warning from gcc.

Original comment by trond.no...@gmail.com on 3 Jan 2010 at 10:14

GoogleCodeExporter commented 9 years ago
Yep, I was using gcc 3.4.3:

[root@mem-01.rent.com ~]$ gcc -v
Reading specs from /usr/sfw/lib/gcc/sparc-sun-solaris2.10/3.4.3/specs
Configured with: /sfw10/builds/build/sfw10-patch/usr/src/cmd/gcc/gcc-
3.4.3/configure --prefix=/usr/sfw --with-as=/usr/ccs/bin/as --without-gnu-as 
--with-
ld=/usr/ccs/bin/ld --without-gnu-ld --enable-languages=c,c++ --enable-shared
Thread model: posix
gcc version 3.4.3 (csl-sol210-3_4-branch+sol_rpath)

Original comment by aavak...@gmail.com on 4 Jan 2010 at 8:06

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Just wanted to add a quick note that Sun Solaris comes with gcc 3.4.3, and even 
sunfreeware.com only provides gcc-3.4.6 as an alternative.

Basically if we don't fix this in configure to support gcc 3.4.x, many people 
who 
get Solaris and don't specifically upgrade gcc themselves might have the 
problem I 
encoutered.

The real issue is that 'gcc: unrecognized option `-pthread'' is a warning and 
not an 
error.  If the person compiling memcached ignores that warning or does not 
notice 
it, and installs memcached, the results are insiduous (cache failures at small 
cache 
sizes etc...).

Original comment by aavak...@gmail.com on 6 Jan 2010 at 8:56

GoogleCodeExporter commented 9 years ago
It's much easier to add this one-liner to your build script than to install a 
recent gcc on Solaris 

perl -p -i -e 's/-pthread"/-pthreads"/g' configure

Original comment by jesserth...@gmail.com on 16 Nov 2010 at 4:56

GoogleCodeExporter commented 9 years ago
Can't support old versions of gcc anymore. we're moving on.

Original comment by dorma...@rydia.net on 15 Apr 2011 at 6:40